local-id-scan-journey
Version:
A React component for GBG ID verification and document scanning with bundled SDK
3 lines • 6.16 kB
JavaScript
/*! For license information please see vendor.mustache.0f5d8a4748abe782331b.js.LICENSE.txt */
(this.webpackChunkGBG_Idscan=this.webpackChunkGBG_Idscan||[]).push([[835],{346:function(t){t.exports=function(){"use strict";var t=Object.prototype.toString,e=Array.isArray||function(e){return"[object Array]"===t.call(e)};function n(t){return"function"==typeof t}function r(t){return e(t)?"array":typeof t}function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(t,e){return null!=t&&"object"==typeof t&&e in t}function s(t,e){return null!=t&&"object"!=typeof t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var a=RegExp.prototype.test;function u(t,e){return a.call(t,e)}var c=/\S/;function p(t){return!u(c,t)}var l={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function h(t){return String(t).replace(/[&<>"'`=\/]/g,(function(t){return l[t]}))}var f=/\s*/,d=/\s+/,v=/\s*=/,g=/\s*\}/,w=/#|\^|\/|>|\{|&|=|!/;function y(t,n){if(!t)return[];var r,o,s,a=!1,u=[],c=[],l=[],h=!1,y=!1,x="",E=0;function C(){if(h&&!y)for(;l.length;)delete c[l.pop()];else l=[];h=!1,y=!1}function T(t){if("string"==typeof t&&(t=t.split(d,2)),!e(t)||2!==t.length)throw new Error("Invalid tags: "+t);r=new RegExp(i(t[0])+"\\s*"),o=new RegExp("\\s*"+i(t[1])),s=new RegExp("\\s*"+i("}"+t[1]))}T(n||U.tags);for(var j,P,S,I,V,O,A=new m(t);!A.eos();){if(j=A.pos,S=A.scanUntil(r))for(var G=0,R=S.length;G<R;++G)p(I=S.charAt(G))?(l.push(c.length),x+=I):(y=!0,a=!0,x+=" "),c.push(["text",I,j,j+1]),j+=1,"\n"===I&&(C(),x="",E=0,a=!1);if(!A.scan(r))break;if(h=!0,P=A.scan(w)||"name",A.scan(f),"="===P?(S=A.scanUntil(v),A.scan(v),A.scanUntil(o)):"{"===P?(S=A.scanUntil(s),A.scan(g),A.scanUntil(o),P="&"):S=A.scanUntil(o),!A.scan(o))throw new Error("Unclosed tag at "+A.pos);if(V=">"==P?[P,S,j,A.pos,x,E,a]:[P,S,j,A.pos],E++,c.push(V),"#"===P||"^"===P)u.push(V);else if("/"===P){if(!(O=u.pop()))throw new Error('Unopened section "'+S+'" at '+j);if(O[1]!==S)throw new Error('Unclosed section "'+O[1]+'" at '+j)}else"name"===P||"{"===P||"&"===P?y=!0:"="===P&&T(S)}if(C(),O=u.pop())throw new Error('Unclosed section "'+O[1]+'" at '+A.pos);return b(k(c))}function k(t){for(var e,n,r=[],i=0,o=t.length;i<o;++i)(e=t[i])&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(r.push(e),n=e));return r}function b(t){for(var e,n=[],r=n,i=[],o=0,s=t.length;o<s;++o)switch((e=t[o])[0]){case"#":case"^":r.push(e),i.push(e),r=e[4]=[];break;case"/":i.pop()[5]=e[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(e)}return n}function m(t){this.string=t,this.tail=t,this.pos=0}function x(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function E(){this.cache={}}m.prototype.eos=function(){return""===this.tail},m.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},m.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},x.prototype.push=function(t){return new x(t,this)},x.prototype.lookup=function(t){var e,r=this.cache;if(r.hasOwnProperty(t))e=r[t];else{for(var i,a,u,c=this,p=!1;c;){if(t.indexOf(".")>0)for(i=c.view,a=t.split("."),u=0;null!=i&&u<a.length;)u===a.length-1&&(p=o(i,a[u])||s(i,a[u])),i=i[a[u++]];else i=c.view[t],p=o(c.view,t);if(p){e=i;break}c=c.parent}r[t]=e}return n(e)&&(e=e.call(this.view)),e},E.prototype.clearCache=function(){this.cache={}},E.prototype.parse=function(t,e){var n=this.cache,r=t+":"+(e||U.tags).join(":"),i=n[r];return null==i&&(i=n[r]=y(t,e)),i},E.prototype.render=function(t,e,n,r){var i=this.parse(t,r),o=e instanceof x?e:new x(e,void 0);return this.renderTokens(i,o,n,t,r)},E.prototype.renderTokens=function(t,e,n,r,i){for(var o,s,a,u="",c=0,p=t.length;c<p;++c)a=void 0,"#"===(s=(o=t[c])[0])?a=this.renderSection(o,e,n,r):"^"===s?a=this.renderInverted(o,e,n,r):">"===s?a=this.renderPartial(o,e,n,i):"&"===s?a=this.unescapedValue(o,e):"name"===s?a=this.escapedValue(o,e):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(u+=a);return u},E.prototype.renderSection=function(t,r,i,o){var s=this,a="",u=r.lookup(t[1]);function c(t){return s.render(t,r,i)}if(u){if(e(u))for(var p=0,l=u.length;p<l;++p)a+=this.renderTokens(t[4],r.push(u[p]),i,o);else if("object"==typeof u||"string"==typeof u||"number"==typeof u)a+=this.renderTokens(t[4],r.push(u),i,o);else if(n(u)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(u=u.call(r.view,o.slice(t[3],t[5]),c))&&(a+=u)}else a+=this.renderTokens(t[4],r,i,o);return a}},E.prototype.renderInverted=function(t,n,r,i){var o=n.lookup(t[1]);if(!o||e(o)&&0===o.length)return this.renderTokens(t[4],n,r,i)},E.prototype.indentPartial=function(t,e,n){for(var r=e.replace(/[^ \t]/g,""),i=t.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!n)&&(i[o]=r+i[o]);return i.join("\n")},E.prototype.renderPartial=function(t,e,r,i){if(r){var o=n(r)?r(t[1]):r[t[1]];if(null!=o){var s=t[6],a=t[5],u=t[4],c=o;return 0==a&&u&&(c=this.indentPartial(o,u,s)),this.renderTokens(this.parse(c,i),e,r,c)}}},E.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);if(null!=n)return n},E.prototype.escapedValue=function(t,e){var n=e.lookup(t[1]);if(null!=n)return U.escape(n)},E.prototype.rawValue=function(t){return t[1]};var U={name:"mustache.js",version:"3.2.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,to_html:void 0,Scanner:void 0,Context:void 0,Writer:void 0},C=new E;return U.clearCache=function(){return C.clearCache()},U.parse=function(t,e){return C.parse(t,e)},U.render=function(t,e,n,i){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+r(t)+'" was given as the first argument for mustache#render(template, view, partials)');return C.render(t,e,n,i)},U.to_html=function(t,e,r,i){var o=U.render(t,e,r);if(!n(i))return o;i(o)},U.escape=h,U.Scanner=m,U.Context=x,U.Writer=E,U}()}}]);
//# sourceMappingURL=vendor.mustache.0f5d8a4748abe782331b.js.map