formbuilder-lhcforms 12.5.0 → 12.6.0

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 +0,0 @@
1
- "use strict";(self.webpackChunkformbuilder_lhcforms=self.webpackChunkformbuilder_lhcforms||[]).push([[461],{2714(){const fe=globalThis;function ae(e){return(fe.__Zone_symbol_prefix||"__zone_symbol__")+e}const Oe=Object.getOwnPropertyDescriptor,We=Object.defineProperty,qe=Object.getPrototypeOf,Xe=Object.create,$e=Array.prototype.slice,He="addEventListener",Ie="removeEventListener",Ne=ae(He),xe=ae(Ie),ke="true",_e="false",Pe=ae("");function Le(e,r){return Zone.current.wrap(e,r)}function Be(e,r,c,t,i){return Zone.current.scheduleMacroTask(e,r,c,t,i)}const U=ae,Re=typeof window<"u",we=Re?window:void 0,J=Re&&we||globalThis;function u(e,r){for(let c=e.length-1;c>=0;c--)"function"==typeof e[c]&&(e[c]=Le(e[c],r+"_"+c));return e}function _(e){return!e||!1!==e.writable&&!("function"==typeof e.get&&typeof e.set>"u")}const x=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,$=!("nw"in J)&&typeof J.process<"u"&&"[object process]"===J.process.toString(),G=!$&&!x&&!(!Re||!we.HTMLElement),ye=typeof J.process<"u"&&"[object process]"===J.process.toString()&&!x&&!(!Re||!we.HTMLElement),te={},oe=U("enable_beforeunload"),Te=function(e){if(!(e=e||J.event))return;let r=te[e.type];r||(r=te[e.type]=U("ON_PROPERTY"+e.type));const c=this||e.target||J,t=c[r];let i;return G&&c===we&&"error"===e.type?(i=t&&t.call(this,e.message,e.filename,e.lineno,e.colno,e.error),!0===i&&e.preventDefault()):(i=t&&t.apply(this,arguments),"beforeunload"===e.type&&J[oe]&&"string"==typeof i?e.returnValue=i:null!=i&&!i&&e.preventDefault()),i};function Ue(e,r,c){let t=Oe(e,r);if(!t&&c&&Oe(c,r)&&(t={enumerable:!0,configurable:!0}),!t||!t.configurable)return;const i=U("on"+r+"patched");if(e.hasOwnProperty(i)&&e[i])return;delete t.writable,delete t.value;const f=t.get,k=t.set,g=r.slice(2);let b=te[g];b||(b=te[g]=U("ON_PROPERTY"+g)),t.set=function(I){let T=this;!T&&e===J&&(T=J),T&&("function"==typeof T[b]&&T.removeEventListener(g,Te),k?.call(T,null),T[b]=I,"function"==typeof I&&T.addEventListener(g,Te,!1))},t.get=function(){let I=this;if(!I&&e===J&&(I=J),!I)return null;const T=I[b];if(T)return T;if(f){let w=f.call(this);if(w)return t.set.call(this,w),"function"==typeof I.removeAttribute&&I.removeAttribute(r),w}return null},We(e,r,t),e[i]=!0}function Me(e,r,c){if(r)for(let t=0;t<r.length;t++)Ue(e,"on"+r[t],c);else{const t=[];for(const i in e)"on"==i.slice(0,2)&&t.push(i);for(let i=0;i<t.length;i++)Ue(e,t[i],c)}}const he=U("originalInstance");function Se(e){const r=J[e];if(!r)return;J[U(e)]=r,J[e]=function(){const i=u(arguments,e);switch(i.length){case 0:this[he]=new r;break;case 1:this[he]=new r(i[0]);break;case 2:this[he]=new r(i[0],i[1]);break;case 3:this[he]=new r(i[0],i[1],i[2]);break;case 4:this[he]=new r(i[0],i[1],i[2],i[3]);break;default:throw new Error("Arg list too long.")}},le(J[e],r);const c=new r(function(){});let t;for(t in c)"XMLHttpRequest"===e&&"responseBlob"===t||function(i){"function"==typeof c[i]?J[e].prototype[i]=function(){return this[he][i].apply(this[he],arguments)}:We(J[e].prototype,i,{set:function(f){"function"==typeof f?(this[he][i]=Le(f,e+"."+i),le(this[he][i],f)):this[he][i]=f},get:function(){return this[he][i]}})}(t);for(t in r)"prototype"!==t&&r.hasOwnProperty(t)&&(J[e][t]=r[t])}function se(e,r,c){let t=e;for(;t&&!t.hasOwnProperty(r);)t=qe(t);!t&&e[r]&&(t=e);const i=U(r);let f=null;if(t&&(!(f=t[i])||!t.hasOwnProperty(i))&&(f=t[i]=t[r],_(t&&Oe(t,r)))){const g=c(f,i,r);t[r]=function(){return g(this,arguments)},le(t[r],f)}return f}function Ye(e,r,c){let t=null;function i(f){const k=f.data;return k.args[k.cbIdx]=function(){f.invoke.apply(this,arguments)},t.apply(k.target,k.args),f}t=se(e,r,f=>function(k,g){const b=c(k,g);return b.cbIdx>=0&&"function"==typeof g[b.cbIdx]?Be(b.name,g[b.cbIdx],b,i):f.apply(k,g)})}function le(e,r){e[U("OriginalDelegate")]=r}let Ge=!1,Qe=!1;function pt(){if(Ge)return Qe;Ge=!0;try{const e=we.navigator.userAgent;(-1!==e.indexOf("MSIE ")||-1!==e.indexOf("Trident/")||-1!==e.indexOf("Edge/"))&&(Qe=!0)}catch{}return Qe}function ot(e){return"function"==typeof e}function st(e){return"number"==typeof e}const mt={useG:!0},de={},it={},ct=new RegExp("^"+Pe+"(\\w+)(true|false)$"),at=U("propagationStopped");function lt(e,r){const c=(r?r(e):e)+_e,t=(r?r(e):e)+ke,i=Pe+c,f=Pe+t;de[e]={},de[e][_e]=i,de[e][ke]=f}function yt(e,r,c,t){const i=t&&t.add||He,f=t&&t.rm||Ie,k=t&&t.listeners||"eventListeners",g=t&&t.rmAll||"removeAllListeners",b=U(i),I="."+i+":",T="prependListener",w="."+T+":",H=function(R,d,F){if(R.isRemoved)return;const z=R.callback;let re;"object"==typeof z&&z.handleEvent&&(R.callback=p=>z.handleEvent(p),R.originalDelegate=z);try{R.invoke(R,d,[F])}catch(p){re=p}const W=R.options;return W&&"object"==typeof W&&W.once&&d[f].call(d,F.type,R.originalDelegate?R.originalDelegate:R.callback,W),re};function V(R,d,F){if(!(d=d||e.event))return;const z=R||d.target||e,re=z[de[d.type][F?ke:_e]];if(re){const W=[];if(1===re.length){const p=H(re[0],z,d);p&&W.push(p)}else{const p=re.slice();for(let K=0;K<p.length&&(!d||!0!==d[at]);K++){const L=H(p[K],z,d);L&&W.push(L)}}if(1===W.length)throw W[0];for(let p=0;p<W.length;p++){const K=W[p];r.nativeScheduleMicroTask(()=>{throw K})}}}const Y=function(R){return V(this,R,!1)},ie=function(R){return V(this,R,!0)};function ce(R,d){if(!R)return!1;let F=!0;d&&void 0!==d.useG&&(F=d.useG);const z=d&&d.vh;let re=!0;d&&void 0!==d.chkDup&&(re=d.chkDup);let W=!1;d&&void 0!==d.rt&&(W=d.rt);let p=R;for(;p&&!p.hasOwnProperty(i);)p=qe(p);if(!p&&R[i]&&(p=R),!p||p[b])return!1;const K=d&&d.eventNameToString,L={},S=p[b]=p[i],D=p[U(f)]=p[f],N=p[U(k)]=p[k],ue=p[U(g)]=p[g];let Q;d&&d.prepend&&(Q=p[U(d.prepend)]=p[d.prepend]);const ee=F?function(s){if(!L.isExisting)return S.call(L.target,L.eventName,L.capture?ie:Y,L.options)}:function(s){return S.call(L.target,L.eventName,s.invoke,L.options)},B=F?function(s){if(!s.isRemoved){const l=de[s.eventName];let C;l&&(C=l[s.capture?ke:_e]);const O=C&&s.target[C];if(O)for(let m=0;m<O.length;m++)if(O[m]===s){O.splice(m,1),s.isRemoved=!0,s.removeAbortListener&&(s.removeAbortListener(),s.removeAbortListener=null),0===O.length&&(s.allRemoved=!0,s.target[C]=null);break}}if(s.allRemoved)return D.call(s.target,s.eventName,s.capture?ie:Y,s.options)}:function(s){return D.call(s.target,s.eventName,s.invoke,s.options)},be=d?.diff||function(s,l){const C=typeof l;return"function"===C&&s.callback===l||"object"===C&&s.originalDelegate===l},ve=Zone[U("UNPATCHED_EVENTS")],Ee=e[U("PASSIVE_EVENTS")],a=function(s,l,C,O,m=!1,Z=!1){return function(){const A=this||e;let j=arguments[0];d&&d.transferEventName&&(j=d.transferEventName(j));let q=arguments[1];if(!q)return s.apply(this,arguments);if($&&"uncaughtException"===j)return s.apply(this,arguments);let X=!1;if("function"!=typeof q){if(!q.handleEvent)return s.apply(this,arguments);X=!0}if(z&&!z(s,q,A,arguments))return;const De=!!Ee&&-1!==Ee.indexOf(j),pe=function h(s){if("object"==typeof s&&null!==s){const l={...s};return s.signal&&(l.signal=s.signal),l}return s}(function M(s,l){return l?"boolean"==typeof s?{capture:s,passive:!0}:s?"object"==typeof s&&!1!==s.passive?{...s,passive:!0}:s:{passive:!0}:s}(arguments[2],De)),Ae=pe?.signal;if(Ae?.aborted)return;if(ve)for(let me=0;me<ve.length;me++)if(j===ve[me])return De?s.call(A,j,q,pe):s.apply(this,arguments);const tt=!!pe&&("boolean"==typeof pe||pe.capture),_t=!(!pe||"object"!=typeof pe)&&pe.once,Mt=Zone.current;let nt=de[j];nt||(lt(j,K),nt=de[j]);const Tt=nt[tt?ke:_e];let Je,je=A[Tt],Et=!1;if(je){if(Et=!0,re)for(let me=0;me<je.length;me++)if(be(je[me],q))return}else je=A[Tt]=[];const gt=A.constructor.name,kt=it[gt];kt&&(Je=kt[j]),Je||(Je=gt+l+(K?K(j):j)),L.options=pe,_t&&(L.options.once=!1),L.target=A,L.capture=tt,L.eventName=j,L.isExisting=Et;const Fe=F?mt:void 0;Fe&&(Fe.taskData=L),Ae&&(L.options.signal=void 0);const ge=Mt.scheduleEventTask(Je,q,Fe,C,O);if(Ae){L.options.signal=Ae;const me=()=>ge.zone.cancelTask(ge);s.call(Ae,"abort",me,{once:!0}),ge.removeAbortListener=()=>Ae.removeEventListener("abort",me)}return L.target=null,Fe&&(Fe.taskData=null),_t&&(L.options.once=!0),"boolean"!=typeof ge.options&&(ge.options=pe),ge.target=A,ge.capture=tt,ge.eventName=j,X&&(ge.originalDelegate=q),Z?je.unshift(ge):je.push(ge),m?A:void 0}};return p[i]=a(S,I,ee,B,W),Q&&(p[T]=a(Q,w,function(s){return Q.call(L.target,L.eventName,s.invoke,L.options)},B,W,!0)),p[f]=function(){const s=this||e;let l=arguments[0];d&&d.transferEventName&&(l=d.transferEventName(l));const C=arguments[2],O=!!C&&("boolean"==typeof C||C.capture),m=arguments[1];if(!m)return D.apply(this,arguments);if(z&&!z(D,m,s,arguments))return;const Z=de[l];let A;Z&&(A=Z[O?ke:_e]);const j=A&&s[A];if(j)for(let q=0;q<j.length;q++){const X=j[q];if(be(X,m))return j.splice(q,1),X.isRemoved=!0,0!==j.length||(X.allRemoved=!0,s[A]=null,O||"string"!=typeof l)||(s[Pe+"ON_PROPERTY"+l]=null),X.zone.cancelTask(X),W?s:void 0}return D.apply(this,arguments)},p[k]=function(){const s=this||e;let l=arguments[0];d&&d.transferEventName&&(l=d.transferEventName(l));const C=[],O=ut(s,K?K(l):l);for(let m=0;m<O.length;m++){const Z=O[m];C.push(Z.originalDelegate?Z.originalDelegate:Z.callback)}return C},p[g]=function(){const s=this||e;let l=arguments[0];if(l){d&&d.transferEventName&&(l=d.transferEventName(l));const C=de[l];if(C){const Z=s[C[_e]],A=s[C[ke]];if(Z){const j=Z.slice();for(let q=0;q<j.length;q++){const X=j[q];this[f].call(this,l,X.originalDelegate?X.originalDelegate:X.callback,X.options)}}if(A){const j=A.slice();for(let q=0;q<j.length;q++){const X=j[q];this[f].call(this,l,X.originalDelegate?X.originalDelegate:X.callback,X.options)}}}}else{const C=Object.keys(s);for(let O=0;O<C.length;O++){const Z=ct.exec(C[O]);let A=Z&&Z[1];A&&"removeListener"!==A&&this[g].call(this,A)}this[g].call(this,"removeListener")}if(W)return this},le(p[i],S),le(p[f],D),ue&&le(p[g],ue),N&&le(p[k],N),!0}let ne=[];for(let R=0;R<c.length;R++)ne[R]=ce(c[R],t);return ne}function ut(e,r){if(!r){const f=[];for(let k in e){const g=ct.exec(k);let b=g&&g[1];if(b&&(!r||b===r)){const I=e[k];if(I)for(let T=0;T<I.length;T++)f.push(I[T])}}return f}let c=de[r];c||(lt(r),c=de[r]);const t=e[c[_e]],i=e[c[ke]];return t?i?t.concat(i):t.slice():i?i.slice():[]}function bt(e,r){const c=e.Event;c&&c.prototype&&r.patchMethod(c.prototype,"stopImmediatePropagation",t=>function(i,f){i[at]=!0,t&&t.apply(i,f)})}const Ke=U("zoneTask");function Ze(e,r,c,t){let i=null,f=null;c+=t;const k={};function g(I){const T=I.data;T.args[0]=function(){return I.invoke.apply(this,arguments)};const w=i.apply(e,T.args);return st(w)?T.handleId=w:(T.handle=w,T.isRefreshable=ot(w.refresh)),I}function b(I){const{handle:T,handleId:w}=I.data;return f.call(e,T??w)}i=se(e,r+=t,I=>function(T,w){if(ot(w[0])){const H={isRefreshable:!1,isPeriodic:"Interval"===t,delay:"Timeout"===t||"Interval"===t?w[1]||0:void 0,args:w},V=w[0];w[0]=function(){try{return V.apply(this,arguments)}finally{const{handle:F,handleId:z,isPeriodic:re,isRefreshable:W}=H;!re&&!W&&(z?delete k[z]:F&&(F[Ke]=null))}};const Y=Be(r,w[0],H,g,b);if(!Y)return Y;const{handleId:ie,handle:ce,isRefreshable:ne,isPeriodic:R}=Y.data;if(ie)k[ie]=Y;else if(ce&&(ce[Ke]=Y,ne&&!R)){const d=ce.refresh;ce.refresh=function(){const{zone:F,state:z}=Y;return"notScheduled"===z?(Y._state="scheduled",F._updateTaskCount(Y,1)):"running"===z&&(Y._state="scheduling"),d.call(this)}}return ce??ie??Y}return I.apply(e,w)}),f=se(e,c,I=>function(T,w){const H=w[0];let V;st(H)?(V=k[H],delete k[H]):(V=H?.[Ke],V?H[Ke]=null:V=H),V?.type?V.cancelFn&&V.zone.cancelTask(V):I.apply(e,w)})}function ft(e,r,c){if(!c||0===c.length)return r;const t=c.filter(f=>f.target===e);if(0===t.length)return r;const i=t[0].ignoreProperties;return r.filter(f=>-1===i.indexOf(f))}function ht(e,r,c,t){e&&Me(e,ft(e,r,c),t)}function et(e){return Object.getOwnPropertyNames(e).filter(r=>r.startsWith("on")&&r.length>2).map(r=>r.substring(2))}function It(e,r,c,t,i){const f=Zone.__symbol__(t);if(r[f])return;const k=r[f]=r[t];r[t]=function(g,b,I){return b&&b.prototype&&i.forEach(function(T){const w=`${c}.${t}::`+T,H=b.prototype;try{if(H.hasOwnProperty(T)){const V=e.ObjectGetOwnPropertyDescriptor(H,T);V&&V.value?(V.value=e.wrapWithCurrentZone(V.value,w),e._redefineProperty(b.prototype,T,V)):H[T]&&(H[T]=e.wrapWithCurrentZone(H[T],w))}else H[T]&&(H[T]=e.wrapWithCurrentZone(H[T],w))}catch{}}),k.call(r,g,b,I)},e.attachOriginToPatched(r[t],k)}const dt=function ze(){const e=globalThis,r=!0===e[ae("forceDuplicateZoneCheck")];if(e.Zone&&(r||"function"!=typeof e.Zone.__symbol__))throw new Error("Zone already loaded.");return e.Zone??=function Ve(){const e=fe.performance;function r(M){e&&e.mark&&e.mark(M)}function c(M,E){e&&e.measure&&e.measure(M,E)}r("Zone");let t=(()=>{class M{static __symbol__=ae;static assertZonePatched(){if(fe.Promise!==L.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")}static get root(){let n=M.current;for(;n.parent;)n=n.parent;return n}static get current(){return D.zone}static get currentTask(){return N}static __load_patch(n,o,v=!1){if(L.hasOwnProperty(n)){const P=!0===fe[ae("forceDuplicateZoneCheck")];if(!v&&P)throw Error("Already loaded patch: "+n)}else if(!fe["__Zone_disable_"+n]){const P="Zone:"+n;r(P),L[n]=o(fe,M,S),c(P,P)}}get parent(){return this._parent}get name(){return this._name}_parent;_name;_properties;_zoneDelegate;constructor(n,o){this._parent=n,this._name=o?o.name||"unnamed":"<root>",this._properties=o&&o.properties||{},this._zoneDelegate=new f(this,this._parent&&this._parent._zoneDelegate,o)}get(n){const o=this.getZoneWith(n);if(o)return o._properties[n]}getZoneWith(n){let o=this;for(;o;){if(o._properties.hasOwnProperty(n))return o;o=o._parent}return null}fork(n){if(!n)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,n)}wrap(n,o){if("function"!=typeof n)throw new Error("Expecting function got: "+n);const v=this._zoneDelegate.intercept(this,n,o),P=this;return function(){return P.runGuarded(v,this,arguments,o)}}run(n,o,v,P){D={parent:D,zone:this};try{return this._zoneDelegate.invoke(this,n,o,v,P)}finally{D=D.parent}}runGuarded(n,o=null,v,P){D={parent:D,zone:this};try{try{return this._zoneDelegate.invoke(this,n,o,v,P)}catch(ee){if(this._zoneDelegate.handleError(this,ee))throw ee}}finally{D=D.parent}}runTask(n,o,v){if(n.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(n.zone||ce).name+"; Execution: "+this.name+")");const P=n,{type:ee,data:{isPeriodic:B=!1,isRefreshable:Ce=!1}={}}=n;if(n.state===ne&&(ee===K||ee===p))return;const be=n.state!=F;be&&P._transitionTo(F,d);const ve=N;N=P,D={parent:D,zone:this};try{ee==p&&n.data&&!B&&!Ce&&(n.cancelFn=void 0);try{return this._zoneDelegate.invokeTask(this,P,o,v)}catch(Ee){if(this._zoneDelegate.handleError(this,Ee))throw Ee}}finally{const Ee=n.state;if(Ee!==ne&&Ee!==re)if(ee==K||B||Ce&&Ee===R)be&&P._transitionTo(d,F,R);else{const h=P._zoneDelegates;this._updateTaskCount(P,-1),be&&P._transitionTo(ne,F,ne),Ce&&(P._zoneDelegates=h)}D=D.parent,N=ve}}scheduleTask(n){if(n.zone&&n.zone!==this){let v=this;for(;v;){if(v===n.zone)throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${n.zone.name}`);v=v.parent}}n._transitionTo(R,ne);const o=[];n._zoneDelegates=o,n._zone=this;try{n=this._zoneDelegate.scheduleTask(this,n)}catch(v){throw n._transitionTo(re,R,ne),this._zoneDelegate.handleError(this,v),v}return n._zoneDelegates===o&&this._updateTaskCount(n,1),n.state==R&&n._transitionTo(d,R),n}scheduleMicroTask(n,o,v,P){return this.scheduleTask(new k(W,n,o,v,P,void 0))}scheduleMacroTask(n,o,v,P,ee){return this.scheduleTask(new k(p,n,o,v,P,ee))}scheduleEventTask(n,o,v,P,ee){return this.scheduleTask(new k(K,n,o,v,P,ee))}cancelTask(n){if(n.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(n.zone||ce).name+"; Execution: "+this.name+")");if(n.state===d||n.state===F){n._transitionTo(z,d,F);try{this._zoneDelegate.cancelTask(this,n)}catch(o){throw n._transitionTo(re,z),this._zoneDelegate.handleError(this,o),o}return this._updateTaskCount(n,-1),n._transitionTo(ne,z),n.runCount=-1,n}}_updateTaskCount(n,o){const v=n._zoneDelegates;-1==o&&(n._zoneDelegates=null);for(let P=0;P<v.length;P++)v[P]._updateTaskCount(n.type,o)}}return M})();const i={name:"",onHasTask:(M,E,n,o)=>M.hasTask(n,o),onScheduleTask:(M,E,n,o)=>M.scheduleTask(n,o),onInvokeTask:(M,E,n,o,v,P)=>M.invokeTask(n,o,v,P),onCancelTask:(M,E,n,o)=>M.cancelTask(n,o)};class f{get zone(){return this._zone}_zone;_taskCounts={microTask:0,macroTask:0,eventTask:0};_parentDelegate;_forkDlgt;_forkZS;_forkCurrZone;_interceptDlgt;_interceptZS;_interceptCurrZone;_invokeDlgt;_invokeZS;_invokeCurrZone;_handleErrorDlgt;_handleErrorZS;_handleErrorCurrZone;_scheduleTaskDlgt;_scheduleTaskZS;_scheduleTaskCurrZone;_invokeTaskDlgt;_invokeTaskZS;_invokeTaskCurrZone;_cancelTaskDlgt;_cancelTaskZS;_cancelTaskCurrZone;_hasTaskDlgt;_hasTaskDlgtOwner;_hasTaskZS;_hasTaskCurrZone;constructor(E,n,o){this._zone=E,this._parentDelegate=n,this._forkZS=o&&(o&&o.onFork?o:n._forkZS),this._forkDlgt=o&&(o.onFork?n:n._forkDlgt),this._forkCurrZone=o&&(o.onFork?this._zone:n._forkCurrZone),this._interceptZS=o&&(o.onIntercept?o:n._interceptZS),this._interceptDlgt=o&&(o.onIntercept?n:n._interceptDlgt),this._interceptCurrZone=o&&(o.onIntercept?this._zone:n._interceptCurrZone),this._invokeZS=o&&(o.onInvoke?o:n._invokeZS),this._invokeDlgt=o&&(o.onInvoke?n:n._invokeDlgt),this._invokeCurrZone=o&&(o.onInvoke?this._zone:n._invokeCurrZone),this._handleErrorZS=o&&(o.onHandleError?o:n._handleErrorZS),this._handleErrorDlgt=o&&(o.onHandleError?n:n._handleErrorDlgt),this._handleErrorCurrZone=o&&(o.onHandleError?this._zone:n._handleErrorCurrZone),this._scheduleTaskZS=o&&(o.onScheduleTask?o:n._scheduleTaskZS),this._scheduleTaskDlgt=o&&(o.onScheduleTask?n:n._scheduleTaskDlgt),this._scheduleTaskCurrZone=o&&(o.onScheduleTask?this._zone:n._scheduleTaskCurrZone),this._invokeTaskZS=o&&(o.onInvokeTask?o:n._invokeTaskZS),this._invokeTaskDlgt=o&&(o.onInvokeTask?n:n._invokeTaskDlgt),this._invokeTaskCurrZone=o&&(o.onInvokeTask?this._zone:n._invokeTaskCurrZone),this._cancelTaskZS=o&&(o.onCancelTask?o:n._cancelTaskZS),this._cancelTaskDlgt=o&&(o.onCancelTask?n:n._cancelTaskDlgt),this._cancelTaskCurrZone=o&&(o.onCancelTask?this._zone:n._cancelTaskCurrZone),this._hasTaskZS=null,this._hasTaskDlgt=null,this._hasTaskDlgtOwner=null,this._hasTaskCurrZone=null;const v=o&&o.onHasTask;(v||n&&n._hasTaskZS)&&(this._hasTaskZS=v?o:i,this._hasTaskDlgt=n,this._hasTaskDlgtOwner=this,this._hasTaskCurrZone=this._zone,o.onScheduleTask||(this._scheduleTaskZS=i,this._scheduleTaskDlgt=n,this._scheduleTaskCurrZone=this._zone),o.onInvokeTask||(this._invokeTaskZS=i,this._invokeTaskDlgt=n,this._invokeTaskCurrZone=this._zone),o.onCancelTask||(this._cancelTaskZS=i,this._cancelTaskDlgt=n,this._cancelTaskCurrZone=this._zone))}fork(E,n){return this._forkZS?this._forkZS.onFork(this._forkDlgt,this.zone,E,n):new t(E,n)}intercept(E,n,o){return this._interceptZS?this._interceptZS.onIntercept(this._interceptDlgt,this._interceptCurrZone,E,n,o):n}invoke(E,n,o,v,P){return this._invokeZS?this._invokeZS.onInvoke(this._invokeDlgt,this._invokeCurrZone,E,n,o,v,P):n.apply(o,v)}handleError(E,n){return!this._handleErrorZS||this._handleErrorZS.onHandleError(this._handleErrorDlgt,this._handleErrorCurrZone,E,n)}scheduleTask(E,n){let o=n;if(this._scheduleTaskZS)this._hasTaskZS&&o._zoneDelegates.push(this._hasTaskDlgtOwner),o=this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt,this._scheduleTaskCurrZone,E,n),o||(o=n);else if(n.scheduleFn)n.scheduleFn(n);else{if(n.type!=W)throw new Error("Task is missing scheduleFn.");Y(n)}return o}invokeTask(E,n,o,v){return this._invokeTaskZS?this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt,this._invokeTaskCurrZone,E,n,o,v):n.callback.apply(o,v)}cancelTask(E,n){let o;if(this._cancelTaskZS)o=this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt,this._cancelTaskCurrZone,E,n);else{if(!n.cancelFn)throw Error("Task is not cancelable");o=n.cancelFn(n)}return o}hasTask(E,n){try{this._hasTaskZS&&this._hasTaskZS.onHasTask(this._hasTaskDlgt,this._hasTaskCurrZone,E,n)}catch(o){this.handleError(E,o)}}_updateTaskCount(E,n){const o=this._taskCounts,v=o[E],P=o[E]=v+n;if(P<0)throw new Error("More tasks executed then were scheduled.");0!=v&&0!=P||this.hasTask(this._zone,{microTask:o.microTask>0,macroTask:o.macroTask>0,eventTask:o.eventTask>0,change:E})}}class k{type;source;invoke;callback;data;scheduleFn;cancelFn;_zone=null;runCount=0;_zoneDelegates=null;_state="notScheduled";constructor(E,n,o,v,P,ee){if(this.type=E,this.source=n,this.data=v,this.scheduleFn=P,this.cancelFn=ee,!o)throw new Error("callback is not defined");this.callback=o;const B=this;this.invoke=E===K&&v&&v.useG?k.invokeTask:function(){return k.invokeTask.call(fe,B,this,arguments)}}static invokeTask(E,n,o){E||(E=this),ue++;try{return E.runCount++,E.zone.runTask(E,n,o)}finally{1==ue&&ie(),ue--}}get zone(){return this._zone}get state(){return this._state}cancelScheduleRequest(){this._transitionTo(ne,R)}_transitionTo(E,n,o){if(this._state!==n&&this._state!==o)throw new Error(`${this.type} '${this.source}': can not transition to '${E}', expecting state '${n}'${o?" or '"+o+"'":""}, was '${this._state}'.`);this._state=E,E==ne&&(this._zoneDelegates=null)}toString(){return this.data&&typeof this.data.handleId<"u"?this.data.handleId.toString():Object.prototype.toString.call(this)}toJSON(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}}}const g=ae("setTimeout"),b=ae("Promise"),I=ae("then");let H,T=[],w=!1;function V(M){if(H||fe[b]&&(H=fe[b].resolve(0)),H){let E=H[I];E||(E=H.then),E.call(H,M)}else fe[g](M,0)}function Y(M){0===ue&&0===T.length&&V(ie),M&&T.push(M)}function ie(){if(!w){for(w=!0;T.length;){const M=T;T=[];for(let E=0;E<M.length;E++){const n=M[E];try{n.zone.runTask(n,null,null)}catch(o){S.onUnhandledError(o)}}}S.microtaskDrainDone(),w=!1}}const ce={name:"NO ZONE"},ne="notScheduled",R="scheduling",d="scheduled",F="running",z="canceling",re="unknown",W="microTask",p="macroTask",K="eventTask",L={},S={symbol:ae,currentZoneFrame:()=>D,onUnhandledError:Q,microtaskDrainDone:Q,scheduleMicroTask:Y,showUncaughtError:()=>!t[ae("ignoreConsoleErrorUncaughtError")],patchEventTarget:()=>[],patchOnProperties:Q,patchMethod:()=>Q,bindArguments:()=>[],patchThen:()=>Q,patchMacroTask:()=>Q,patchEventPrototype:()=>Q,isIEOrEdge:()=>!1,getGlobalObjects:()=>{},ObjectDefineProperty:()=>Q,ObjectGetOwnPropertyDescriptor:()=>{},ObjectCreate:()=>{},ArraySlice:()=>[],patchClass:()=>Q,wrapWithCurrentZone:()=>Q,filterProperties:()=>[],attachOriginToPatched:()=>Q,_redefineProperty:()=>Q,patchCallbacks:()=>Q,nativeScheduleMicroTask:V};let D={parent:null,zone:new t(null,null)},N=null,ue=0;function Q(){}return c("Zone","Zone"),t}(),e.Zone}();(function Lt(e){(function St(e){e.__load_patch("ZoneAwarePromise",(r,c,t)=>{const i=Object.getOwnPropertyDescriptor,f=Object.defineProperty,g=t.symbol,b=[],I=!1!==r[g("DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION")],T=g("Promise"),w=g("then");t.onUnhandledError=h=>{if(t.showUncaughtError()){const a=h&&h.rejection;a?console.error("Unhandled Promise rejection:",a instanceof Error?a.message:a,"; Zone:",h.zone.name,"; Task:",h.task&&h.task.source,"; Value:",a,a instanceof Error?a.stack:void 0):console.error(h)}},t.microtaskDrainDone=()=>{for(;b.length;){const h=b.shift();try{h.zone.runGuarded(()=>{throw h.throwOriginal?h.rejection:h})}catch(a){Y(a)}}};const V=g("unhandledPromiseRejectionHandler");function Y(h){t.onUnhandledError(h);try{const a=c[V];"function"==typeof a&&a.call(this,h)}catch{}}function ie(h){return h&&"function"==typeof h.then}function ce(h){return h}function ne(h){return B.reject(h)}const R=g("state"),d=g("value"),F=g("finally"),z=g("parentPromiseValue"),re=g("parentPromiseState"),p=null,K=!0,L=!1;function D(h,a){return s=>{try{M(h,a,s)}catch(l){M(h,!1,l)}}}const N=function(){let h=!1;return function(s){return function(){h||(h=!0,s.apply(null,arguments))}}},ue="Promise resolved with itself",Q=g("currentTaskTrace");function M(h,a,s){const l=N();if(h===s)throw new TypeError(ue);if(h[R]===p){let C=null;try{("object"==typeof s||"function"==typeof s)&&(C=s&&s.then)}catch(O){return l(()=>{M(h,!1,O)})(),h}if(a!==L&&s instanceof B&&s.hasOwnProperty(R)&&s.hasOwnProperty(d)&&s[R]!==p)n(s),M(h,s[R],s[d]);else if(a!==L&&"function"==typeof C)try{C.call(s,l(D(h,a)),l(D(h,!1)))}catch(O){l(()=>{M(h,!1,O)})()}else{h[R]=a;const O=h[d];if(h[d]=s,h[F]===F&&a===K&&(h[R]=h[re],h[d]=h[z]),a===L&&s instanceof Error){const m=c.currentTask&&c.currentTask.data&&c.currentTask.data.__creationTrace__;m&&f(s,Q,{configurable:!0,enumerable:!1,writable:!0,value:m})}for(let m=0;m<O.length;)o(h,O[m++],O[m++],O[m++],O[m++]);if(0==O.length&&a==L){h[R]=0;let m=s;try{throw new Error("Uncaught (in promise): "+function k(h){return h&&h.toString===Object.prototype.toString?(h.constructor&&h.constructor.name||"")+": "+JSON.stringify(h):h?h.toString():Object.prototype.toString.call(h)}(s)+(s&&s.stack?"\n"+s.stack:""))}catch(Z){m=Z}I&&(m.throwOriginal=!0),m.rejection=s,m.promise=h,m.zone=c.current,m.task=c.currentTask,b.push(m),t.scheduleMicroTask()}}}return h}const E=g("rejectionHandledHandler");function n(h){if(0===h[R]){try{const a=c[E];a&&"function"==typeof a&&a.call(this,{rejection:h[d],promise:h})}catch{}h[R]=L;for(let a=0;a<b.length;a++)h===b[a].promise&&b.splice(a,1)}}function o(h,a,s,l,C){n(h);const O=h[R],m=O?"function"==typeof l?l:ce:"function"==typeof C?C:ne;a.scheduleMicroTask("Promise.then",()=>{try{const Z=h[d],A=!!s&&F===s[F];A&&(s[z]=Z,s[re]=O);const j=a.run(m,void 0,A&&m!==ne&&m!==ce?[]:[Z]);M(s,!0,j)}catch(Z){M(s,!1,Z)}},s)}const P=function(){},ee=r.AggregateError;class B{static toString(){return"function ZoneAwarePromise() { [native code] }"}static resolve(a){return a instanceof B?a:M(new this(null),K,a)}static reject(a){return M(new this(null),L,a)}static withResolvers(){const a={};return a.promise=new B((s,l)=>{a.resolve=s,a.reject=l}),a}static any(a){if(!a||"function"!=typeof a[Symbol.iterator])return Promise.reject(new ee([],"All promises were rejected"));const s=[];let l=0;try{for(let m of a)l++,s.push(B.resolve(m))}catch{return Promise.reject(new ee([],"All promises were rejected"))}if(0===l)return Promise.reject(new ee([],"All promises were rejected"));let C=!1;const O=[];return new B((m,Z)=>{for(let A=0;A<s.length;A++)s[A].then(j=>{C||(C=!0,m(j))},j=>{O.push(j),l--,0===l&&(C=!0,Z(new ee(O,"All promises were rejected")))})})}static race(a){let s,l,C=new this((Z,A)=>{s=Z,l=A});function O(Z){s(Z)}function m(Z){l(Z)}for(let Z of a)ie(Z)||(Z=this.resolve(Z)),Z.then(O,m);return C}static all(a){return B.allWithCallback(a)}static allSettled(a){return(this&&this.prototype instanceof B?this:B).allWithCallback(a,{thenCallback:l=>({status:"fulfilled",value:l}),errorCallback:l=>({status:"rejected",reason:l})})}static allWithCallback(a,s){let l,C,O=new this((j,q)=>{l=j,C=q}),m=2,Z=0;const A=[];for(let j of a){ie(j)||(j=this.resolve(j));const q=Z;try{j.then(X=>{A[q]=s?s.thenCallback(X):X,m--,0===m&&l(A)},X=>{s?(A[q]=s.errorCallback(X),m--,0===m&&l(A)):C(X)})}catch(X){C(X)}m++,Z++}return m-=2,0===m&&l(A),O}constructor(a){const s=this;if(!(s instanceof B))throw new Error("Must be an instanceof Promise.");s[R]=p,s[d]=[];try{const l=N();a&&a(l(D(s,K)),l(D(s,L)))}catch(l){M(s,!1,l)}}get[Symbol.toStringTag](){return"Promise"}get[Symbol.species](){return B}then(a,s){let l=this.constructor?.[Symbol.species];(!l||"function"!=typeof l)&&(l=this.constructor||B);const C=new l(P),O=c.current;return this[R]==p?this[d].push(O,C,a,s):o(this,O,C,a,s),C}catch(a){return this.then(null,a)}finally(a){let s=this.constructor?.[Symbol.species];(!s||"function"!=typeof s)&&(s=B);const l=new s(P);l[F]=F;const C=c.current;return this[R]==p?this[d].push(C,l,a,a):o(this,C,l,a,a),l}}B.resolve=B.resolve,B.reject=B.reject,B.race=B.race,B.all=B.all;const Ce=r[T]=r.Promise;r.Promise=B;const be=g("thenPatched");function ve(h){const a=h.prototype,s=i(a,"then");if(s&&(!1===s.writable||!s.configurable))return;const l=a.then;a[w]=l,h.prototype.then=function(C,O){return new B((Z,A)=>{l.call(this,Z,A)}).then(C,O)},h[be]=!0}return t.patchThen=ve,Ce&&(ve(Ce),se(r,"fetch",h=>function Ee(h){return function(a,s){let l=h.apply(a,s);if(l instanceof B)return l;let C=l.constructor;return C[be]||ve(C),l}}(h))),Promise[c.__symbol__("uncaughtPromiseErrors")]=b,B})})(e),function Ot(e){e.__load_patch("toString",r=>{const c=Function.prototype.toString,t=U("OriginalDelegate"),i=U("Promise"),f=U("Error"),k=function(){if("function"==typeof this){const T=this[t];if(T)return"function"==typeof T?c.call(T):Object.prototype.toString.call(T);if(this===Promise){const w=r[i];if(w)return c.call(w)}if(this===Error){const w=r[f];if(w)return c.call(w)}}return c.call(this)};k[t]=c,Function.prototype.toString=k;const g=Object.prototype.toString;Object.prototype.toString=function(){return"function"==typeof Promise&&this instanceof Promise?"[object Promise]":g.call(this)}})}(e),function Nt(e){e.__load_patch("util",(r,c,t)=>{const i=et(r);t.patchOnProperties=Me,t.patchMethod=se,t.bindArguments=u,t.patchMacroTask=Ye;const f=c.__symbol__("BLACK_LISTED_EVENTS"),k=c.__symbol__("UNPATCHED_EVENTS");r[k]&&(r[f]=r[k]),r[f]&&(c[f]=c[k]=r[f]),t.patchEventPrototype=bt,t.patchEventTarget=yt,t.isIEOrEdge=pt,t.ObjectDefineProperty=We,t.ObjectGetOwnPropertyDescriptor=Oe,t.ObjectCreate=Xe,t.ArraySlice=$e,t.patchClass=Se,t.wrapWithCurrentZone=Le,t.filterProperties=ft,t.attachOriginToPatched=le,t._redefineProperty=Object.defineProperty,t.patchCallbacks=It,t.getGlobalObjects=()=>({globalSources:it,zoneSymbolEventNames:de,eventNames:i,isBrowser:G,isMix:ye,isNode:$,TRUE_STR:ke,FALSE_STR:_e,ZONE_SYMBOL_PREFIX:Pe,ADD_EVENT_LISTENER_STR:He,REMOVE_EVENT_LISTENER_STR:Ie})})}(e)})(dt),function wt(e){e.__load_patch("legacy",r=>{const c=r[e.__symbol__("legacyPatch")];c&&c()}),e.__load_patch("timers",r=>{const t="clear";Ze(r,"set",t,"Timeout"),Ze(r,"set",t,"Interval"),Ze(r,"set",t,"Immediate")}),e.__load_patch("requestAnimationFrame",r=>{Ze(r,"request","cancel","AnimationFrame"),Ze(r,"mozRequest","mozCancel","AnimationFrame"),Ze(r,"webkitRequest","webkitCancel","AnimationFrame")}),e.__load_patch("blocking",(r,c)=>{const t=["alert","prompt","confirm"];for(let i=0;i<t.length;i++)se(r,t[i],(k,g,b)=>function(I,T){return c.current.run(k,r,T,b)})}),e.__load_patch("EventTarget",(r,c,t)=>{(function Dt(e,r){r.patchEventPrototype(e,r)})(r,t),function Ct(e,r){if(Zone[r.symbol("patchEventTarget")])return;const{eventNames:c,zoneSymbolEventNames:t,TRUE_STR:i,FALSE_STR:f,ZONE_SYMBOL_PREFIX:k}=r.getGlobalObjects();for(let b=0;b<c.length;b++){const I=c[b],H=k+(I+f),V=k+(I+i);t[I]={},t[I][f]=H,t[I][i]=V}const g=e.EventTarget;g&&g.prototype&&r.patchEventTarget(e,r,[g&&g.prototype])}(r,t);const i=r.XMLHttpRequestEventTarget;i&&i.prototype&&t.patchEventTarget(r,t,[i.prototype])}),e.__load_patch("MutationObserver",(r,c,t)=>{Se("MutationObserver"),Se("WebKitMutationObserver")}),e.__load_patch("IntersectionObserver",(r,c,t)=>{Se("IntersectionObserver")}),e.__load_patch("FileReader",(r,c,t)=>{Se("FileReader")}),e.__load_patch("on_property",(r,c,t)=>{!function Pt(e,r){if($&&!ye||Zone[e.symbol("patchEvents")])return;const c=r.__Zone_ignore_on_properties;let t=[];if(G){const i=window;t=t.concat(["Document","SVGElement","Element","HTMLElement","HTMLBodyElement","HTMLMediaElement","HTMLFrameSetElement","HTMLFrameElement","HTMLIFrameElement","HTMLMarqueeElement","Worker"]);const f=[];ht(i,et(i),c&&c.concat(f),qe(i))}t=t.concat(["XMLHttpRequest","XMLHttpRequestEventTarget","IDBIndex","IDBRequest","IDBOpenDBRequest","IDBDatabase","IDBTransaction","IDBCursor","WebSocket"]);for(let i=0;i<t.length;i++){const f=r[t[i]];f?.prototype&&ht(f.prototype,et(f.prototype),c)}}(t,r)}),e.__load_patch("customElements",(r,c,t)=>{!function Rt(e,r){const{isBrowser:c,isMix:t}=r.getGlobalObjects();(c||t)&&e.customElements&&"customElements"in e&&r.patchCallbacks(r,e.customElements,"customElements","define",["connectedCallback","disconnectedCallback","adoptedCallback","attributeChangedCallback","formAssociatedCallback","formDisabledCallback","formResetCallback","formStateRestoreCallback"])}(r,t)}),e.__load_patch("XHR",(r,c)=>{!function I(T){const w=T.XMLHttpRequest;if(!w)return;const H=w.prototype;let Y=H[Ne],ie=H[xe];if(!Y){const S=T.XMLHttpRequestEventTarget;if(S){const D=S.prototype;Y=D[Ne],ie=D[xe]}}const ce="readystatechange",ne="scheduled";function R(S){const D=S.data,N=D.target;N[k]=!1,N[b]=!1;const ue=N[f];Y||(Y=N[Ne],ie=N[xe]),ue&&ie.call(N,ce,ue);const Q=N[f]=()=>{if(N.readyState===N.DONE)if(!D.aborted&&N[k]&&S.state===ne){const E=N[c.__symbol__("loadfalse")];if(0!==N.status&&E&&E.length>0){const n=S.invoke;S.invoke=function(){const o=N[c.__symbol__("loadfalse")];for(let v=0;v<o.length;v++)o[v]===S&&o.splice(v,1);!D.aborted&&S.state===ne&&n.call(S)},E.push(S)}else S.invoke()}else!D.aborted&&!1===N[k]&&(N[b]=!0)};return Y.call(N,ce,Q),N[t]||(N[t]=S),K.apply(N,D.args),N[k]=!0,S}function d(){}function F(S){const D=S.data;return D.aborted=!0,L.apply(D.target,D.args)}const z=se(H,"open",()=>function(S,D){return S[i]=0==D[2],S[g]=D[1],z.apply(S,D)}),W=U("fetchTaskAborting"),p=U("fetchTaskScheduling"),K=se(H,"send",()=>function(S,D){if(!0===c.current[p]||S[i])return K.apply(S,D);{const N={target:S,url:S[g],isPeriodic:!1,args:D,aborted:!1},ue=Be("XMLHttpRequest.send",d,N,R,F);S&&!0===S[b]&&!N.aborted&&ue.state===ne&&ue.invoke()}}),L=se(H,"abort",()=>function(S,D){const N=function V(S){return S[t]}(S);if(N&&"string"==typeof N.type){if(null==N.cancelFn||N.data&&N.data.aborted)return;N.zone.cancelTask(N)}else if(!0===c.current[W])return L.apply(S,D)})}(r);const t=U("xhrTask"),i=U("xhrSync"),f=U("xhrListener"),k=U("xhrScheduled"),g=U("xhrURL"),b=U("xhrErrorBeforeScheduled")}),e.__load_patch("geolocation",r=>{r.navigator&&r.navigator.geolocation&&function y(e,r){const c=e.constructor.name;for(let t=0;t<r.length;t++){const i=r[t],f=e[i];if(f){if(!_(Oe(e,i)))continue;e[i]=(g=>{const b=function(){return g.apply(this,u(arguments,c+"."+i))};return le(b,g),b})(f)}}}(r.navigator.geolocation,["getCurrentPosition","watchPosition"])}),e.__load_patch("PromiseRejectionEvent",(r,c)=>{function t(i){return function(f){ut(r,i).forEach(g=>{const b=r.PromiseRejectionEvent;if(b){const I=new b(i,{promise:f.promise,reason:f.rejection});g.invoke(I)}})}}r.PromiseRejectionEvent&&(c[U("unhandledPromiseRejectionHandler")]=t("unhandledrejection"),c[U("rejectionHandledHandler")]=t("rejectionhandled"))}),e.__load_patch("queueMicrotask",(r,c,t)=>{!function vt(e,r){r.patchMethod(e,"queueMicrotask",c=>function(t,i){Zone.current.scheduleMicroTask("queueMicrotask",i[0])})}(r,t)})}(dt)},8393(fe,ae,Ve){const Re=function(u,...y){if(Re.translate){const x=Re.translate(u,y);u=x[0],y=x[1]}let _=J(u[0],u.raw[0]);for(let x=1;x<u.length;x++)_+=y[x-1]+J(u[x],u.raw[x]);return _};function J(u,y){return":"===y.charAt(0)?u.substring(function U(u,y){for(let _=1,x=1;_<u.length;_++,x++)if("\\"===y[x])x++;else if(":"===u[_])return _;throw new Error(`Unterminated $localize metadata block in "${y}".`)}(u,y)+1):u}globalThis.$localize=Re,Ve(2714),window.global=window}},fe=>{fe(fe.s=8393)}]);
@@ -1,120 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>Title</title>
6
- </head>
7
- <body>
8
- <div class="bg-body p-2" xmlns="http://www.w3.org/1999/html">
9
- <button id="openWinDefault" class="btn btn-primary m-2" onClick="openFormBuilder()">Open form builder (Default)</button>
10
- <button id="openWinSTU3" class="btn btn-primary m-2" onClick="openFormBuilder('STU3')">Open form builder (STU3)</button>
11
- <button id="openWinR4" class="btn btn-primary m-2" onClick="openFormBuilder('R4')">Open form builder (R4)</button>
12
- <button id="openWinR5" class="btn btn-primary m-2" onClick="openFormBuilder('R5')">Open form builder (R5)</button>
13
- <button id="sendQ" class="btn btn-primary m-2" onClick="sendQuestionnaire()">Post questionnaire</button>
14
- <button id="clear" class="btn btn-primary m-2" onClick="clearMessages()">Clear messages</button>
15
- <p class="m-1" id="url"></p>
16
- <h6 id="initH">initialized</h6>
17
- <pre class="m-1" id="initW"></pre>
18
- <h6 id="updateH">updateQuestionnaire</h6>
19
- <pre class="m-1" id="updateQ"></pre>
20
- <h6 id="closedH">closed</h6>
21
- <pre class="m-1" id="closedQ"></pre>
22
- <h6 id="canceledH">canceled</h6>
23
- <pre class="m-1" id="canceledQ"></pre>
24
- </div>
25
-
26
- <script>
27
- // Sample questionnaire to be edited in form builder.
28
- const initialQ = {resourceType: 'Questionnaire', title: 'Form loaded from window-open-test.html', status: 'draft', item: [{text: 'q one', linkId: 'q-1'}]};
29
-
30
- let fbWindow = null;
31
- // Open the form builder window running on separate origin
32
- // Read the URL from the http params.
33
- let fbUrl = new URLSearchParams(window.location.search).get('targetUrl');
34
- let originUrl = new URL(fbUrl).origin; // This could be different if the target is redirected
35
-
36
- let initHeader = document.getElementById('initH');
37
- let updateHeader = document.getElementById('updateH');
38
- let closedHeader = document.getElementById('closedH');
39
- let canceledHeader = document.getElementById('canceledH')
40
- let initEl = document.getElementById('initW');
41
- let updateEl = document.getElementById('updateQ');
42
- let closedEl = document.getElementById('closedQ');
43
- let canceledEl = document.getElementById('canceledQ');
44
-
45
- let urlEl = document.getElementById('url');
46
- window.addEventListener('message', handleMessage, true);
47
-
48
-
49
- /**
50
- * Listen to messages from form builder.
51
- */
52
- function handleMessage(event) {
53
- const messageFromOpenedWindow = JSON.stringify(event.data, null, 2);
54
- if (fbWindow !== event.source) {
55
- return;
56
- }
57
- originUrl = event.origin;
58
- switch (event.data?.type) {
59
- case 'initialized':
60
- // Wait for the child window to be ready, before sending initial questionnaire.
61
- initHeader.innerHTML = `${event.data?.type}: New window initialized (${new Date().toISOString()})`;
62
- initEl.innerHTML = `${messageFromOpenedWindow}`;
63
- sendQuestionnaire(); // Send initial questionnaire.
64
- break;
65
- case 'updateQuestionnaire':
66
- // Use this to get continuous updates. Wiil be triggered by every edit in
67
- // the form builder with about 0.5 second debounce.
68
- updateHeader.innerHTML = `${event.data?.type}: Updated questionnaire from opened window (${new Date().toISOString()})`;
69
- updateEl.innerHTML = `${messageFromOpenedWindow}`
70
- break;
71
- case 'closed':
72
- // Triggered when the window is closed. Use this to get last updated questionnaire
73
- closedHeader.innerHTML = `${event.data?.type}: Final questionnaire from opened window after it is closed (${new Date().toISOString()})`;
74
- closedEl.innerHTML = `${messageFromOpenedWindow}`;
75
- break;
76
- case 'canceled':
77
- // Triggered when the window is canceled.
78
- canceledHeader.innerHTML = `${event.data?.type}: Received canceled event. (${new Date().toISOString()})`;
79
- canceledEl.innerHTML = `${messageFromOpenedWindow}`;
80
- break;
81
- default:
82
- console.log(`Unknown message type ${event.data?.type} received from ${event.origin}`);
83
- }
84
- }
85
-
86
- /**
87
- * Open a child window to load form builder app.
88
- */
89
- function openFormBuilder(fhirVersion) {
90
- const referrerParam = 'referrer='+encodeURIComponent(window.location.href);
91
- let versionParam = '';
92
- if(fhirVersion) {
93
- versionParam = '&fhirVersion='+encodeURIComponent(fhirVersion);
94
- }
95
- const reqUrl = fbUrl+'/window-open?'+referrerParam+versionParam;
96
- fbWindow = window.open(reqUrl, 'formbuilder_window');
97
- fbWindow.focus();
98
- urlEl.innerHTML = 'Opened url: ' + reqUrl;
99
- }
100
-
101
- /**
102
- * Send questionnaire to form builder using window.postMessage()
103
- */
104
- function sendQuestionnaire() {
105
- if(fbWindow && !fbWindow.closed) {
106
- fbWindow?.postMessage({type: 'initialQuestionnaire', questionnaire: initialQ}, originUrl);
107
- }
108
- }
109
-
110
- /**
111
- * Clear messages, typically to read fresh messages.
112
- */
113
- function clearMessages() {
114
- initEl.innerHTML = '';
115
- updateEl.innerHTML = '';
116
- closedEl.innerHTML = '';
117
- }
118
- </script>
119
- </body>
120
- </html>