@formio/js 5.1.0-dev.6126.7fb6eb6 → 5.1.0-dev.6128.3d38003

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see formio.embed.min.js.LICENSE.txt */
2
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class t{constructor(e,o={}){this.baseUrl=e||t.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.3",bootstrap4:"4.6.2",bootstrap5:"5.3.3",bootswatch:"5.3.3","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",dragula:"3.7.3",flatpickr:"4.6.13","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,t){let s=e;return o&&(s+=`/${o}`),e.match(/cdn\.(test-)?form.io/)&&t&&"latest"!==t&&(s+=`/${t}`),s}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}t.defaultCDN="https://cdn.form.io",o.default=t},96517:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const s=t(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return s.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let t=null,i=o.length;const r=e.scriptName||"formio.embed.";for(;i--;)if(o[i].src&&-1!==o[i].src.indexOf(r)){t=o[i];break}if(t){const o={};t.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let i=t.src.replace(/^([^?]+).*/,"$1").split("/");i.pop();let r="";["js","offline"].includes(i[i.length-1])?(i.pop(),i=r=i.join("/"),i+="/js"):i=i.join("/");const n="true"===o.debug||"1"===o.debug,a=n?"formio.form":"formio.form.min";s.Formio.config=Object.assign({script:o.script||`${i}/${a}.js`,style:o.styles||`${i}/${a}.css`,cdn:o.cdn||r,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,noshadow:"false"===o.shadow||"0"===o.shadow,template:o.template||"bootstrap",debug:n,config:{},redirect:o.return||o.redirect,embedCSS:`${i}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e),s.Formio.config.alter&&s.Formio.config.alter(s.Formio.config);const c=s.Formio.config.form||s.Formio.config.src;if(c){s.Formio.debug("Embedding Configuration",e),s.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,s.Formio.debug("Creating form element");const o=s.Formio.createElement("div",{id:s.Formio.config.id,class:s.Formio.config.class});t.parentNode.insertBefore(o,t.parentNode.firstElementChild.nextSibling),s.Formio.createForm(o,c,s.Formio.config.config).then((e=>{s.Formio.config.submit&&(e.nosubmit=!0),e.on("submitDone",(o=>s.Formio.submitDone(e,o))),e.on("submit",(o=>{if(s.Formio.debug("on('submit')",o),s.Formio.config.submit){s.Formio.debug(`Sending submission to ${s.Formio.config.submit}`);const t={"content-type":"application/json"},i=s.Formio.FormioClass.getToken();i&&(t["x-jwt-token"]=i),s.Formio.FormioClass.fetch(s.Formio.config.submit,{body:JSON.stringify(o),headers:t,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>{s.Formio.submitDone(e,o)}))}}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,t){var s,i=this&&this.__awaiter||function(e,o,t,s){return new(t||(t=Promise))((function(i,r){function n(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(n,a)}c((s=s.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(t(56036));class a{static setLicense(e,o=!1){s.license=e,!o&&s.FormioClass&&s.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){s.pathType=e,!o&&s.FormioClass&&s.FormioClass.setPathType(e)}static debug(...e){s.config.debug&&console.log(...e)}static clearCache(){s.FormioClass&&s.FormioClass.clearCache()}static global(e,o=""){const t=window[e];return o&&t&&!t[o]?null:(s.debug(`Getting global ${e}`,t),t)}static use(e){s.FormioClass&&s.FormioClass.isRenderer?s.FormioClass.use(e):s.modules.push(e)}static createElement(e,o,t){const i=document.createElement(e);return o?(Object.keys(o).forEach((e=>{i.setAttribute(e,o[e])})),(t||[]).forEach((e=>{i.appendChild(s.createElement(e.tag,e.attrs,e.children))})),i):i}static addScript(e,o,t,r=""){return i(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>s.addScript(e,o))));if(t&&s.global(t,r))return s.debug(`${t} already loaded.`),Promise.resolve(s.global(t));s.debug("Adding Script",o);try{e.appendChild(s.createElement("script",{src:o}))}catch(e){return s.debug(e),Promise.resolve()}return t?new Promise((e=>{s.debug(`Waiting to load ${t}`);const o=setInterval((()=>{s.global(t,r)&&(clearInterval(o),s.debug(`${t} loaded.`),e(s.global(t)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return i(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>s.addStyles(e,o))):(s.debug("Adding Styles",o),e.appendChild(s.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return i(this,void 0,void 0,(function*(){s.debug("Submision Complete",o),s.config.submitDone&&s.config.submitDone(o,e);const t=(s.config.success||"").toString();t&&"false"!==t.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${t}</div>`);let i=s.config.redirect;if(!i&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(s.debug("Return url found in form configuration"),i=e._form.settings.returnUrl||e._form.settings.redirect),i){const t=e.formio?e.formio.formUrl:"",r=!!i.match(/\?/),n=0===i.indexOf(location.origin);i+=r?"&":"?",i+=`sub=${o._id}`,!n&&t&&(i+=`&form=${encodeURIComponent(t)}`),s.debug("Return URL",i),window.location.href=i,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||s.config.includeBuilder,s.fullAdded||o?(s.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,t){return i(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let t=0;t<o.dependencies.length;t++){const i=o.dependencies[t];yield s.addLibrary(e,s.config.libs[i],i)}if(o.css&&(yield s.addStyles(o.global?document.body:e,o.css)),o.js){const i=yield s.addScript(o.global?document.body:e,o.js,!!o.use&&t);if(o.use){s.debug(`Using ${t}`);const e=o.options||{};!e.license&&s.license&&(e.license=s.license),s.use("function"==typeof o.use?o.use(i):i,e)}}if(o.globalStyle){const e=s.createElement("style");e.type="text/css",e.innerHTML=o.globalStyle,document.body.appendChild(e)}}}))}static addLoader(e){return i(this,void 0,void 0,(function*(){e.appendChild(s.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},t=!1){return i(this,void 0,void 0,(function*(){s.cdn=new n.default(s.config.cdn,s.config.cdnUrls||{}),s.config.libs=s.config.libs||{uswds:{dependencies:["fontawesome"],js:`${s.cdn.uswds}/uswds.min.js`,css:`${s.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:"https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css",globalStyle:"@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }"},bootstrap4:{dependencies:["fontawesome"],css:`${s.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${s.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css",globalStyle:'@font-face {\n font-display: block;\n font-family: "bootstrap-icons";\n src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6") format("woff2"),\n url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6") format("woff");\n }'}},["cerulean","cosmo","cyborg","darkly","flatly","journal","litera","lumen","lux","materia","minty","pulse","sandstone","simplex","sketchy","slate","solar","spacelab","superhero","united","yeti"].forEach((e=>{s.config.libs[e]={dependencies:["bootstrap-icons"],css:`${s.cdn.bootswatch}/dist/${e}/bootstrap.min.css`}}));const i=s.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=s.createElement("div",{id:`${i}-wrapper`});e.parentNode.insertBefore(r,e);const a=s.config.includeLibs&&!s.config.noshadow&&"function"==typeof r.attachShadow;a&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const c=a?r:document.body;yield s.addStyles(c,s.config.embedCSS||`${s.cdn.js}/formio.embed.css`),s.addLoader(r);const l=s.config.full?"formio.full":"formio.form",d=s.config.debug?l:`${l}.min`;if(s.FormioClass=yield s.addScript(c,s.formioScript(s.config.script||`${s.cdn.js}/${d}.js`,t),"Formio",t?"isBuilder":"isRenderer"),s.FormioClass.cdn=s.cdn,s.FormioClass.setBaseUrl(o.baseUrl||s.baseUrl||s.config.base),s.FormioClass.setProjectUrl(o.projectUrl||s.projectUrl||s.config.project),s.FormioClass.language=s.language,s.setLicense(s.license||s.config.license||!1),s.modules.forEach((e=>{s.FormioClass.use(e)})),s.icons&&(s.FormioClass.icons=s.icons),s.pathType&&s.FormioClass.setPathType(s.pathType),s.config.template&&s.config.includeLibs&&(yield s.addLibrary(c,s.config.libs[s.config.template],s.config.template)),s.config.libraries||(s.config.libraries=s.config.modules||{}),s.config.premium&&(s.config.libraries.premium=s.config.premium),s.config.libraries)for(const e in s.config.libraries){const o=s.config.libraries[e];o.use=o.use||!0,yield s.addLibrary(c,o,e)}if(yield s.addStyles(c,s.formioScript(s.config.style||`${s.cdn.js}/${d}.css`,t)),a){yield s.addStyles(document.body,s.formioScript(s.config.style||`${s.cdn.js}/${d}.css`,t));const e=["bootstrap","bootstrap4","bootstrap-icons"].map((e=>s.config.libs[e])).filter(Boolean).map((e=>e.css));yield s.addStyles(document.body,e,t)}return s.config.before&&(yield s.config.before(s.FormioClass,e,s.config)),s.FormioClass.license=!0,s._formioReady(s.FormioClass),r}))}static afterCreate(e,o,t){return i(this,void 0,void 0,(function*(){const i=o.querySelector(".formio-loader");return i&&o.removeChild(i),s.FormioClass.events.emit(t,e),s.config.after&&(s.debug("Calling ready callback"),s.config.after(e,s.config)),e}))}static createForm(e,o,t={}){return i(this,void 0,void 0,(function*(){if(s.FormioClass)return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0}));const i=yield s.init(e,t);return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0})).then((e=>(s.config.submission&&(s.debug("Setting submission",s.config.submission),e.submission=s.config.submission),s.afterCreate(e,i,"formEmbedded"),e)))}))}static builder(e,o,t={}){var r;return i(this,void 0,void 0,(function*(){if(null===(r=s.FormioClass)||void 0===r?void 0:r.builder)return s.FormioClass.builder(e,o,t);const i=yield s.init(e,t,!0);return s.FormioClass.builder(e,o,t).then((e=>(s.afterCreate(e,i,"builderEmbedded"),e)))}))}}o.Formio=a,s=a,a.FormioClass=null,a.config={},a.modules=[],a.icons="",a.license="",a.formioReady=new Promise(((e,o)=>{s._formioReady=e,s._formioReadyReject=o})),a.version="5.1.0-dev.2",a.Report={create:(e,o,t={})=>i(void 0,void 0,void 0,(function*(){var i;if(null===(i=s.FormioClass)||void 0===i?void 0:i.Report)return s.FormioClass.Report.create(e,o,t);const r=yield s.init(e,t,!0);return s.FormioClass.Report.create(e,o,t).then((e=>(s.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=a.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class c{constructor(e,o,t){this.form=o,this.element=e,this.options=t||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return a.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=c;class l extends c{create(){return a.builder(this.element,this.form,this.options)}}o.FormBuilder=l,a.Form=c,a.FormBuilder=l}},o={};function t(s){var i=o[s];if(void 0!==i)return i.exports;var r=o[s]={exports:{}};return e[s].call(r.exports,r,r.exports,t),r.exports}var s={};return function(){var e=s;e.Formio=void 0,(0,t(96517).embed)();var o=t(96517);Object.defineProperty(e,"Formio",{enumerable:!0,get:function(){return o.Formio}})}(),s.Formio}()}));
2
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class t{constructor(e,o={}){this.baseUrl=e||t.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.3",bootstrap4:"4.6.2",bootstrap5:"5.3.3",bootswatch:"5.3.3","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",dragula:"3.7.3",flatpickr:"4.6.13","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,t){let s=e;return o&&(s+=`/${o}`),e.match(/cdn\.(test-)?form.io/)&&t&&"latest"!==t&&(s+=`/${t}`),s}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}t.defaultCDN="https://cdn.form.io",o.default=t},96517:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const s=t(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return s.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let t=null,i=o.length;const r=e.scriptName||"formio.embed.";for(;i--;)if(o[i].src&&-1!==o[i].src.indexOf(r)){t=o[i];break}if(t){const o={};t.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let i=t.src.replace(/^([^?]+).*/,"$1").split("/");i.pop();let r="";["js","offline"].includes(i[i.length-1])?(i.pop(),i=r=i.join("/"),i+="/js"):i=i.join("/");const n="true"===o.debug||"1"===o.debug,a=n?"formio.form":"formio.form.min";s.Formio.config=Object.assign({script:o.script||`${i}/${a}.js`,style:o.styles||`${i}/${a}.css`,cdn:o.cdn||r,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,noshadow:"false"===o.shadow||"0"===o.shadow,template:o.template||"bootstrap",debug:n,config:{},redirect:o.return||o.redirect,embedCSS:`${i}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e),s.Formio.config.alter&&s.Formio.config.alter(s.Formio.config);const c=s.Formio.config.form||s.Formio.config.src;if(c){s.Formio.debug("Embedding Configuration",e),s.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,s.Formio.debug("Creating form element");const o=s.Formio.createElement("div",{id:s.Formio.config.id,class:s.Formio.config.class});t.parentNode.insertBefore(o,t.parentNode.firstElementChild.nextSibling),s.Formio.createForm(o,c,s.Formio.config.config).then((e=>{s.Formio.config.submit&&(e.nosubmit=!0),e.on("submitDone",(o=>s.Formio.submitDone(e,o))),e.on("submit",(o=>{if(s.Formio.debug("on('submit')",o),s.Formio.config.submit){s.Formio.debug(`Sending submission to ${s.Formio.config.submit}`);const t={"content-type":"application/json"},i=s.Formio.FormioClass.getToken();i&&(t["x-jwt-token"]=i),s.Formio.FormioClass.fetch(s.Formio.config.submit,{body:JSON.stringify(o),headers:t,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>{s.Formio.submitDone(e,o)}))}}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,t){var s,i=this&&this.__awaiter||function(e,o,t,s){return new(t||(t=Promise))((function(i,r){function n(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(n,a)}c((s=s.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(t(56036));class a{static setLicense(e,o=!1){s.license=e,!o&&s.FormioClass&&s.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){s.pathType=e,!o&&s.FormioClass&&s.FormioClass.setPathType(e)}static debug(...e){s.config.debug&&console.log(...e)}static clearCache(){s.FormioClass&&s.FormioClass.clearCache()}static global(e,o=""){const t=window[e];return o&&t&&!t[o]?null:(s.debug(`Getting global ${e}`,t),t)}static use(e){s.FormioClass&&s.FormioClass.isRenderer?s.FormioClass.use(e):s.modules.push(e)}static createElement(e,o,t){const i=document.createElement(e);return o?(Object.keys(o).forEach((e=>{i.setAttribute(e,o[e])})),(t||[]).forEach((e=>{i.appendChild(s.createElement(e.tag,e.attrs,e.children))})),i):i}static addScript(e,o,t,r=""){return i(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>s.addScript(e,o))));if(t&&s.global(t,r))return s.debug(`${t} already loaded.`),Promise.resolve(s.global(t));s.debug("Adding Script",o);try{e.appendChild(s.createElement("script",{src:o}))}catch(e){return s.debug(e),Promise.resolve()}return t?new Promise((e=>{s.debug(`Waiting to load ${t}`);const o=setInterval((()=>{s.global(t,r)&&(clearInterval(o),s.debug(`${t} loaded.`),e(s.global(t)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return i(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>s.addStyles(e,o))):(s.debug("Adding Styles",o),e.appendChild(s.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return i(this,void 0,void 0,(function*(){s.debug("Submision Complete",o),s.config.submitDone&&s.config.submitDone(o,e);const t=(s.config.success||"").toString();t&&"false"!==t.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${t}</div>`);let i=s.config.redirect;if(!i&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(s.debug("Return url found in form configuration"),i=e._form.settings.returnUrl||e._form.settings.redirect),i){const t=e.formio?e.formio.formUrl:"",r=!!i.match(/\?/),n=0===i.indexOf(location.origin);i+=r?"&":"?",i+=`sub=${o._id}`,!n&&t&&(i+=`&form=${encodeURIComponent(t)}`),s.debug("Return URL",i),window.location.href=i,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||s.config.includeBuilder,s.fullAdded||o?(s.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,t){return i(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let t=0;t<o.dependencies.length;t++){const i=o.dependencies[t];yield s.addLibrary(e,s.config.libs[i],i)}if(o.css&&(yield s.addStyles(o.global?document.body:e,o.css)),o.js){const i=yield s.addScript(o.global?document.body:e,o.js,!!o.use&&t);if(o.use){s.debug(`Using ${t}`);const e=o.options||{};!e.license&&s.license&&(e.license=s.license),s.use("function"==typeof o.use?o.use(i):i,e)}}if(o.globalStyle){const e=s.createElement("style");e.type="text/css",e.innerHTML=o.globalStyle,document.body.appendChild(e)}}}))}static addLoader(e){return i(this,void 0,void 0,(function*(){e.appendChild(s.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},t=!1){return i(this,void 0,void 0,(function*(){s.cdn=new n.default(s.config.cdn,s.config.cdnUrls||{}),s.config.libs=s.config.libs||{uswds:{dependencies:["fontawesome"],js:`${s.cdn.uswds}/uswds.min.js`,css:`${s.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:"https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css",globalStyle:"@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }"},bootstrap4:{dependencies:["fontawesome"],css:`${s.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${s.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css",globalStyle:'@font-face {\n font-display: block;\n font-family: "bootstrap-icons";\n src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6") format("woff2"),\n url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6") format("woff");\n }'}},["cerulean","cosmo","cyborg","darkly","flatly","journal","litera","lumen","lux","materia","minty","pulse","sandstone","simplex","sketchy","slate","solar","spacelab","superhero","united","yeti"].forEach((e=>{s.config.libs[e]={dependencies:["bootstrap-icons"],css:`${s.cdn.bootswatch}/dist/${e}/bootstrap.min.css`}}));const i=s.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=s.createElement("div",{id:`${i}-wrapper`});e.parentNode.insertBefore(r,e);const a=s.config.includeLibs&&!s.config.noshadow&&"function"==typeof r.attachShadow;a&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const c=a?r:document.body;yield s.addStyles(c,s.config.embedCSS||`${s.cdn.js}/formio.embed.css`),s.addLoader(r);const l=s.config.full?"formio.full":"formio.form",d=s.config.debug?l:`${l}.min`;if(s.FormioClass=yield s.addScript(c,s.formioScript(s.config.script||`${s.cdn.js}/${d}.js`,t),"Formio",t?"isBuilder":"isRenderer"),s.FormioClass.cdn=s.cdn,s.FormioClass.setBaseUrl(o.baseUrl||s.baseUrl||s.config.base),s.FormioClass.setProjectUrl(o.projectUrl||s.projectUrl||s.config.project),s.FormioClass.language=s.language,s.setLicense(s.license||s.config.license||!1),s.modules.forEach((e=>{s.FormioClass.use(e)})),s.icons&&(s.FormioClass.icons=s.icons),s.pathType&&s.FormioClass.setPathType(s.pathType),s.config.template&&s.config.includeLibs&&(yield s.addLibrary(c,s.config.libs[s.config.template],s.config.template)),s.config.libraries||(s.config.libraries=s.config.modules||{}),s.config.premium&&(s.config.libraries.premium=s.config.premium),s.config.libraries)for(const e in s.config.libraries){const o=s.config.libraries[e];o.use=o.use||!0,yield s.addLibrary(c,o,e)}return yield s.addStyles(c,s.formioScript(s.config.style||`${s.cdn.js}/${d}.css`,t)),s.config.before&&(yield s.config.before(s.FormioClass,e,s.config)),s.FormioClass.license=!0,s._formioReady(s.FormioClass),r}))}static afterCreate(e,o,t){return i(this,void 0,void 0,(function*(){const i=o.querySelector(".formio-loader");return i&&o.removeChild(i),s.FormioClass.events.emit(t,e),s.config.after&&(s.debug("Calling ready callback"),s.config.after(e,s.config)),e}))}static createForm(e,o,t={}){return i(this,void 0,void 0,(function*(){if(s.FormioClass)return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0}));const i=yield s.init(e,t);return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0})).then((e=>(s.config.submission&&(s.debug("Setting submission",s.config.submission),e.submission=s.config.submission),s.afterCreate(e,i,"formEmbedded"),e)))}))}static builder(e,o,t={}){var r;return i(this,void 0,void 0,(function*(){if(null===(r=s.FormioClass)||void 0===r?void 0:r.builder)return s.FormioClass.builder(e,o,t);const i=yield s.init(e,t,!0);return s.FormioClass.builder(e,o,t).then((e=>(s.afterCreate(e,i,"builderEmbedded"),e)))}))}}o.Formio=a,s=a,a.FormioClass=null,a.config={},a.modules=[],a.icons="",a.license="",a.formioReady=new Promise(((e,o)=>{s._formioReady=e,s._formioReadyReject=o})),a.version="5.1.0-dev.2",a.Report={create:(e,o,t={})=>i(void 0,void 0,void 0,(function*(){var i;if(null===(i=s.FormioClass)||void 0===i?void 0:i.Report)return s.FormioClass.Report.create(e,o,t);const r=yield s.init(e,t,!0);return s.FormioClass.Report.create(e,o,t).then((e=>(s.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=a.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class c{constructor(e,o,t){this.form=o,this.element=e,this.options=t||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return a.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=c;class l extends c{create(){return a.builder(this.element,this.form,this.options)}}o.FormBuilder=l,a.Form=c,a.FormBuilder=l}},o={};function t(s){var i=o[s];if(void 0!==i)return i.exports;var r=o[s]={exports:{}};return e[s].call(r.exports,r,r.exports,t),r.exports}var s={};return function(){var e=s;e.Formio=void 0,(0,t(96517).embed)();var o=t(96517);Object.defineProperty(e,"Formio",{enumerable:!0,get:function(){return o.Formio}})}(),s.Formio}()}));
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see formio.embed.min.js.LICENSE.txt */
2
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class t{constructor(e,o={}){this.baseUrl=e||t.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.3",bootstrap4:"4.6.2",bootstrap5:"5.3.3",bootswatch:"5.3.3","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",dragula:"3.7.3",flatpickr:"4.6.13","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,t){let s=e;return o&&(s+=`/${o}`),e.match(/cdn\.(test-)?form.io/)&&t&&"latest"!==t&&(s+=`/${t}`),s}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}t.defaultCDN="https://cdn.form.io",o.default=t},96517:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const s=t(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return s.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let t=null,i=o.length;const r=e.scriptName||"formio.embed.";for(;i--;)if(o[i].src&&-1!==o[i].src.indexOf(r)){t=o[i];break}if(t){const o={};t.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let i=t.src.replace(/^([^?]+).*/,"$1").split("/");i.pop();let r="";["js","offline"].includes(i[i.length-1])?(i.pop(),i=r=i.join("/"),i+="/js"):i=i.join("/");const n="true"===o.debug||"1"===o.debug,a=n?"formio.form":"formio.form.min";s.Formio.config=Object.assign({script:o.script||`${i}/${a}.js`,style:o.styles||`${i}/${a}.css`,cdn:o.cdn||r,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,noshadow:"false"===o.shadow||"0"===o.shadow,template:o.template||"bootstrap",debug:n,config:{},redirect:o.return||o.redirect,embedCSS:`${i}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e),s.Formio.config.alter&&s.Formio.config.alter(s.Formio.config);const c=s.Formio.config.form||s.Formio.config.src;if(c){s.Formio.debug("Embedding Configuration",e),s.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,s.Formio.debug("Creating form element");const o=s.Formio.createElement("div",{id:s.Formio.config.id,class:s.Formio.config.class});t.parentNode.insertBefore(o,t.parentNode.firstElementChild.nextSibling),s.Formio.createForm(o,c,s.Formio.config.config).then((e=>{s.Formio.config.submit&&(e.nosubmit=!0),e.on("submitDone",(o=>s.Formio.submitDone(e,o))),e.on("submit",(o=>{if(s.Formio.debug("on('submit')",o),s.Formio.config.submit){s.Formio.debug(`Sending submission to ${s.Formio.config.submit}`);const t={"content-type":"application/json"},i=s.Formio.FormioClass.getToken();i&&(t["x-jwt-token"]=i),s.Formio.FormioClass.fetch(s.Formio.config.submit,{body:JSON.stringify(o),headers:t,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>{s.Formio.submitDone(e,o)}))}}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,t){var s,i=this&&this.__awaiter||function(e,o,t,s){return new(t||(t=Promise))((function(i,r){function n(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(n,a)}c((s=s.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(t(56036));class a{static setLicense(e,o=!1){s.license=e,!o&&s.FormioClass&&s.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){s.pathType=e,!o&&s.FormioClass&&s.FormioClass.setPathType(e)}static debug(...e){s.config.debug&&console.log(...e)}static clearCache(){s.FormioClass&&s.FormioClass.clearCache()}static global(e,o=""){const t=window[e];return o&&t&&!t[o]?null:(s.debug(`Getting global ${e}`,t),t)}static use(e){s.FormioClass&&s.FormioClass.isRenderer?s.FormioClass.use(e):s.modules.push(e)}static createElement(e,o,t){const i=document.createElement(e);return o?(Object.keys(o).forEach((e=>{i.setAttribute(e,o[e])})),(t||[]).forEach((e=>{i.appendChild(s.createElement(e.tag,e.attrs,e.children))})),i):i}static addScript(e,o,t,r=""){return i(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>s.addScript(e,o))));if(t&&s.global(t,r))return s.debug(`${t} already loaded.`),Promise.resolve(s.global(t));s.debug("Adding Script",o);try{e.appendChild(s.createElement("script",{src:o}))}catch(e){return s.debug(e),Promise.resolve()}return t?new Promise((e=>{s.debug(`Waiting to load ${t}`);const o=setInterval((()=>{s.global(t,r)&&(clearInterval(o),s.debug(`${t} loaded.`),e(s.global(t)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return i(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>s.addStyles(e,o))):(s.debug("Adding Styles",o),e.appendChild(s.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return i(this,void 0,void 0,(function*(){s.debug("Submision Complete",o),s.config.submitDone&&s.config.submitDone(o,e);const t=(s.config.success||"").toString();t&&"false"!==t.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${t}</div>`);let i=s.config.redirect;if(!i&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(s.debug("Return url found in form configuration"),i=e._form.settings.returnUrl||e._form.settings.redirect),i){const t=e.formio?e.formio.formUrl:"",r=!!i.match(/\?/),n=0===i.indexOf(location.origin);i+=r?"&":"?",i+=`sub=${o._id}`,!n&&t&&(i+=`&form=${encodeURIComponent(t)}`),s.debug("Return URL",i),window.location.href=i,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||s.config.includeBuilder,s.fullAdded||o?(s.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,t){return i(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let t=0;t<o.dependencies.length;t++){const i=o.dependencies[t];yield s.addLibrary(e,s.config.libs[i],i)}if(o.css&&(yield s.addStyles(o.global?document.body:e,o.css)),o.js){const i=yield s.addScript(o.global?document.body:e,o.js,!!o.use&&t);if(o.use){s.debug(`Using ${t}`);const e=o.options||{};!e.license&&s.license&&(e.license=s.license),s.use("function"==typeof o.use?o.use(i):i,e)}}if(o.globalStyle){const e=s.createElement("style");e.type="text/css",e.innerHTML=o.globalStyle,document.body.appendChild(e)}}}))}static addLoader(e){return i(this,void 0,void 0,(function*(){e.appendChild(s.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},t=!1){return i(this,void 0,void 0,(function*(){s.cdn=new n.default(s.config.cdn,s.config.cdnUrls||{}),s.config.libs=s.config.libs||{uswds:{dependencies:["fontawesome"],js:`${s.cdn.uswds}/uswds.min.js`,css:`${s.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:"https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css",globalStyle:"@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }"},bootstrap4:{dependencies:["fontawesome"],css:`${s.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${s.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css",globalStyle:'@font-face {\n font-display: block;\n font-family: "bootstrap-icons";\n src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6") format("woff2"),\n url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6") format("woff");\n }'}},["cerulean","cosmo","cyborg","darkly","flatly","journal","litera","lumen","lux","materia","minty","pulse","sandstone","simplex","sketchy","slate","solar","spacelab","superhero","united","yeti"].forEach((e=>{s.config.libs[e]={dependencies:["bootstrap-icons"],css:`${s.cdn.bootswatch}/dist/${e}/bootstrap.min.css`}}));const i=s.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=s.createElement("div",{id:`${i}-wrapper`});e.parentNode.insertBefore(r,e);const a=s.config.includeLibs&&!s.config.noshadow&&"function"==typeof r.attachShadow;a&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const c=a?r:document.body;yield s.addStyles(c,s.config.embedCSS||`${s.cdn.js}/formio.embed.css`),s.addLoader(r);const l=s.config.full?"formio.full":"formio.form",d=s.config.debug?l:`${l}.min`;if(s.FormioClass=yield s.addScript(c,s.formioScript(s.config.script||`${s.cdn.js}/${d}.js`,t),"Formio",t?"isBuilder":"isRenderer"),s.FormioClass.cdn=s.cdn,s.FormioClass.setBaseUrl(o.baseUrl||s.baseUrl||s.config.base),s.FormioClass.setProjectUrl(o.projectUrl||s.projectUrl||s.config.project),s.FormioClass.language=s.language,s.setLicense(s.license||s.config.license||!1),s.modules.forEach((e=>{s.FormioClass.use(e)})),s.icons&&(s.FormioClass.icons=s.icons),s.pathType&&s.FormioClass.setPathType(s.pathType),s.config.template&&s.config.includeLibs&&(yield s.addLibrary(c,s.config.libs[s.config.template],s.config.template)),s.config.libraries||(s.config.libraries=s.config.modules||{}),s.config.premium&&(s.config.libraries.premium=s.config.premium),s.config.libraries)for(const e in s.config.libraries){const o=s.config.libraries[e];o.use=o.use||!0,yield s.addLibrary(c,o,e)}if(yield s.addStyles(c,s.formioScript(s.config.style||`${s.cdn.js}/${d}.css`,t)),a){yield s.addStyles(document.body,s.formioScript(s.config.style||`${s.cdn.js}/${d}.css`,t));const e=["bootstrap","bootstrap4","bootstrap-icons"].map((e=>s.config.libs[e])).filter(Boolean).map((e=>e.css));yield s.addStyles(document.body,e,t)}return s.config.before&&(yield s.config.before(s.FormioClass,e,s.config)),s.FormioClass.license=!0,s._formioReady(s.FormioClass),r}))}static afterCreate(e,o,t){return i(this,void 0,void 0,(function*(){const i=o.querySelector(".formio-loader");return i&&o.removeChild(i),s.FormioClass.events.emit(t,e),s.config.after&&(s.debug("Calling ready callback"),s.config.after(e,s.config)),e}))}static createForm(e,o,t={}){return i(this,void 0,void 0,(function*(){if(s.FormioClass)return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0}));const i=yield s.init(e,t);return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0})).then((e=>(s.config.submission&&(s.debug("Setting submission",s.config.submission),e.submission=s.config.submission),s.afterCreate(e,i,"formEmbedded"),e)))}))}static builder(e,o,t={}){var r;return i(this,void 0,void 0,(function*(){if(null===(r=s.FormioClass)||void 0===r?void 0:r.builder)return s.FormioClass.builder(e,o,t);const i=yield s.init(e,t,!0);return s.FormioClass.builder(e,o,t).then((e=>(s.afterCreate(e,i,"builderEmbedded"),e)))}))}}o.Formio=a,s=a,a.FormioClass=null,a.config={},a.modules=[],a.icons="",a.license="",a.formioReady=new Promise(((e,o)=>{s._formioReady=e,s._formioReadyReject=o})),a.version="5.1.0-dev.2",a.Report={create:(e,o,t={})=>i(void 0,void 0,void 0,(function*(){var i;if(null===(i=s.FormioClass)||void 0===i?void 0:i.Report)return s.FormioClass.Report.create(e,o,t);const r=yield s.init(e,t,!0);return s.FormioClass.Report.create(e,o,t).then((e=>(s.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=a.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class c{constructor(e,o,t){this.form=o,this.element=e,this.options=t||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return a.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=c;class l extends c{create(){return a.builder(this.element,this.form,this.options)}}o.FormBuilder=l,a.Form=c,a.FormBuilder=l}},o={};function t(s){var i=o[s];if(void 0!==i)return i.exports;var r=o[s]={exports:{}};return e[s].call(r.exports,r,r.exports,t),r.exports}var s={};return function(){var e=s;e.Formio=void 0,(0,t(96517).embed)();var o=t(96517);Object.defineProperty(e,"Formio",{enumerable:!0,get:function(){return o.Formio}})}(),s.Formio}()}));
2
+ !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.Formio=o():e.Formio=o()}(self,(function(){return function(){"use strict";var e={56036:function(e,o){Object.defineProperty(o,"__esModule",{value:!0});class t{constructor(e,o={}){this.baseUrl=e||t.defaultCDN,this.overrides=o,this.libs={js:"",ace:"1.4.12",bootstrap:"5.3.3",bootstrap4:"4.6.2",bootstrap5:"5.3.3",bootswatch:"5.3.3","bootstrap-icons":"1.11.1",ckeditor:"19.0.0",dragula:"3.7.3",flatpickr:"4.6.13","font-awesome":"4.7.0",grid:"latest","moment-timezone":"latest",quill:"2.0.0-dev.3","shortcut-buttons-flatpickr":"0.4.0",uswds:"2.4.8",core:""},this.updateUrls()}getVersion(e){return this.libs[e]}setVersion(e,o){this.libs[e]=o,this.updateUrls()}setBaseUrl(e){this.baseUrl=e,this.updateUrls()}setOverrideUrl(e,o){this.overrides[e]=o,this.updateUrls()}removeOverride(e){delete this.overrides[e],this.updateUrls()}removeOverrides(){this.overrides={},this.updateUrls()}buildUrl(e,o,t){let s=e;return o&&(s+=`/${o}`),e.match(/cdn\.(test-)?form.io/)&&t&&"latest"!==t&&(s+=`/${t}`),s}updateUrls(){for(const e in this.libs)if(e in this.overrides)if("string"==typeof this.overrides[e])this[e]=this.buildUrl(this.overrides[e],e,this.libs[e]);else{const o=this.overrides[e];this[e]=this.buildUrl(o.cdn,o.lib||"",o.version||"")}else this[e]=this.buildUrl(this.baseUrl,e,this.libs[e])}}t.defaultCDN="https://cdn.form.io",o.default=t},96517:function(e,o,t){Object.defineProperty(o,"__esModule",{value:!0}),o.Formio=o.embed=void 0;const s=t(95413);Object.defineProperty(o,"Formio",{enumerable:!0,get:function(){return s.Formio}}),o.embed=function(e={}){const o=document.getElementsByTagName("script");e=Object.assign({},window.FormioConfig||{},e);let t=null,i=o.length;const r=e.scriptName||"formio.embed.";for(;i--;)if(o[i].src&&-1!==o[i].src.indexOf(r)){t=o[i];break}if(t){const o={};t.src.replace(/^[^?]+\??/,"").replace(/\?/g,"&").split("&").forEach((e=>{o[e.split("=")[0]]=e.split("=")[1]&&decodeURIComponent(e.split("=")[1])}));let i=t.src.replace(/^([^?]+).*/,"$1").split("/");i.pop();let r="";["js","offline"].includes(i[i.length-1])?(i.pop(),i=r=i.join("/"),i+="/js"):i=i.join("/");const n="true"===o.debug||"1"===o.debug,a=n?"formio.form":"formio.form.min";s.Formio.config=Object.assign({script:o.script||`${i}/${a}.js`,style:o.styles||`${i}/${a}.css`,cdn:o.cdn||r,class:o.class||"formio-form-wrapper",src:o.src,form:null,submission:null,project:o.project,base:o.base||"https://api.form.io",submit:o.submit,includeLibs:"true"===o.libs||"1"===o.libs,noshadow:"false"===o.shadow||"0"===o.shadow,template:o.template||"bootstrap",debug:n,config:{},redirect:o.return||o.redirect,embedCSS:`${i}/formio.embed.css`,success:o.success||"Thank you for your submission!",before:null,after:null},e),s.Formio.config.alter&&s.Formio.config.alter(s.Formio.config);const c=s.Formio.config.form||s.Formio.config.src;if(c){s.Formio.debug("Embedding Configuration",e),s.Formio.config.id=`formio-${Math.random().toString(36).substring(7)}`,s.Formio.debug("Creating form element");const o=s.Formio.createElement("div",{id:s.Formio.config.id,class:s.Formio.config.class});t.parentNode.insertBefore(o,t.parentNode.firstElementChild.nextSibling),s.Formio.createForm(o,c,s.Formio.config.config).then((e=>{s.Formio.config.submit&&(e.nosubmit=!0),e.on("submitDone",(o=>s.Formio.submitDone(e,o))),e.on("submit",(o=>{if(s.Formio.debug("on('submit')",o),s.Formio.config.submit){s.Formio.debug(`Sending submission to ${s.Formio.config.submit}`);const t={"content-type":"application/json"},i=s.Formio.FormioClass.getToken();i&&(t["x-jwt-token"]=i),s.Formio.FormioClass.fetch(s.Formio.config.submit,{body:JSON.stringify(o),headers:t,method:"POST",mode:"cors"}).then((e=>e.json())).then((o=>{s.Formio.submitDone(e,o)}))}}))}))}}else document.write("<span>Could not locate the Embedded form.</span>")}},95413:function(e,o,t){var s,i=this&&this.__awaiter||function(e,o,t,s){return new(t||(t=Promise))((function(i,r){function n(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(n,a)}c((s=s.apply(e,o||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0}),o.FormBuilder=o.Form=o.Formio=void 0;const n=r(t(56036));class a{static setLicense(e,o=!1){s.license=e,!o&&s.FormioClass&&s.FormioClass.setLicense(e)}static setBaseUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setBaseUrl(e)}static setApiUrl(e,o=!1){s.baseUrl=e,!o&&s.FormioClass&&s.FormioClass.setApiUrl(e)}static setProjectUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setProjectUrl(e)}static setAppUrl(e,o=!1){s.projectUrl=e,!o&&s.FormioClass&&s.FormioClass.setAppUrl(e)}static setPathType(e,o=!1){s.pathType=e,!o&&s.FormioClass&&s.FormioClass.setPathType(e)}static debug(...e){s.config.debug&&console.log(...e)}static clearCache(){s.FormioClass&&s.FormioClass.clearCache()}static global(e,o=""){const t=window[e];return o&&t&&!t[o]?null:(s.debug(`Getting global ${e}`,t),t)}static use(e){s.FormioClass&&s.FormioClass.isRenderer?s.FormioClass.use(e):s.modules.push(e)}static createElement(e,o,t){const i=document.createElement(e);return o?(Object.keys(o).forEach((e=>{i.setAttribute(e,o[e])})),(t||[]).forEach((e=>{i.appendChild(s.createElement(e.tag,e.attrs,e.children))})),i):i}static addScript(e,o,t,r=""){return i(this,void 0,void 0,(function*(){if(!o)return Promise.resolve();if("string"!=typeof o&&o.length)return Promise.all(o.map((o=>s.addScript(e,o))));if(t&&s.global(t,r))return s.debug(`${t} already loaded.`),Promise.resolve(s.global(t));s.debug("Adding Script",o);try{e.appendChild(s.createElement("script",{src:o}))}catch(e){return s.debug(e),Promise.resolve()}return t?new Promise((e=>{s.debug(`Waiting to load ${t}`);const o=setInterval((()=>{s.global(t,r)&&(clearInterval(o),s.debug(`${t} loaded.`),e(s.global(t)))}),100)})):Promise.resolve()}))}static addStyles(e,o){return i(this,void 0,void 0,(function*(){o&&("string"!=typeof o&&o.length?o.forEach((o=>s.addStyles(e,o))):(s.debug("Adding Styles",o),e.appendChild(s.createElement("link",{rel:"stylesheet",href:o}))))}))}static submitDone(e,o){return i(this,void 0,void 0,(function*(){s.debug("Submision Complete",o),s.config.submitDone&&s.config.submitDone(o,e);const t=(s.config.success||"").toString();t&&"false"!==t.toLowerCase()&&e.element&&(e.element.innerHTML=`<div class="alert-success" role="alert">${t}</div>`);let i=s.config.redirect;if(!i&&e._form&&e._form.settings&&(e._form.settings.returnUrl||e._form.settings.redirect)&&(s.debug("Return url found in form configuration"),i=e._form.settings.returnUrl||e._form.settings.redirect),i){const t=e.formio?e.formio.formUrl:"",r=!!i.match(/\?/),n=0===i.indexOf(location.origin);i+=r?"&":"?",i+=`sub=${o._id}`,!n&&t&&(i+=`&form=${encodeURIComponent(t)}`),s.debug("Return URL",i),window.location.href=i,n&&window.location.reload()}}))}static formioScript(e,o){return o=o||s.config.includeBuilder,s.fullAdded||o?(s.fullAdded=!0,e.replace("formio.form","formio.full")):e}static addLibrary(e,o,t){return i(this,void 0,void 0,(function*(){if(o){if(o.dependencies)for(let t=0;t<o.dependencies.length;t++){const i=o.dependencies[t];yield s.addLibrary(e,s.config.libs[i],i)}if(o.css&&(yield s.addStyles(o.global?document.body:e,o.css)),o.js){const i=yield s.addScript(o.global?document.body:e,o.js,!!o.use&&t);if(o.use){s.debug(`Using ${t}`);const e=o.options||{};!e.license&&s.license&&(e.license=s.license),s.use("function"==typeof o.use?o.use(i):i,e)}}if(o.globalStyle){const e=s.createElement("style");e.type="text/css",e.innerHTML=o.globalStyle,document.body.appendChild(e)}}}))}static addLoader(e){return i(this,void 0,void 0,(function*(){e.appendChild(s.createElement("div",{class:"formio-loader"},[{tag:"div",attrs:{class:"loader-wrapper"},children:[{tag:"div",attrs:{class:"loader text-center"}}]}]))}))}static init(e,o={},t=!1){return i(this,void 0,void 0,(function*(){s.cdn=new n.default(s.config.cdn,s.config.cdnUrls||{}),s.config.libs=s.config.libs||{uswds:{dependencies:["fontawesome"],js:`${s.cdn.uswds}/uswds.min.js`,css:`${s.cdn.uswds}/uswds.min.css`,use:!0},fontawesome:{css:"https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css",globalStyle:"@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }"},bootstrap4:{dependencies:["fontawesome"],css:`${s.cdn.bootstrap4}/css/bootstrap.min.css`},bootstrap:{dependencies:["bootstrap-icons"],css:`${s.cdn.bootstrap}/css/bootstrap.min.css`},"bootstrap-icons":{css:"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css",globalStyle:'@font-face {\n font-display: block;\n font-family: "bootstrap-icons";\n src: url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6") format("woff2"),\n url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6") format("woff");\n }'}},["cerulean","cosmo","cyborg","darkly","flatly","journal","litera","lumen","lux","materia","minty","pulse","sandstone","simplex","sketchy","slate","solar","spacelab","superhero","united","yeti"].forEach((e=>{s.config.libs[e]={dependencies:["bootstrap-icons"],css:`${s.cdn.bootswatch}/dist/${e}/bootstrap.min.css`}}));const i=s.config.id||`formio-${Math.random().toString(36).substring(7)}`;let r=s.createElement("div",{id:`${i}-wrapper`});e.parentNode.insertBefore(r,e);const a=s.config.includeLibs&&!s.config.noshadow&&"function"==typeof r.attachShadow;a&&(r=r.attachShadow({mode:"open"}),o.shadowRoot=r),e.parentNode.removeChild(e),r.appendChild(e);const c=a?r:document.body;yield s.addStyles(c,s.config.embedCSS||`${s.cdn.js}/formio.embed.css`),s.addLoader(r);const l=s.config.full?"formio.full":"formio.form",d=s.config.debug?l:`${l}.min`;if(s.FormioClass=yield s.addScript(c,s.formioScript(s.config.script||`${s.cdn.js}/${d}.js`,t),"Formio",t?"isBuilder":"isRenderer"),s.FormioClass.cdn=s.cdn,s.FormioClass.setBaseUrl(o.baseUrl||s.baseUrl||s.config.base),s.FormioClass.setProjectUrl(o.projectUrl||s.projectUrl||s.config.project),s.FormioClass.language=s.language,s.setLicense(s.license||s.config.license||!1),s.modules.forEach((e=>{s.FormioClass.use(e)})),s.icons&&(s.FormioClass.icons=s.icons),s.pathType&&s.FormioClass.setPathType(s.pathType),s.config.template&&s.config.includeLibs&&(yield s.addLibrary(c,s.config.libs[s.config.template],s.config.template)),s.config.libraries||(s.config.libraries=s.config.modules||{}),s.config.premium&&(s.config.libraries.premium=s.config.premium),s.config.libraries)for(const e in s.config.libraries){const o=s.config.libraries[e];o.use=o.use||!0,yield s.addLibrary(c,o,e)}return yield s.addStyles(c,s.formioScript(s.config.style||`${s.cdn.js}/${d}.css`,t)),s.config.before&&(yield s.config.before(s.FormioClass,e,s.config)),s.FormioClass.license=!0,s._formioReady(s.FormioClass),r}))}static afterCreate(e,o,t){return i(this,void 0,void 0,(function*(){const i=o.querySelector(".formio-loader");return i&&o.removeChild(i),s.FormioClass.events.emit(t,e),s.config.after&&(s.debug("Calling ready callback"),s.config.after(e,s.config)),e}))}static createForm(e,o,t={}){return i(this,void 0,void 0,(function*(){if(s.FormioClass)return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0}));const i=yield s.init(e,t);return s.FormioClass.createForm(e,o,Object.assign(Object.assign({},t),{noLoader:!0})).then((e=>(s.config.submission&&(s.debug("Setting submission",s.config.submission),e.submission=s.config.submission),s.afterCreate(e,i,"formEmbedded"),e)))}))}static builder(e,o,t={}){var r;return i(this,void 0,void 0,(function*(){if(null===(r=s.FormioClass)||void 0===r?void 0:r.builder)return s.FormioClass.builder(e,o,t);const i=yield s.init(e,t,!0);return s.FormioClass.builder(e,o,t).then((e=>(s.afterCreate(e,i,"builderEmbedded"),e)))}))}}o.Formio=a,s=a,a.FormioClass=null,a.config={},a.modules=[],a.icons="",a.license="",a.formioReady=new Promise(((e,o)=>{s._formioReady=e,s._formioReadyReject=o})),a.version="5.1.0-dev.2",a.Report={create:(e,o,t={})=>i(void 0,void 0,void 0,(function*(){var i;if(null===(i=s.FormioClass)||void 0===i?void 0:i.Report)return s.FormioClass.Report.create(e,o,t);const r=yield s.init(e,t,!0);return s.FormioClass.Report.create(e,o,t).then((e=>(s.afterCreate(e,r,"reportEmbedded"),e)))}))},n.default.defaultCDN=a.version.includes("rc")?"https://cdn.test-form.io":"https://cdn.form.io";class c{constructor(e,o,t){this.form=o,this.element=e,this.options=t||{},this.init(),this.instance={proxy:!0,ready:this.ready,destroy:()=>{}}}init(){this.instance&&!this.instance.proxy&&this.instance.destroy(),this.element.innerHTML="",this.ready=this.create().then((e=>(this.instance=e,this.form=e.form,e)))}create(){return a.createForm(this.element,this.form,this.options)}setForm(e){this.form=e,this.instance&&this.instance.setForm(e)}setDisplay(e){return this.instance.proxy||(this.form.display=e,this.instance.destroy(),this.ready=this.create().then((e=>{this.instance=e,this.setForm(this.form)}))),this.ready}}o.Form=c;class l extends c{create(){return a.builder(this.element,this.form,this.options)}}o.FormBuilder=l,a.Form=c,a.FormBuilder=l}},o={};function t(s){var i=o[s];if(void 0!==i)return i.exports;var r=o[s]={exports:{}};return e[s].call(r.exports,r,r.exports,t),r.exports}var s={};return function(){var e=s;e.Formio=void 0,(0,t(96517).embed)();var o=t(96517);Object.defineProperty(e,"Formio",{enumerable:!0,get:function(){return o.Formio}})}(),s.Formio}()}));
@@ -5821,7 +5821,7 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
5821
5821
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
5822
5822
 
5823
5823
  "use strict";
5824
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.registerEvaluator = exports.Evaluator = exports.DefaultEvaluator = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst string_hash_1 = __importDefault(__webpack_require__(/*! string-hash */ \"./node_modules/string-hash/index.js\"));\nconst core_1 = __webpack_require__(/*! @formio/core */ \"./node_modules/@formio/core/lib/index.js\");\nclass DefaultEvaluator extends core_1.DefaultEvaluator {\n constructor() {\n super(...arguments);\n this.cache = {};\n this.protectedEval = false;\n }\n template(template, hash) {\n hash = hash || (0, string_hash_1.default)(template);\n if (this.cache[hash]) {\n return this.cache[hash];\n }\n try {\n // Ensure we handle copied templates from the ejs files.\n template = template.replace(/ctx\\./g, '');\n return (this.cache[hash] = lodash_1.default.template(template, this.templateSettings));\n }\n catch (err) {\n console.warn('Error while processing template', err, template);\n }\n }\n interpolate(rawTemplate, data, _options) {\n // Ensure reverse compatability.\n const options = lodash_1.default.isObject(_options) ? _options : { noeval: _options };\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n rawTemplate = String(rawTemplate);\n let template;\n if (this.noeval || options.noeval) {\n return this.interpolateString(rawTemplate, data, _options);\n }\n else {\n template = this.template(rawTemplate);\n }\n if (typeof template === 'function') {\n try {\n return template(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, rawTemplate, data);\n return err.message;\n }\n }\n return template;\n }\n}\nexports.DefaultEvaluator = DefaultEvaluator;\nexports.Evaluator = new DefaultEvaluator();\n/**\n * Set the evaluator to use for evaluating expressions.\n * @param {CoreEvaluator} override - The new evaluator instance to use.\n * @returns {void}\n */\nfunction registerEvaluator(override) {\n exports.Evaluator = override;\n}\nexports.registerEvaluator = registerEvaluator;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/Evaluator.js?");
5824
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.registerEvaluator = exports.interpolate = exports.Evaluator = exports.DefaultEvaluator = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst string_hash_1 = __importDefault(__webpack_require__(/*! string-hash */ \"./node_modules/string-hash/index.js\"));\nconst core_1 = __webpack_require__(/*! @formio/core */ \"./node_modules/@formio/core/lib/index.js\");\nclass DefaultEvaluator extends core_1.DefaultEvaluator {\n constructor() {\n super(...arguments);\n this.cache = {};\n this.protectedEval = false;\n }\n template(template, hash) {\n hash = hash || (0, string_hash_1.default)(template);\n if (this.cache[hash]) {\n return this.cache[hash];\n }\n try {\n // Ensure we handle copied templates from the ejs files.\n template = template.replace(/ctx\\./g, '');\n return (this.cache[hash] = lodash_1.default.template(template, this.templateSettings));\n }\n catch (err) {\n console.warn('Error while processing template', err, template);\n }\n }\n interpolate(rawTemplate, data, _options) {\n // Ensure reverse compatability.\n const options = lodash_1.default.isObject(_options) ? _options : { noeval: _options };\n if (typeof rawTemplate === 'function') {\n try {\n return rawTemplate(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, data);\n return err.message;\n }\n }\n rawTemplate = String(rawTemplate);\n let template;\n if (this.noeval || options.noeval) {\n return this.interpolateString(rawTemplate, data, _options);\n }\n else {\n template = this.template(rawTemplate);\n }\n if (typeof template === 'function') {\n try {\n return template(data);\n }\n catch (err) {\n console.warn('Error interpolating template', err, rawTemplate, data);\n return err.message;\n }\n }\n return template;\n }\n}\nexports.DefaultEvaluator = DefaultEvaluator;\nexports.Evaluator = new DefaultEvaluator();\n// preserve the standalone interpolate function for backwards compatibility\nexports.interpolate = exports.Evaluator.interpolate;\n/**\n * Set the evaluator to use for evaluating expressions.\n * @param {CoreEvaluator} override - The new evaluator instance to use.\n * @returns {void}\n */\nfunction registerEvaluator(override) {\n exports.Evaluator = override;\n}\nexports.registerEvaluator = registerEvaluator;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/Evaluator.js?");
5825
5825
 
5826
5826
  /***/ }),
5827
5827
 
@@ -6085,7 +6085,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
6085
6085
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6086
6086
 
6087
6087
  "use strict";
6088
- eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.registerEvaluator = exports.Evaluator = exports.Utils = void 0;\nconst utils = __importStar(__webpack_require__(/*! ./utils */ \"./lib/cjs/utils/utils.js\"));\nconst formUtils = __importStar(__webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\"));\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\nObject.defineProperty(exports, \"Evaluator\", ({ enumerable: true, get: function () { return Evaluator_1.Evaluator; } }));\nObject.defineProperty(exports, \"registerEvaluator\", ({ enumerable: true, get: function () { return Evaluator_1.registerEvaluator; } }));\nconst FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator });\nexports.Utils = FormioUtils;\nif (typeof __webpack_require__.g === 'object') {\n __webpack_require__.g.FormioUtils = FormioUtils;\n}\n__exportStar(__webpack_require__(/*! ./utils */ \"./lib/cjs/utils/utils.js\"), exports);\n__exportStar(__webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\"), exports);\nexports[\"default\"] = FormioUtils;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/index.js?");
6088
+ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.registerEvaluator = exports.Evaluator = exports.Utils = void 0;\nconst utils = __importStar(__webpack_require__(/*! ./utils */ \"./lib/cjs/utils/utils.js\"));\nconst formUtils = __importStar(__webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\"));\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\nObject.defineProperty(exports, \"Evaluator\", ({ enumerable: true, get: function () { return Evaluator_1.Evaluator; } }));\nObject.defineProperty(exports, \"registerEvaluator\", ({ enumerable: true, get: function () { return Evaluator_1.registerEvaluator; } }));\nconst FormioUtils = Object.assign(Object.assign(Object.assign({}, utils), formUtils), { Evaluator: Evaluator_1.Evaluator,\n interpolate: Evaluator_1.interpolate });\nexports.Utils = FormioUtils;\nif (typeof __webpack_require__.g === 'object') {\n __webpack_require__.g.FormioUtils = FormioUtils;\n}\n__exportStar(__webpack_require__(/*! ./utils */ \"./lib/cjs/utils/utils.js\"), exports);\n__exportStar(__webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\"), exports);\nexports[\"default\"] = FormioUtils;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/index.js?");
6089
6089
 
6090
6090
  /***/ }),
6091
6091
 
@@ -8853,7 +8853,7 @@ eval("\nvar parent = __webpack_require__(/*! ../../es/object/from-entries */ \".
8853
8853
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8854
8854
 
8855
8855
  "use strict";
8856
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n if (!attrs) {\n return element;\n }\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n if (_a.config.submitDone) {\n _a.config.submitDone(submission, instance);\n }\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(libWrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n const libName = lib.dependencies[i];\n yield _a.addLibrary(libWrapper, _a.config.libs[libName], libName);\n }\n }\n if (lib.css) {\n yield _a.addStyles((lib.global ? document.body : libWrapper), lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript((lib.global ? document.body : libWrapper), lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n if (lib.globalStyle) {\n const style = _a.createElement('style');\n style.type = 'text/css';\n style.innerHTML = lib.globalStyle;\n document.body.appendChild(style);\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n });\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: `https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css`,\n globalStyle: `@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: 'https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css',\n globalStyle: `@font-face {\n font-display: block;\n font-family: \"bootstrap-icons\";\n src: url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6\") format(\"woff2\"),\n url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6\") format(\"woff\");\n }`\n },\n };\n // Add all bootswatch templates.\n ['cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', 'litera', 'lumen', 'lux', 'materia', 'minty', 'pulse', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'united', 'yeti'].forEach((template) => {\n _a.config.libs[template] = {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootswatch}/dist/${template}/bootstrap.min.css`\n };\n });\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs && !_a.config.noshadow && (typeof wrapper.attachShadow === 'function');\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n if (!_a.config.libraries) {\n _a.config.libraries = _a.config.modules || {};\n }\n // Adding premium if it is provided via the config.\n if (_a.config.premium) {\n _a.config.libraries.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.libraries) {\n for (const name in _a.config.libraries) {\n const lib = _a.config.libraries[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n // In some cases (dropdown list of autocomplete or confirmation popup of skethpad) we render elements outside of shadow dom\n // and as result we can't get access to this styles outside of shadow dom. Here i added needed styles to work it properly\n if (useShadowDom) {\n yield _a.addStyles(document.body, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n const toGlobalStyleLibs = [\"bootstrap\", \"bootstrap4\", \"bootstrap-icons\"];\n const libHrefs = toGlobalStyleLibs.map(key => _a.config.libs[key]).filter(Boolean).map(href => href.css);\n yield _a.addStyles(document.body, libHrefs, builder);\n }\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n _a.FormioClass.events.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.1.0-dev.2';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
8856
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n if (!attrs) {\n return element;\n }\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n if (_a.config.submitDone) {\n _a.config.submitDone(submission, instance);\n }\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(libWrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n const libName = lib.dependencies[i];\n yield _a.addLibrary(libWrapper, _a.config.libs[libName], libName);\n }\n }\n if (lib.css) {\n yield _a.addStyles((lib.global ? document.body : libWrapper), lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript((lib.global ? document.body : libWrapper), lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n if (lib.globalStyle) {\n const style = _a.createElement('style');\n style.type = 'text/css';\n style.innerHTML = lib.globalStyle;\n document.body.appendChild(style);\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n });\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: `https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css`,\n globalStyle: `@font-face {\n font-family: 'FontAwesome';\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?v=4.7.0');\n src: url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');\n font-weight: normal;\n font-style: normal;\n }`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n // Due to an issue with font-face not loading in the shadowdom (https://issues.chromium.org/issues/41085401), we need\n // to do 2 things. 1.) Load the fonts from the global cdn, and 2.) add the font-face to the global styles on the page.\n css: 'https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.min.css',\n globalStyle: `@font-face {\n font-display: block;\n font-family: \"bootstrap-icons\";\n src: url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff2?dd67030699838ea613ee6dbda90effa6\") format(\"woff2\"),\n url(\"https://cdn.jsdelivr.net/npm/bootstrap-icons/font/fonts/bootstrap-icons.woff?dd67030699838ea613ee6dbda90effa6\") format(\"woff\");\n }`\n }\n };\n // Add all bootswatch templates.\n ['cerulean', 'cosmo', 'cyborg', 'darkly', 'flatly', 'journal', 'litera', 'lumen', 'lux', 'materia', 'minty', 'pulse', 'sandstone', 'simplex', 'sketchy', 'slate', 'solar', 'spacelab', 'superhero', 'united', 'yeti'].forEach((template) => {\n _a.config.libs[template] = {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootswatch}/dist/${template}/bootstrap.min.css`\n };\n });\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs && !_a.config.noshadow && (typeof wrapper.attachShadow === 'function');\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n if (!_a.config.libraries) {\n _a.config.libraries = _a.config.modules || {};\n }\n // Adding premium if it is provided via the config.\n if (_a.config.premium) {\n _a.config.libraries.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.libraries) {\n for (const name in _a.config.libraries) {\n const lib = _a.config.libraries[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n _a.FormioClass.events.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.1.0-dev.2';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
8857
8857
 
8858
8858
  /***/ }),
8859
8859