@unvired/turboforms-embed-sdk 2.0.85 → 2.0.86

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.
@@ -209,7 +209,7 @@ var Ae=Object.create;var ae=Object.defineProperty;var Oe=Object.getOwnPropertyDe
209
209
  </div>
210
210
  ${(oe=e.themeData)!=null&&oe.isCard?"</div>":""}
211
211
  <div id="sticky-footer" class="${e.showFooter===!1?"footer-hidden":""}">
212
- <div class="build-version">SDK v2.0.85</div>
212
+ <div class="build-version">SDK v2.0.86</div>
213
213
 
214
214
  <button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
215
215
  <i class="bi bi-chevron-left"></i> Previous
@@ -279,4 +279,4 @@ var Ae=Object.create;var ae=Object.defineProperty;var Oe=Object.getOwnPropertyDe
279
279
 
280
280
  // === SCRIPT_SEPARATOR ===
281
281
 
282
- `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,l.info("[TF_SDK:14] \u2705 Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let h=u=>{if(d){let x=d.querySelector(".sdk-loader-text");x&&(x.textContent=u)}};if(h("Loading Core Components..."),m[0]&&m[0].trim()){let u=document.createElement("script");u.textContent=m[0],u.setAttribute("data-unvired-script","jquery"),document.head.appendChild(u)}if(m[4]&&m[4].trim()){let u=document.createElement("script");u.textContent=m[4],u.setAttribute("data-unvired-script","choices"),document.head.appendChild(u)}if(h("Loading Formio Library..."),m[5]&&m[5].trim()){let u=document.createElement("script");u.textContent=m[5],u.setAttribute("data-unvired-script","formio"),document.head.appendChild(u),l.info("[TF_SDK:15] \u2705 Bundled Formio library injected.")}if(e.showComments){h("Loading Annotation Tools...");for(let u=1;u<=2;u++)if(m[u]&&m[u].trim()){let x=document.createElement("script");x.textContent=m[u],x.setAttribute("data-unvired-script",`recogito-${u}`),document.head.appendChild(x),await new Promise(A=>setTimeout(A,0))}}else l.info("[TF_SDK:16] \u2705 Skipping Recogito (comments disabled, optimized load)");if(h("Initializing Engine..."),m[3]&&m[3].trim()){let u=document.createElement("script");u.textContent=m[3],u.setAttribute("data-unvired-script","less"),document.head.appendChild(u)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){l.warn("[TF_SDK:17] \u26A0\uFE0F Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),h("Initializing Components...");for(let u=6;u<m.length;u++){let x=m[u];if(x&&x.trim()){let A=document.createElement("script");A.textContent=x,A.setAttribute("data-unvired-script",`script-${u}`),document.head.appendChild(A),u%5===0&&await new Promise(F=>setTimeout(F,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,l.info("[TF_SDK:18] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(u){let x=document.getElementById("unvired-more-btn"),A=document.getElementById("moreTooltip");x&&A&&!x.contains(u.target)&&!A.contains(u.target)&&(A.style.display="none")})}else if(window.__unviredSdkScriptsLoading)l.info("[TF_SDK:19] \u26A0\uFE0F Scripts are currently loading by another instance - waiting..."),await new Promise(h=>{let u=setInterval(()=>{window.__unviredSdkScriptsLoaded&&(clearInterval(u),h())},50)});else{if(l.info("[TF_SDK:20] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let h="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw l.error("[TF_SDK:21] \u274C ",h),d&&d.classList.add("hidden"),s({type:"ERROR",errorMessage:h,data:{technicalError:new Error(h),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(h)}l.info("[TF_SDK:22] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=w,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.commentsVobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=r,window.sendEventCallback=s,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED",OPEN_CAMERA:"OPEN_CAMERA",BARCODE_SCAN:"BARCODE_SCAN",LOCATION_REQUEST:"LOCATION_REQUEST",ACTION:"ACTION"};let S=o.querySelector("#form-back-btn"),P=o.querySelector("#unvired-more-btn");S&&(e.showBackButton?S.style.setProperty("display","flex","important"):S.style.setProperty("display","none","important")),P&&!e.showMoreButton&&P.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let C={};if(((re=e.environmentVariable)==null?void 0:re.length)>0)for(let h of e.environmentVariable)for(let u in h)C[u]=h[u];Object.keys(C).length>0&&(window.env=C);let B=o.querySelector("#sticky-header"),M=o.querySelector("#sticky-footer"),W=o.querySelector("#formio-wrapper"),D=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),W&&W.classList.add(`${e.mode}-mode`),B&&(B.style.display="none"),M&&(M.style.display="none")):(B&&(B.style.display="flex"),M&&(M.style.display="flex")),D&&(D.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let V=n;if(n&&(l.info("[TF_SDK:23] \u2705 Processing file IDs in submission data (fetching from IndexedDB)..."),V=await he(n,s,r),l.info("[TF_SDK:24] \u2705 File IDs processed \u2014 handing off to form renderer")),d){let h=d.querySelector(".sdk-loader-text");h&&(h.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(l.info("[TF_SDK:25] \u2705 loadTRform not ready yet \u2014 waiting for web-turbo-form.js to signal..."),await new Promise(h=>{let u=()=>{document.removeEventListener("LoadRNformReady",u),l.info("[TF_SDK:26] \u2705 loadTRform is now ready (LoadRNformReady event received)"),h()};document.addEventListener("LoadRNformReady",u),typeof window.loadTRform=="function"&&u()})):l.info("[TF_SDK:27] \u2705 loadTRform already available \u2014 invoking immediately"),l.info("[TF_SDK:28] \u2705 Handing off to loadTRform (web-turbo-form.js)..."),await window.loadTRform(w,V,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,r),Ce(),{sendAction:h=>{var u;h.type==="SET_IMAGE_DATA"&&((u=window.setImageData)==null||u.call(window,h.imageData,h.controlId,h.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),i=await te();t.style.display=i?"block":"none",n&&(n.style.display=i?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ge(t),l.info("[TF_SDK:29] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:30] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await ye(t),l.info("[TF_SDK:31] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:32] \u274C Failed to delete document",n),!1}};window.getAllDocuments=be;window.hasDocuments=te;function qe(){return"2.0.85"}function Ee(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-embed-sdk")||document.body);let i=n.querySelectorAll("table"),o=0,e=null;return i.forEach(r=>{let a=r.getBoundingClientRect().width;a>o&&(o=a,e=r)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=Ee;typeof window!="undefined"&&(window.TurboForms=window.TurboForms||{loadForm:We,getBuildVersion:qe,getMaxTableWidth:Ee});export{qe as getBuildVersion,Ee as getMaxTableWidth,We as loadForm};
282
+ `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,l.info("[TF_SDK:14] \u2705 Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let h=u=>{if(d){let x=d.querySelector(".sdk-loader-text");x&&(x.textContent=u)}};if(h("Loading Core Components..."),m[0]&&m[0].trim()){let u=document.createElement("script");u.textContent=m[0],u.setAttribute("data-unvired-script","jquery"),document.head.appendChild(u)}if(m[4]&&m[4].trim()){let u=document.createElement("script");u.textContent=m[4],u.setAttribute("data-unvired-script","choices"),document.head.appendChild(u)}if(h("Loading Formio Library..."),m[5]&&m[5].trim()){let u=document.createElement("script");u.textContent=m[5],u.setAttribute("data-unvired-script","formio"),document.head.appendChild(u),l.info("[TF_SDK:15] \u2705 Bundled Formio library injected.")}if(e.showComments){h("Loading Annotation Tools...");for(let u=1;u<=2;u++)if(m[u]&&m[u].trim()){let x=document.createElement("script");x.textContent=m[u],x.setAttribute("data-unvired-script",`recogito-${u}`),document.head.appendChild(x),await new Promise(A=>setTimeout(A,0))}}else l.info("[TF_SDK:16] \u2705 Skipping Recogito (comments disabled, optimized load)");if(h("Initializing Engine..."),m[3]&&m[3].trim()){let u=document.createElement("script");u.textContent=m[3],u.setAttribute("data-unvired-script","less"),document.head.appendChild(u)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){l.warn("[TF_SDK:17] \u26A0\uFE0F Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),h("Initializing Components...");for(let u=6;u<m.length;u++){let x=m[u];if(x&&x.trim()){let A=document.createElement("script");A.textContent=x,A.setAttribute("data-unvired-script",`script-${u}`),document.head.appendChild(A),u%5===0&&await new Promise(F=>setTimeout(F,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,l.info("[TF_SDK:18] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(u){let x=document.getElementById("unvired-more-btn"),A=document.getElementById("moreTooltip");x&&A&&!x.contains(u.target)&&!A.contains(u.target)&&(A.style.display="none")})}else if(window.__unviredSdkScriptsLoading)l.info("[TF_SDK:19] \u26A0\uFE0F Scripts are currently loading by another instance - waiting..."),await new Promise(h=>{let u=setInterval(()=>{window.__unviredSdkScriptsLoaded&&(clearInterval(u),h())},50)});else{if(l.info("[TF_SDK:20] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let h="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw l.error("[TF_SDK:21] \u274C ",h),d&&d.classList.add("hidden"),s({type:"ERROR",errorMessage:h,data:{technicalError:new Error(h),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(h)}l.info("[TF_SDK:22] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=w,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.commentsVobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=r,window.sendEventCallback=s,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED",OPEN_CAMERA:"OPEN_CAMERA",BARCODE_SCAN:"BARCODE_SCAN",LOCATION_REQUEST:"LOCATION_REQUEST",ACTION:"ACTION"};let S=o.querySelector("#form-back-btn"),P=o.querySelector("#unvired-more-btn");S&&(e.showBackButton?S.style.setProperty("display","flex","important"):S.style.setProperty("display","none","important")),P&&!e.showMoreButton&&P.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let C={};if(((re=e.environmentVariable)==null?void 0:re.length)>0)for(let h of e.environmentVariable)for(let u in h)C[u]=h[u];Object.keys(C).length>0&&(window.env=C);let B=o.querySelector("#sticky-header"),M=o.querySelector("#sticky-footer"),W=o.querySelector("#formio-wrapper"),D=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),W&&W.classList.add(`${e.mode}-mode`),B&&(B.style.display="none"),M&&(M.style.display="none")):(B&&(B.style.display="flex"),M&&(M.style.display="flex")),D&&(D.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let V=n;if(n&&(l.info("[TF_SDK:23] \u2705 Processing file IDs in submission data (fetching from IndexedDB)..."),V=await he(n,s,r),l.info("[TF_SDK:24] \u2705 File IDs processed \u2014 handing off to form renderer")),d){let h=d.querySelector(".sdk-loader-text");h&&(h.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(l.info("[TF_SDK:25] \u2705 loadTRform not ready yet \u2014 waiting for web-turbo-form.js to signal..."),await new Promise(h=>{let u=()=>{document.removeEventListener("LoadRNformReady",u),l.info("[TF_SDK:26] \u2705 loadTRform is now ready (LoadRNformReady event received)"),h()};document.addEventListener("LoadRNformReady",u),typeof window.loadTRform=="function"&&u()})):l.info("[TF_SDK:27] \u2705 loadTRform already available \u2014 invoking immediately"),l.info("[TF_SDK:28] \u2705 Handing off to loadTRform (web-turbo-form.js)..."),await window.loadTRform(w,V,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,r),Ce(),{sendAction:h=>{var u;h.type==="SET_IMAGE_DATA"&&((u=window.setImageData)==null||u.call(window,h.imageData,h.controlId,h.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),i=await te();t.style.display=i?"block":"none",n&&(n.style.display=i?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ge(t),l.info("[TF_SDK:29] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:30] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await ye(t),l.info("[TF_SDK:31] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:32] \u274C Failed to delete document",n),!1}};window.getAllDocuments=be;window.hasDocuments=te;function qe(){return"2.0.86"}function Ee(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-embed-sdk")||document.body);let i=n.querySelectorAll("table"),o=0,e=null;return i.forEach(r=>{let a=r.getBoundingClientRect().width;a>o&&(o=a,e=r)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=Ee;typeof window!="undefined"&&(window.TurboForms=window.TurboForms||{loadForm:We,getBuildVersion:qe,getMaxTableWidth:Ee});export{qe as getBuildVersion,Ee as getMaxTableWidth,We as loadForm};
@@ -39089,7 +39089,7 @@ Expecting `+b.join(", ")+", got '"+(this.terminals_[y]||y)+"'":x="Parse error on
39089
39089
 
39090
39090
 
39091
39091
  <div id="sticky-footer" class="footer-hidden" style="display: none;">
39092
- <div class="build-version">SDK v2.0.85</div>
39092
+ <div class="build-version">SDK v2.0.86</div>
39093
39093
 
39094
39094
  <button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
39095
39095
  <i class="bi bi-chevron-left"></i> Previous
@@ -209,7 +209,7 @@ var TurboForms=(()=>{var Pe=Object.create;var G=Object.defineProperty;var _e=Obj
209
209
  </div>
210
210
  ${(ie=e.themeData)!=null&&ie.isCard?"</div>":""}
211
211
  <div id="sticky-footer" class="${e.showFooter===!1?"footer-hidden":""}">
212
- <div class="build-version">SDK v2.0.85</div>
212
+ <div class="build-version">SDK v2.0.86</div>
213
213
 
214
214
  <button class="footer-btn footer-btn-secondary" id="prevBtn" style="display:none" onclick="FormOnPrevious()">
215
215
  <i class="bi bi-chevron-left"></i> Previous
@@ -279,4 +279,4 @@ var TurboForms=(()=>{var Pe=Object.create;var G=Object.defineProperty;var _e=Obj
279
279
 
280
280
  // === SCRIPT_SEPARATOR ===
281
281
 
282
- `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,l.info("[TF_SDK:14] \u2705 Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let h=u=>{if(d){let x=d.querySelector(".sdk-loader-text");x&&(x.textContent=u)}};if(h("Loading Core Components..."),m[0]&&m[0].trim()){let u=document.createElement("script");u.textContent=m[0],u.setAttribute("data-unvired-script","jquery"),document.head.appendChild(u)}if(m[4]&&m[4].trim()){let u=document.createElement("script");u.textContent=m[4],u.setAttribute("data-unvired-script","choices"),document.head.appendChild(u)}if(h("Loading Formio Library..."),m[5]&&m[5].trim()){let u=document.createElement("script");u.textContent=m[5],u.setAttribute("data-unvired-script","formio"),document.head.appendChild(u),l.info("[TF_SDK:15] \u2705 Bundled Formio library injected.")}if(e.showComments){h("Loading Annotation Tools...");for(let u=1;u<=2;u++)if(m[u]&&m[u].trim()){let x=document.createElement("script");x.textContent=m[u],x.setAttribute("data-unvired-script",`recogito-${u}`),document.head.appendChild(x),await new Promise(A=>setTimeout(A,0))}}else l.info("[TF_SDK:16] \u2705 Skipping Recogito (comments disabled, optimized load)");if(h("Initializing Engine..."),m[3]&&m[3].trim()){let u=document.createElement("script");u.textContent=m[3],u.setAttribute("data-unvired-script","less"),document.head.appendChild(u)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){l.warn("[TF_SDK:17] \u26A0\uFE0F Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),h("Initializing Components...");for(let u=6;u<m.length;u++){let x=m[u];if(x&&x.trim()){let A=document.createElement("script");A.textContent=x,A.setAttribute("data-unvired-script",`script-${u}`),document.head.appendChild(A),u%5===0&&await new Promise(F=>setTimeout(F,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,l.info("[TF_SDK:18] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(u){let x=document.getElementById("unvired-more-btn"),A=document.getElementById("moreTooltip");x&&A&&!x.contains(u.target)&&!A.contains(u.target)&&(A.style.display="none")})}else if(window.__unviredSdkScriptsLoading)l.info("[TF_SDK:19] \u26A0\uFE0F Scripts are currently loading by another instance - waiting..."),await new Promise(h=>{let u=setInterval(()=>{window.__unviredSdkScriptsLoaded&&(clearInterval(u),h())},50)});else{if(l.info("[TF_SDK:20] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let h="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw l.error("[TF_SDK:21] \u274C ",h),d&&d.classList.add("hidden"),s({type:"ERROR",errorMessage:h,data:{technicalError:new Error(h),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(h)}l.info("[TF_SDK:22] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=w,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.commentsVobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=r,window.sendEventCallback=s,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED",OPEN_CAMERA:"OPEN_CAMERA",BARCODE_SCAN:"BARCODE_SCAN",LOCATION_REQUEST:"LOCATION_REQUEST",ACTION:"ACTION"};let S=o.querySelector("#form-back-btn"),P=o.querySelector("#unvired-more-btn");S&&(e.showBackButton?S.style.setProperty("display","flex","important"):S.style.setProperty("display","none","important")),P&&!e.showMoreButton&&P.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let C={};if(((ae=e.environmentVariable)==null?void 0:ae.length)>0)for(let h of e.environmentVariable)for(let u in h)C[u]=h[u];Object.keys(C).length>0&&(window.env=C);let B=o.querySelector("#sticky-header"),M=o.querySelector("#sticky-footer"),W=o.querySelector("#formio-wrapper"),D=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),W&&W.classList.add(`${e.mode}-mode`),B&&(B.style.display="none"),M&&(M.style.display="none")):(B&&(B.style.display="flex"),M&&(M.style.display="flex")),D&&(D.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let V=n;if(n&&(l.info("[TF_SDK:23] \u2705 Processing file IDs in submission data (fetching from IndexedDB)..."),V=await be(n,s,r),l.info("[TF_SDK:24] \u2705 File IDs processed \u2014 handing off to form renderer")),d){let h=d.querySelector(".sdk-loader-text");h&&(h.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(l.info("[TF_SDK:25] \u2705 loadTRform not ready yet \u2014 waiting for web-turbo-form.js to signal..."),await new Promise(h=>{let u=()=>{document.removeEventListener("LoadRNformReady",u),l.info("[TF_SDK:26] \u2705 loadTRform is now ready (LoadRNformReady event received)"),h()};document.addEventListener("LoadRNformReady",u),typeof window.loadTRform=="function"&&u()})):l.info("[TF_SDK:27] \u2705 loadTRform already available \u2014 invoking immediately"),l.info("[TF_SDK:28] \u2705 Handing off to loadTRform (web-turbo-form.js)..."),await window.loadTRform(w,V,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,r),Se(),{sendAction:h=>{var u;h.type==="SET_IMAGE_DATA"&&((u=window.setImageData)==null||u.call(window,h.imageData,h.controlId,h.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),i=await ne();t.style.display=i?"block":"none",n&&(n.style.display=i?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ve(t),l.info("[TF_SDK:29] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:30] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await we(t),l.info("[TF_SDK:31] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:32] \u274C Failed to delete document",n),!1}};window.getAllDocuments=ye;window.hasDocuments=ne;function Oe(){return"2.0.85"}function re(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-embed-sdk")||document.body);let i=n.querySelectorAll("table"),o=0,e=null;return i.forEach(r=>{let a=r.getBoundingClientRect().width;a>o&&(o=a,e=r)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=re;typeof window!="undefined"&&(window.TurboForms=window.TurboForms||{loadForm:Ae,getBuildVersion:Oe,getMaxTableWidth:re});return Le(Ke);})();
282
+ `);if(!window.__unviredSdkScriptsLoaded&&!window.__unviredSdkScriptsLoading){window.__unviredSdkScriptsLoading=!0,l.info("[TF_SDK:14] \u2705 Loading SDK scripts (jQuery, Formio, Recogito, LESS, components)...");let h=u=>{if(d){let x=d.querySelector(".sdk-loader-text");x&&(x.textContent=u)}};if(h("Loading Core Components..."),m[0]&&m[0].trim()){let u=document.createElement("script");u.textContent=m[0],u.setAttribute("data-unvired-script","jquery"),document.head.appendChild(u)}if(m[4]&&m[4].trim()){let u=document.createElement("script");u.textContent=m[4],u.setAttribute("data-unvired-script","choices"),document.head.appendChild(u)}if(h("Loading Formio Library..."),m[5]&&m[5].trim()){let u=document.createElement("script");u.textContent=m[5],u.setAttribute("data-unvired-script","formio"),document.head.appendChild(u),l.info("[TF_SDK:15] \u2705 Bundled Formio library injected.")}if(e.showComments){h("Loading Annotation Tools...");for(let u=1;u<=2;u++)if(m[u]&&m[u].trim()){let x=document.createElement("script");x.textContent=m[u],x.setAttribute("data-unvired-script",`recogito-${u}`),document.head.appendChild(x),await new Promise(A=>setTimeout(A,0))}}else l.info("[TF_SDK:16] \u2705 Skipping Recogito (comments disabled, optimized load)");if(h("Initializing Engine..."),m[3]&&m[3].trim()){let u=document.createElement("script");u.textContent=m[3],u.setAttribute("data-unvired-script","less"),document.head.appendChild(u)}window.form=window.form||{},window.platform=window.platform||{},window.ResizeObserver=window.ResizeObserver||ResizeObserver,typeof browserMD5File!="undefined"&&(window.form.BMF=new browserMD5File),window.less=window.less||{},typeof window.__Html5QrcodeLibrary__!="undefined"&&(window.html5QrCode=window.__Html5QrcodeLibrary__),typeof window.Html5QrcodeScanner=="undefined"&&(window.Html5QrcodeScanner=class{constructor(){l.warn("[TF_SDK:17] \u26A0\uFE0F Barcode library (Html5QrcodeScanner) is not loaded.")}render(){}clear(){}}),h("Initializing Components...");for(let u=6;u<m.length;u++){let x=m[u];if(x&&x.trim()){let A=document.createElement("script");A.textContent=x,A.setAttribute("data-unvired-script",`script-${u}`),document.head.appendChild(A),u%5===0&&await new Promise(F=>setTimeout(F,0))}}window.__unviredSdkScriptsLoaded=!0,window.__unviredSdkScriptsLoading=!1,l.info("[TF_SDK:18] \u2705 All SDK scripts injected successfully"),document.addEventListener("click",function(u){let x=document.getElementById("unvired-more-btn"),A=document.getElementById("moreTooltip");x&&A&&!x.contains(u.target)&&!A.contains(u.target)&&(A.style.display="none")})}else if(window.__unviredSdkScriptsLoading)l.info("[TF_SDK:19] \u26A0\uFE0F Scripts are currently loading by another instance - waiting..."),await new Promise(h=>{let u=setInterval(()=>{window.__unviredSdkScriptsLoaded&&(clearInterval(u),h())},50)});else{if(l.info("[TF_SDK:20] \u2705 SDK scripts already loaded \u2014 skipping injection"),typeof window.Formio=="undefined"){let h="ErrorCode : 005, Formio library not available even though scripts were loaded.";throw l.error("[TF_SDK:21] \u274C ",h),d&&d.classList.add("hidden"),s({type:"ERROR",errorMessage:h,data:{technicalError:new Error(h),formioPath:"bundled",timestamp:new Date().toISOString()}}),new Error(h)}l.info("[TF_SDK:22] \u2705 Formio verified (previously loaded)")}window.FORM_TEMPLATE=w,window.FORM_PREVIOUS_DATA=n,window.FORM_MODE=e.mode,window.FORM_COMMENTS_DATA=e.commentsData,window.FORM_VOB_ARR=e.commentsVobArr,window.FORM_PLATFORM=e.platform,window.FORM_LANGUAGE=e.language,window.FORM_TRASLATIONS=e.translations,window.FORM_ENV=e.environmentVariable,window.FORM_THEME_DATA=e.themeData,window.FORM_USER_DATA=e.userData,window.FORM_USERS_LIST=e.usersList,window.FORM_CONTROL_DATA=e.controlData,window.FORM_PRIVATE_EXTERNAL=e.privateExternal,window.FORM_PERMISSION=e.permission,window.FORM_ATTACHMENT_FILE_KEYS=r,window.sendEventCallback=s,window.FORM_EVENTS={FORM_RENDER:"FORM_RENDER",SAVE:"FORM_SAVE",SUBMIT:"FORM_SUBMIT",SUBMIT_ERROR:"FORM_SUBMIT_ERROR",BACK_NAVIGATION:"FORM_BACK_NAVIGATION",ONCHANGE:"FORM_ONCHANGE",FORM_LOADED:"FORM_LOADED",OPEN_CAMERA:"OPEN_CAMERA",BARCODE_SCAN:"BARCODE_SCAN",LOCATION_REQUEST:"LOCATION_REQUEST",ACTION:"ACTION"};let S=o.querySelector("#form-back-btn"),P=o.querySelector("#unvired-more-btn");S&&(e.showBackButton?S.style.setProperty("display","flex","important"):S.style.setProperty("display","none","important")),P&&!e.showMoreButton&&P.style.setProperty("display","none","important"),window.__unviredFormsOptions=e,window.checkDocumentsVisibility(),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility(),e.platform==="web"?window.platform={isBrowser:!0,isAndroid:!1,iosPlatform:!1}:e.platform==="android"?window.platform={isBrowser:!1,isAndroid:!0,iosPlatform:!1}:e.platform==="ios"&&(window.platform={isBrowser:!1,isAndroid:!1,iosPlatform:!0});let C={};if(((ae=e.environmentVariable)==null?void 0:ae.length)>0)for(let h of e.environmentVariable)for(let u in h)C[u]=h[u];Object.keys(C).length>0&&(window.env=C);let B=o.querySelector("#sticky-header"),M=o.querySelector("#sticky-footer"),W=o.querySelector("#formio-wrapper"),D=o.querySelector("#comments-header");e.mode==="pdf"||e.mode==="print"?(o.classList.add(`${e.mode}-mode`),W&&W.classList.add(`${e.mode}-mode`),B&&(B.style.display="none"),M&&(M.style.display="none")):(B&&(B.style.display="flex"),M&&(M.style.display="flex")),D&&(D.style.display="none"),e.themeData&&Object.keys(e.themeData).length>0&&(window.FORM_THEME_DATA=e.themeData),e.language&&(window.FORMIO_LANGUAGE=e.language),e.translations&&(window.FORMIO_I18N=e.translations),e.userData&&(window.firstName=e.userData.firstName,window.lastName=e.userData.lastName,window.form=window.form||{},Object.assign(window.form,e.userData)),window.less=window.less||{},Object.assign(window.less,{async:!0,environment:"production",fileAsync:!1,onReady:!0,useFileCache:!0});let V=n;if(n&&(l.info("[TF_SDK:23] \u2705 Processing file IDs in submission data (fetching from IndexedDB)..."),V=await be(n,s,r),l.info("[TF_SDK:24] \u2705 File IDs processed \u2014 handing off to form renderer")),d){let h=d.querySelector(".sdk-loader-text");h&&(h.textContent="Initializing Form...")}return typeof window.loadTRform!="function"?(l.info("[TF_SDK:25] \u2705 loadTRform not ready yet \u2014 waiting for web-turbo-form.js to signal..."),await new Promise(h=>{let u=()=>{document.removeEventListener("LoadRNformReady",u),l.info("[TF_SDK:26] \u2705 loadTRform is now ready (LoadRNformReady event received)"),h()};document.addEventListener("LoadRNformReady",u),typeof window.loadTRform=="function"&&u()})):l.info("[TF_SDK:27] \u2705 loadTRform already available \u2014 invoking immediately"),l.info("[TF_SDK:28] \u2705 Handing off to loadTRform (web-turbo-form.js)..."),await window.loadTRform(w,V,e.themeData,e.mode,e.language,e.translations,e.controlData,e.privateExternal,e.permission,r),Se(),{sendAction:h=>{var u;h.type==="SET_IMAGE_DATA"&&((u=window.setImageData)==null||u.call(window,h.imageData,h.controlId,h.fileName))},destroy:()=>{o.innerHTML=""}}}window.closeDocumentsModal=function(){if(typeof $!="undefined"&&$.fn.modal)$("#documentsModal").modal("hide");else{let t=document.getElementById("documentsModal");t&&(t.style.display="none",t.classList.remove("active"))}};window.checkDocumentsVisibility=async function(){let t=document.getElementById("documentsOption"),n=document.getElementById("documentsDivider"),i=await ne();t.style.display=i?"block":"none",n&&(n.style.display=i?"block":"none"),typeof window.checkMoreButtonVisibility=="function"&&window.checkMoreButtonVisibility()};window.insertAppDocument=async function(t){try{return await ve(t),l.info("[TF_SDK:29] \u2705 Document inserted",{id:t==null?void 0:t.id}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:30] \u274C Failed to insert document",n),!1}};window.deleteAppDocument=async function(t){try{return await we(t),l.info("[TF_SDK:31] \u2705 Document deleted",{id:t}),await window.checkDocumentsVisibility(),!0}catch(n){return l.error("[TF_SDK:32] \u274C Failed to delete document",n),!1}};window.getAllDocuments=ye;window.hasDocuments=ne;function Oe(){return"2.0.86"}function re(t){let n=typeof t=="string"?document.getElementById(t):t;n||(n=document.querySelector(".tf-embed-sdk")||document.body);let i=n.querySelectorAll("table"),o=0,e=null;return i.forEach(r=>{let a=r.getBoundingClientRect().width;a>o&&(o=a,e=r)}),{maxWidth:o,widestTable:e}}window.getMaxTableWidth=re;typeof window!="undefined"&&(window.TurboForms=window.TurboForms||{loadForm:Ae,getBuildVersion:Oe,getMaxTableWidth:re});return Le(Ke);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/turboforms-embed-sdk",
3
- "version": "2.0.85",
3
+ "version": "2.0.86",
4
4
  "description": "Reusable vanilla JS form library that works with React, Angular, Ionic, etc.",
5
5
  "main": "dist/turboforms.js",
6
6
  "types": "dist/index.d.ts",