vue3-beak-ui-framework 1.2.44 → 1.2.46

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,4 +1,4 @@
1
- import { g as rt } from "./index-D_rg1CWs.js";
1
+ import { g as rt } from "./index-CAYFHRnE.js";
2
2
  var Q = { exports: {} }, it = Q.exports, et;
3
3
  function st() {
4
4
  return et || (et = 1, function(j, V) {
@@ -67848,7 +67848,7 @@ const _hoisted_1$1r = { key: 0 }, _hoisted_2$1f = ["placeholder"], _hoisted_3$12
67848
67848
  Ng.value = !1, rI.value && URL.revokeObjectURL(rI.value), fI.value && URL.revokeObjectURL(fI.value), yI.value = null, wI.value = null, rI.value = null, fI.value = null, Dg.value = !1, Tg.value = !1, Yg.value = "", Xg.value = "";
67849
67849
  }
67850
67850
  }, oC = () => {
67851
- console.log("discard:", { ...Vg.value }, Vg.value), II.value.uploadedFile = null, Fg.value && URL.revokeObjectURL(Fg.value), Fg.value = null, rI.value && URL.revokeObjectURL(rI.value), fI.value && URL.revokeObjectURL(fI.value), yI.value = null, wI.value = null, rI.value = null, fI.value = null, Dg.value = !1, _g.value = !1, PI(), LI.chequeData = DI(LI.chequeData), LI.registrationData = DI(LI.registrationData), LI.identityData = DI(LI.identityData), LI.cashdepositslipData = DI(LI.cashdepositslipData), LI.creditCardData = DI(LI.creditCardData), LI.passportData = DI(LI.passportData), LI.driverLicenseData = DI(LI.driverLicenseData), LI.medicalReportData = DI(LI.medicalReportData), LI.chequeStatementData = DI(LI.chequeStatementData), LI.WWVehicleCertificateData = DI(LI.WWVehicleCertificateData), LI.ModelJData = DI(LI.ModelJData), Vg.value.fileName = "", Vg.value.size = "", Vg.value.mimeType = "", Vg.value.lastModifiedDate = "", Vg.value.updocument = { ...eC }, Xg.value = "", Yg.value = "", hI("file-discarded");
67851
+ console.log("discard:", { ...Vg.value }, Vg.value), II.value.uploadedFile = null, Fg.value && URL.revokeObjectURL(Fg.value), Fg.value = null, rI.value && URL.revokeObjectURL(rI.value), fI.value && URL.revokeObjectURL(fI.value), yI.value = null, wI.value = null, rI.value = null, fI.value = null, Dg.value = !1, _g.value = !1, PI(), LI.chequeData = DI(LI.chequeData), LI.registrationData = DI(LI.registrationData), LI.identityData = DI(LI.identityData), LI.cashdepositslipData = DI(LI.cashdepositslipData), LI.creditCardData = DI(LI.creditCardData), LI.passportData = DI(LI.passportData), LI.driverLicenseData = DI(LI.driverLicenseData), LI.medicalReportData = DI(LI.medicalReportData), LI.chequeStatementData = DI(LI.chequeStatementData), LI.WWVehicleCertificateData = DI(LI.WWVehicleCertificateData), LI.ModelJData = DI(LI.ModelJData), LI.cnssBordereauData = DI(LI.cnssBordereauData), Vg.value.fileName = "", Vg.value.size = "", Vg.value.mimeType = "", Vg.value.lastModifiedDate = "", Vg.value.updocument = { ...eC }, Xg.value = "", Yg.value = "", hI("file-discarded");
67852
67852
  }, CC = () => {
67853
67853
  console.log("onCrop:"), Xg.value = "", Yg.value = "", Lg.value.getResult().canvas.toBlob(async (UC) => {
67854
67854
  if (UC) {
@@ -119908,7 +119908,7 @@ class Columns {
119908
119908
  const Hg = Bg.headings[Ig], Lg = [];
119909
119909
  if (Hg.getAttribute("data-type") === "date") {
119910
119910
  let Dg = !1;
119911
- Hg.hasAttribute("data-format") && (Dg = Hg.getAttribute("data-format")), Lg.push(import("./date-DAzjGNcl.js").then(({ parseDate: $g }) => (Qg) => $g(Qg, Dg)));
119911
+ Hg.hasAttribute("data-format") && (Dg = Hg.getAttribute("data-format")), Lg.push(import("./date-mOK5az8v.js").then(({ parseDate: $g }) => (Qg) => $g(Qg, Dg)));
119912
119912
  }
119913
119913
  Promise.all(Lg).then((Dg) => {
119914
119914
  const Jg = Dg[0];
@@ -1,4 +1,4 @@
1
- import { i as f } from "./index-D_rg1CWs.js";
1
+ import { i as f } from "./index-CAYFHRnE.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -163,7 +163,7 @@ ${uI}
163
163
  `}[Vg.$pushGlyphs](cI){cI.addString(`
164
164
  `)}[Vg.$toHTML](cI){return Lg.HTMLResult.success({name:"br"})}}class BI extends tI{constructor(cI){super(cI,"html")}[Vg.$toHTML](cI){const rI=[];if(this[Vg.$extra]={children:rI},this[Vg.$childrenToHTML]({}),rI.length===0)return Lg.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},value:this[Vg.$content]||""});if(rI.length===1){const uI=rI[0];if(uI.attributes&&uI.attributes.class.includes("xfaRich"))return Lg.HTMLResult.success(uI)}return Lg.HTMLResult.success({name:"div",attributes:{class:["xfaRich"],style:{}},children:rI})}}class vI extends tI{constructor(cI){super(cI,"i")}[Vg.$pushGlyphs](cI){cI.pushFont({posture:"italic"}),super[Vg.$pushGlyphs](cI),cI.popFont()}}class pI extends tI{constructor(cI){super(cI,"li")}}class gI extends tI{constructor(cI){super(cI,"ol")}}class bI extends tI{constructor(cI){super(cI,"p")}[Vg.$pushGlyphs](cI){super[Vg.$pushGlyphs](cI,!1),cI.addString(`
165
165
  `),cI.addPara(),cI.popFont()}[Vg.$text](){return this[Vg.$getParent]()[Vg.$getChildren]().at(-1)===this?super[Vg.$text]():super[Vg.$text]()+`
166
- `}}class mI extends tI{constructor(cI){super(cI,"span")}}class II extends tI{constructor(cI){super(cI,"sub")}}class CI extends tI{constructor(cI){super(cI,"sup")}}class NI extends tI{constructor(cI){super(cI,"ul")}}class dI{static[Fg.$buildXFAObject](cI,rI){if(dI.hasOwnProperty(cI))return dI[cI](rI)}static a(cI){return new aI(cI)}static b(cI){return new oI(cI)}static body(cI){return new lI(cI)}static br(cI){return new fI(cI)}static html(cI){return new BI(cI)}static i(cI){return new vI(cI)}static li(cI){return new pI(cI)}static ol(cI){return new gI(cI)}static p(cI){return new bI(cI)}static span(cI){return new mI(cI)}static sub(cI){return new II(cI)}static sup(cI){return new CI(cI)}static ul(cI){return new NI(cI)}}Yg.XhtmlNamespace=dI},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.UnknownNamespace=void 0;var Vg=Xg(77),Fg=Xg(75);class Hg{constructor(Dg){this.namespaceId=Dg}[Vg.$buildXFAObject](Dg,Jg){return new Fg.XmlObject(this.namespaceId,Dg,Jg)}}Yg.UnknownNamespace=Hg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.DatasetReader=void 0;var Vg=Xg(2),Fg=Xg(3),Hg=Xg(64);function Lg($g){try{return(0,Vg.stringToUTF8String)($g)}catch(Qg){return(0,Vg.warn)(`UTF-8 decoding failed: "${Qg}".`),$g}}class Dg extends Hg.SimpleXMLParser{constructor(Qg){super(Qg),this.node=null}onEndElement(Qg){const Kg=super.onEndElement(Qg);if(Kg&&Qg==="xfa:datasets")throw this.node=Kg,new Error("Aborting DatasetXMLParser.")}}class Jg{constructor(Qg){if(Qg.datasets)this.node=new Hg.SimpleXMLParser({hasAttributes:!0}).parseFromString(Qg.datasets).documentElement;else{const Kg=new Dg({hasAttributes:!0});try{Kg.parseFromString(Qg["xdp:xdp"])}catch{}this.node=Kg.node}}getValue(Qg){if(!this.node||!Qg)return"";const Kg=this.node.searchNode((0,Fg.parseXFAPath)(Qg),0);if(!Kg)return"";const _g=Kg.firstChild;return _g&&_g.nodeName==="value"?Kg.children.map(il=>Lg(il.textContent)):Lg(Kg.textContent)}}Yg.DatasetReader=Jg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.XRef=void 0;var Vg=Xg(2),Fg=Xg(4),Hg=Xg(15),Lg=Xg(3),Dg=Xg(5),Jg=Xg(65);class $g{constructor(Kg,_g){this.stream=Kg,this.pdfManager=_g,this.entries=[],this.xrefstms=Object.create(null),this._cacheMap=new Map,this._pendingRefs=new Fg.RefSet,this._newPersistentRefNum=null,this._newTemporaryRefNum=null}getNewPersistentRef(Kg){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);const _g=this._newPersistentRefNum++;return this._cacheMap.set(_g,Kg),Fg.Ref.get(_g,0)}getNewTemporaryRef(){return this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1),Fg.Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null}setStartXRef(Kg){this.startXRefQueue=[Kg]}parse(Kg=!1){let _g;Kg?((0,Vg.warn)("Indexing all PDF objects"),_g=this.indexObjects()):_g=this.readXRef(),_g.assignXref(this),this.trailer=_g;let il;try{il=_g.get("Encrypt")}catch(eI){if(eI instanceof Lg.MissingDataException)throw eI;(0,Vg.warn)(`XRef.parse - Invalid "Encrypt" reference: "${eI}".`)}if(il instanceof Fg.Dict){const eI=_g.get("ID"),iI=eI&&eI.length?eI[0]:"";il.suppressEncryption=!0,this.encrypt=new Jg.CipherTransformFactory(il,iI,this.pdfManager.password)}let Tg;try{Tg=_g.get("Root")}catch(eI){if(eI instanceof Lg.MissingDataException)throw eI;(0,Vg.warn)(`XRef.parse - Invalid "Root" reference: "${eI}".`)}if(Tg instanceof Fg.Dict)try{if(Tg.get("Pages")instanceof Fg.Dict){this.root=Tg;return}}catch(eI){if(eI instanceof Lg.MissingDataException)throw eI;(0,Vg.warn)(`XRef.parse - Invalid "Pages" reference: "${eI}".`)}throw Kg?new Vg.InvalidPDFException("Invalid Root reference."):new Lg.XRefParseException}processXRefTable(Kg){"tableState"in this||(this.tableState={entryNum:0,streamPos:Kg.lexer.stream.pos,parserBuf1:Kg.buf1,parserBuf2:Kg.buf2});const _g=this.readXRefTable(Kg);if(!(0,Fg.isCmd)(_g,"trailer"))throw new Vg.FormatError("Invalid XRef table: could not find trailer dictionary");let il=Kg.getObj();if(!(il instanceof Fg.Dict)&&il.dict&&(il=il.dict),!(il instanceof Fg.Dict))throw new Vg.FormatError("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,il}readXRefTable(Kg){const _g=Kg.lexer.stream,il=this.tableState;_g.pos=il.streamPos,Kg.buf1=il.parserBuf1,Kg.buf2=il.parserBuf2;let Tg;for(;;){if(!("firstEntryNum"in il)||!("entryCount"in il)){if((0,Fg.isCmd)(Tg=Kg.getObj(),"trailer"))break;il.firstEntryNum=Tg,il.entryCount=Kg.getObj()}let eI=il.firstEntryNum;const iI=il.entryCount;if(!Number.isInteger(eI)||!Number.isInteger(iI))throw new Vg.FormatError("Invalid XRef table: wrong types in subsection header");for(let tI=il.entryNum;tI<iI;tI++){il.streamPos=_g.pos,il.entryNum=tI,il.parserBuf1=Kg.buf1,il.parserBuf2=Kg.buf2;const aI={};aI.offset=Kg.getObj(),aI.gen=Kg.getObj();const oI=Kg.getObj();if(oI instanceof Fg.Cmd)switch(oI.cmd){case"f":aI.free=!0;break;case"n":aI.uncompressed=!0;break}if(!Number.isInteger(aI.offset)||!Number.isInteger(aI.gen)||!(aI.free||aI.uncompressed))throw new Vg.FormatError(`Invalid entry in XRef subsection: ${eI}, ${iI}`);tI===0&&aI.free&&eI===1&&(eI=0),this.entries[tI+eI]||(this.entries[tI+eI]=aI)}il.entryNum=0,il.streamPos=_g.pos,il.parserBuf1=Kg.buf1,il.parserBuf2=Kg.buf2,delete il.firstEntryNum,delete il.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new Vg.FormatError("Invalid XRef table: unexpected first object");return Tg}processXRefStream(Kg){if(!("streamState"in this)){const _g=Kg.dict,il=_g.get("W");let Tg=_g.get("Index");Tg||(Tg=[0,_g.get("Size")]),this.streamState={entryRanges:Tg,byteWidths:il,entryNum:0,streamPos:Kg.pos}}return this.readXRefStream(Kg),delete this.streamState,Kg.dict}readXRefStream(Kg){const _g=this.streamState;Kg.pos=_g.streamPos;const[il,Tg,eI]=_g.byteWidths,iI=_g.entryRanges;for(;iI.length>0;){const[tI,aI]=iI;if(!Number.isInteger(tI)||!Number.isInteger(aI))throw new Vg.FormatError(`Invalid XRef range fields: ${tI}, ${aI}`);if(!Number.isInteger(il)||!Number.isInteger(Tg)||!Number.isInteger(eI))throw new Vg.FormatError(`Invalid XRef entry fields length: ${tI}, ${aI}`);for(let oI=_g.entryNum;oI<aI;++oI){_g.entryNum=oI,_g.streamPos=Kg.pos;let lI=0,fI=0,BI=0;for(let pI=0;pI<il;++pI){const gI=Kg.getByte();if(gI===-1)throw new Vg.FormatError("Invalid XRef byteWidths 'type'.");lI=lI<<8|gI}il===0&&(lI=1);for(let pI=0;pI<Tg;++pI){const gI=Kg.getByte();if(gI===-1)throw new Vg.FormatError("Invalid XRef byteWidths 'offset'.");fI=fI<<8|gI}for(let pI=0;pI<eI;++pI){const gI=Kg.getByte();if(gI===-1)throw new Vg.FormatError("Invalid XRef byteWidths 'generation'.");BI=BI<<8|gI}const vI={};switch(vI.offset=fI,vI.gen=BI,lI){case 0:vI.free=!0;break;case 1:vI.uncompressed=!0;break;case 2:break;default:throw new Vg.FormatError(`Invalid XRef entry type: ${lI}`)}this.entries[tI+oI]||(this.entries[tI+oI]=vI)}_g.entryNum=0,_g.streamPos=Kg.pos,iI.splice(0,2)}}indexObjects(){function tI(GI,AI){let RI="",FI=GI[AI];for(;FI!==10&&FI!==13&&FI!==60&&!(++AI>=GI.length);)RI+=String.fromCharCode(FI),FI=GI[AI];return RI}function aI(GI,AI,RI){const FI=RI.length,TI=GI.length;let HI=0;for(;AI<TI;){let wI=0;for(;wI<FI&&GI[AI+wI]===RI[wI];)++wI;if(wI>=FI)break;AI++,HI++}return HI}const oI=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer)\b/g,lI=/\b(startxref|\d+\s+\d+\s+obj)\b/g,fI=/^(\d+)\s+(\d+)\s+obj\b/,BI=new Uint8Array([116,114,97,105,108,101,114]),vI=new Uint8Array([115,116,97,114,116,120,114,101,102]),pI=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();const gI=this.stream;gI.pos=0;const bI=gI.getBytes(),mI=(0,Vg.bytesToString)(bI),II=bI.length;let CI=gI.start;const NI=[],dI=[];for(;CI<II;){let GI=bI[CI];if(GI===9||GI===10||GI===13||GI===32){++CI;continue}if(GI===37){do{if(++CI,CI>=II)break;GI=bI[CI]}while(GI!==10&&GI!==13);continue}const AI=tI(bI,CI);let RI;if(AI.startsWith("xref")&&(AI.length===4||/\s/.test(AI[4])))CI+=aI(bI,CI,BI),NI.push(CI),CI+=aI(bI,CI,vI);else if(RI=fI.exec(AI)){const FI=RI[1]|0,TI=RI[2]|0,HI=CI+AI.length;let wI,WI=!1;if(!this.entries[FI])WI=!0;else if(this.entries[FI].gen===TI)try{new Hg.Parser({lexer:new Hg.Lexer(gI.makeSubStream(HI))}).getObj(),WI=!0}catch(zI){zI instanceof Lg.ParserEOFException?(0,Vg.warn)(`indexObjects -- checking object (${AI}): "${zI}".`):WI=!0}WI&&(this.entries[FI]={offset:CI-gI.start,gen:TI,uncompressed:!0}),oI.lastIndex=HI;const xI=oI.exec(mI);xI?(wI=oI.lastIndex+1-CI,xI[1]!=="endobj"&&((0,Vg.warn)(`indexObjects: Found "${xI[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),wI-=xI[1].length+1)):wI=II-CI;const YI=bI.subarray(CI,CI+wI),JI=aI(YI,0,pI);JI<wI&&YI[JI+5]<64&&(dI.push(CI-gI.start),this.xrefstms[CI-gI.start]=1),CI+=wI}else if(AI.startsWith("trailer")&&(AI.length===7||/\s/.test(AI[7]))){NI.push(CI);const FI=CI+AI.length;let TI;lI.lastIndex=FI;const HI=lI.exec(mI);HI?(TI=lI.lastIndex+1-CI,HI[1]!=="startxref"&&((0,Vg.warn)(`indexObjects: Found "${HI[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),TI-=HI[1].length+1)):TI=II-CI,CI+=TI}else CI+=AI.length+1}for(const GI of dI)this.startXRefQueue.push(GI),this.readXRef(!0);const hI=[];let cI=!1;for(const GI of NI){gI.pos=GI;const AI=new Hg.Parser({lexer:new Hg.Lexer(gI),xref:this,allowStreams:!0,recoveryMode:!0}),RI=AI.getObj();if(!(0,Fg.isCmd)(RI,"trailer"))continue;const FI=AI.getObj();FI instanceof Fg.Dict&&(hI.push(FI),FI.has("Encrypt")&&(cI=!0))}let rI,uI;for(const GI of[...hI,"genFallback",...hI]){if(GI==="genFallback"){if(!uI)break;this._generationFallback=!0;continue}let AI=!1;try{const RI=GI.get("Root");if(!(RI instanceof Fg.Dict))continue;const FI=RI.get("Pages");if(!(FI instanceof Fg.Dict))continue;const TI=FI.get("Count");Number.isInteger(TI)&&(AI=!0)}catch(RI){uI=RI;continue}if(AI&&(!cI||GI.has("Encrypt"))&&GI.has("ID"))return GI;rI=GI}if(rI)return rI;if(this.topDict)return this.topDict;throw new Vg.InvalidPDFException("Invalid PDF structure.")}readXRef(Kg=!1){const _g=this.stream,il=new Set;for(;this.startXRefQueue.length;){try{const Tg=this.startXRefQueue[0];if(il.has(Tg)){(0,Vg.warn)("readXRef - skipping XRef table since it was already parsed."),this.startXRefQueue.shift();continue}il.add(Tg),_g.pos=Tg+_g.start;const eI=new Hg.Parser({lexer:new Hg.Lexer(_g),xref:this,allowStreams:!0});let iI=eI.getObj(),tI;if((0,Fg.isCmd)(iI,"xref")){if(tI=this.processXRefTable(eI),this.topDict||(this.topDict=tI),iI=tI.get("XRefStm"),Number.isInteger(iI)){const aI=iI;aI in this.xrefstms||(this.xrefstms[aI]=1,this.startXRefQueue.push(aI))}}else if(Number.isInteger(iI)){if(!Number.isInteger(eI.getObj())||!(0,Fg.isCmd)(eI.getObj(),"obj")||!((iI=eI.getObj())instanceof Dg.BaseStream))throw new Vg.FormatError("Invalid XRef stream");if(tI=this.processXRefStream(iI),this.topDict||(this.topDict=tI),!tI)throw new Vg.FormatError("Failed to read XRef stream")}else throw new Vg.FormatError("Invalid XRef stream header");iI=tI.get("Prev"),Number.isInteger(iI)?this.startXRefQueue.push(iI):iI instanceof Fg.Ref&&this.startXRefQueue.push(iI.num)}catch(Tg){if(Tg instanceof Lg.MissingDataException)throw Tg;(0,Vg.info)("(while reading XRef): "+Tg)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!Kg)throw new Lg.XRefParseException}getEntry(Kg){const _g=this.entries[Kg];return _g&&!_g.free&&_g.offset?_g:null}fetchIfRef(Kg,_g=!1){return Kg instanceof Fg.Ref?this.fetch(Kg,_g):Kg}fetch(Kg,_g=!1){if(!(Kg instanceof Fg.Ref))throw new Error("ref object is not a reference");const il=Kg.num,Tg=this._cacheMap.get(il);if(Tg!==void 0)return Tg instanceof Fg.Dict&&!Tg.objId&&(Tg.objId=Kg.toString()),Tg;let eI=this.getEntry(il);if(eI===null)return this._cacheMap.set(il,eI),eI;if(this._pendingRefs.has(Kg))return this._pendingRefs.remove(Kg),(0,Vg.warn)(`Ignoring circular reference: ${Kg}.`),Fg.CIRCULAR_REF;this._pendingRefs.put(Kg);try{eI.uncompressed?eI=this.fetchUncompressed(Kg,eI,_g):eI=this.fetchCompressed(Kg,eI,_g),this._pendingRefs.remove(Kg)}catch(iI){throw this._pendingRefs.remove(Kg),iI}return eI instanceof Fg.Dict?eI.objId=Kg.toString():eI instanceof Dg.BaseStream&&(eI.dict.objId=Kg.toString()),eI}fetchUncompressed(Kg,_g,il=!1){const Tg=Kg.gen;let eI=Kg.num;if(_g.gen!==Tg){const fI=`Inconsistent generation in XRef: ${Kg}`;if(this._generationFallback&&_g.gen<Tg)return(0,Vg.warn)(fI),this.fetchUncompressed(Fg.Ref.get(eI,_g.gen),_g,il);throw new Lg.XRefEntryException(fI)}const iI=this.stream.makeSubStream(_g.offset+this.stream.start),tI=new Hg.Parser({lexer:new Hg.Lexer(iI),xref:this,allowStreams:!0}),aI=tI.getObj(),oI=tI.getObj(),lI=tI.getObj();if(aI!==eI||oI!==Tg||!(lI instanceof Fg.Cmd))throw new Lg.XRefEntryException(`Bad (uncompressed) XRef entry: ${Kg}`);if(lI.cmd!=="obj"){if(lI.cmd.startsWith("obj")&&(eI=parseInt(lI.cmd.substring(3),10),!Number.isNaN(eI)))return eI;throw new Lg.XRefEntryException(`Bad (uncompressed) XRef entry: ${Kg}`)}return this.encrypt&&!il?_g=tI.getObj(this.encrypt.createCipherTransform(eI,Tg)):_g=tI.getObj(),_g instanceof Dg.BaseStream||this._cacheMap.set(eI,_g),_g}fetchCompressed(Kg,_g,il=!1){const Tg=_g.offset,eI=this.fetch(Fg.Ref.get(Tg,0));if(!(eI instanceof Dg.BaseStream))throw new Vg.FormatError("bad ObjStm stream");const iI=eI.dict.get("First"),tI=eI.dict.get("N");if(!Number.isInteger(iI)||!Number.isInteger(tI))throw new Vg.FormatError("invalid first and n parameters for ObjStm stream");let aI=new Hg.Parser({lexer:new Hg.Lexer(eI),xref:this,allowStreams:!0});const oI=new Array(tI),lI=new Array(tI);for(let vI=0;vI<tI;++vI){const pI=aI.getObj();if(!Number.isInteger(pI))throw new Vg.FormatError(`invalid object number in the ObjStm stream: ${pI}`);const gI=aI.getObj();if(!Number.isInteger(gI))throw new Vg.FormatError(`invalid object offset in the ObjStm stream: ${gI}`);oI[vI]=pI,lI[vI]=gI}const fI=(eI.start||0)+iI,BI=new Array(tI);for(let vI=0;vI<tI;++vI){const pI=vI<tI-1?lI[vI+1]-lI[vI]:void 0;if(pI<0)throw new Vg.FormatError("Invalid offset in the ObjStm stream.");aI=new Hg.Parser({lexer:new Hg.Lexer(eI.makeSubStream(fI+lI[vI],pI,eI.dict)),xref:this,allowStreams:!0});const gI=aI.getObj();if(BI[vI]=gI,gI instanceof Dg.BaseStream)continue;const bI=oI[vI],mI=this.entries[bI];mI&&mI.offset===Tg&&mI.gen===vI&&this._cacheMap.set(bI,gI)}if(_g=BI[_g.gen],_g===void 0)throw new Lg.XRefEntryException(`Bad (compressed) XRef entry: ${Kg}`);return _g}async fetchIfRefAsync(Kg,_g){return Kg instanceof Fg.Ref?this.fetchAsync(Kg,_g):Kg}async fetchAsync(Kg,_g){try{return this.fetch(Kg,_g)}catch(il){if(!(il instanceof Lg.MissingDataException))throw il;return await this.pdfManager.requestRange(il.begin,il.end),this.fetchAsync(Kg,_g)}}getCatalogObj(){return this.root}}Yg.XRef=$g},(Ng,Yg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.isNodeJS=void 0;const Xg=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");Yg.isNodeJS=Xg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.MessageHandler=void 0;var Vg=Xg(2);const Fg={DATA:1,ERROR:2},Hg={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Lg(Jg){switch(Jg instanceof Error||typeof Jg=="object"&&Jg!==null||(0,Vg.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),Jg.name){case"AbortException":return new Vg.AbortException(Jg.message);case"MissingPDFException":return new Vg.MissingPDFException(Jg.message);case"PasswordException":return new Vg.PasswordException(Jg.message,Jg.code);case"UnexpectedResponseException":return new Vg.UnexpectedResponseException(Jg.message,Jg.status);case"UnknownErrorException":return new Vg.UnknownErrorException(Jg.message,Jg.details);default:return new Vg.UnknownErrorException(Jg.message,Jg.toString())}}class Dg{constructor($g,Qg,Kg){this.sourceName=$g,this.targetName=Qg,this.comObj=Kg,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=_g=>{const il=_g.data;if(il.targetName!==this.sourceName)return;if(il.stream){this._processStreamMessage(il);return}if(il.callback){const eI=il.callbackId,iI=this.callbackCapabilities[eI];if(!iI)throw new Error(`Cannot resolve callback ${eI}`);if(delete this.callbackCapabilities[eI],il.callback===Fg.DATA)iI.resolve(il.data);else if(il.callback===Fg.ERROR)iI.reject(Lg(il.reason));else throw new Error("Unexpected callback case");return}const Tg=this.actionHandler[il.action];if(!Tg)throw new Error(`Unknown action from worker: ${il.action}`);if(il.callbackId){const eI=this.sourceName,iI=il.sourceName;new Promise(function(tI){tI(Tg(il.data))}).then(function(tI){Kg.postMessage({sourceName:eI,targetName:iI,callback:Fg.DATA,callbackId:il.callbackId,data:tI})},function(tI){Kg.postMessage({sourceName:eI,targetName:iI,callback:Fg.ERROR,callbackId:il.callbackId,reason:Lg(tI)})});return}if(il.streamId){this._createStreamSink(il);return}Tg(il.data)},Kg.addEventListener("message",this._onComObjOnMessage)}on($g,Qg){const Kg=this.actionHandler;if(Kg[$g])throw new Error(`There is already an actionName called "${$g}"`);Kg[$g]=Qg}send($g,Qg,Kg){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:$g,data:Qg},Kg)}sendWithPromise($g,Qg,Kg){const _g=this.callbackId++,il=(0,Vg.createPromiseCapability)();this.callbackCapabilities[_g]=il;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:$g,callbackId:_g,data:Qg},Kg)}catch(Tg){il.reject(Tg)}return il.promise}sendWithStream($g,Qg,Kg,_g){const il=this.streamId++,Tg=this.sourceName,eI=this.targetName,iI=this.comObj;return new ReadableStream({start:tI=>{const aI=(0,Vg.createPromiseCapability)();return this.streamControllers[il]={controller:tI,startCall:aI,pullCall:null,cancelCall:null,isClosed:!1},iI.postMessage({sourceName:Tg,targetName:eI,action:$g,streamId:il,data:Qg,desiredSize:tI.desiredSize},_g),aI.promise},pull:tI=>{const aI=(0,Vg.createPromiseCapability)();return this.streamControllers[il].pullCall=aI,iI.postMessage({sourceName:Tg,targetName:eI,stream:Hg.PULL,streamId:il,desiredSize:tI.desiredSize}),aI.promise},cancel:tI=>{(0,Vg.assert)(tI instanceof Error,"cancel must have a valid reason");const aI=(0,Vg.createPromiseCapability)();return this.streamControllers[il].cancelCall=aI,this.streamControllers[il].isClosed=!0,iI.postMessage({sourceName:Tg,targetName:eI,stream:Hg.CANCEL,streamId:il,reason:Lg(tI)}),aI.promise}},Kg)}_createStreamSink($g){const Qg=$g.streamId,Kg=this.sourceName,_g=$g.sourceName,il=this.comObj,Tg=this,eI=this.actionHandler[$g.action],iI={enqueue(tI,aI=1,oI){if(this.isCancelled)return;const lI=this.desiredSize;this.desiredSize-=aI,lI>0&&this.desiredSize<=0&&(this.sinkCapability=(0,Vg.createPromiseCapability)(),this.ready=this.sinkCapability.promise),il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.ENQUEUE,streamId:Qg,chunk:tI},oI)},close(){this.isCancelled||(this.isCancelled=!0,il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.CLOSE,streamId:Qg}),delete Tg.streamSinks[Qg])},error(tI){(0,Vg.assert)(tI instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.ERROR,streamId:Qg,reason:Lg(tI)}))},sinkCapability:(0,Vg.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:$g.desiredSize,ready:null};iI.sinkCapability.resolve(),iI.ready=iI.sinkCapability.promise,this.streamSinks[Qg]=iI,new Promise(function(tI){tI(eI($g.data,iI))}).then(function(){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.START_COMPLETE,streamId:Qg,success:!0})},function(tI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.START_COMPLETE,streamId:Qg,reason:Lg(tI)})})}_processStreamMessage($g){const Qg=$g.streamId,Kg=this.sourceName,_g=$g.sourceName,il=this.comObj,Tg=this.streamControllers[Qg],eI=this.streamSinks[Qg];switch($g.stream){case Hg.START_COMPLETE:$g.success?Tg.startCall.resolve():Tg.startCall.reject(Lg($g.reason));break;case Hg.PULL_COMPLETE:$g.success?Tg.pullCall.resolve():Tg.pullCall.reject(Lg($g.reason));break;case Hg.PULL:if(!eI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.PULL_COMPLETE,streamId:Qg,success:!0});break}eI.desiredSize<=0&&$g.desiredSize>0&&eI.sinkCapability.resolve(),eI.desiredSize=$g.desiredSize,new Promise(function(iI){iI(eI.onPull&&eI.onPull())}).then(function(){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.PULL_COMPLETE,streamId:Qg,success:!0})},function(iI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.PULL_COMPLETE,streamId:Qg,reason:Lg(iI)})});break;case Hg.ENQUEUE:if((0,Vg.assert)(Tg,"enqueue should have stream controller"),Tg.isClosed)break;Tg.controller.enqueue($g.chunk);break;case Hg.CLOSE:if((0,Vg.assert)(Tg,"close should have stream controller"),Tg.isClosed)break;Tg.isClosed=!0,Tg.controller.close(),this._deleteStreamController(Tg,Qg);break;case Hg.ERROR:(0,Vg.assert)(Tg,"error should have stream controller"),Tg.controller.error(Lg($g.reason)),this._deleteStreamController(Tg,Qg);break;case Hg.CANCEL_COMPLETE:$g.success?Tg.cancelCall.resolve():Tg.cancelCall.reject(Lg($g.reason)),this._deleteStreamController(Tg,Qg);break;case Hg.CANCEL:if(!eI)break;new Promise(function(iI){iI(eI.onCancel&&eI.onCancel(Lg($g.reason)))}).then(function(){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.CANCEL_COMPLETE,streamId:Qg,success:!0})},function(iI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.CANCEL_COMPLETE,streamId:Qg,reason:Lg(iI)})}),eI.sinkCapability.reject(Lg($g.reason)),eI.isCancelled=!0,delete this.streamSinks[Qg];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController($g,Qg){await Promise.allSettled([$g.startCall&&$g.startCall.promise,$g.pullCall&&$g.pullCall.promise,$g.cancelCall&&$g.cancelCall.promise]),delete this.streamControllers[Qg]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Yg.MessageHandler=Dg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.PDFWorkerStream=void 0;var Vg=Xg(2);class Fg{constructor(Jg){this._msgHandler=Jg,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return(0,Vg.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new Hg(this._msgHandler),this._fullRequestReader}getRangeReader(Jg,$g){const Qg=new Lg(Jg,$g,this._msgHandler);return this._rangeRequestReaders.push(Qg),Qg}cancelAllRequests(Jg){this._fullRequestReader&&this._fullRequestReader.cancel(Jg);for(const $g of this._rangeRequestReaders.slice(0))$g.cancel(Jg)}}Yg.PDFWorkerStream=Fg;class Hg{constructor(Jg){this._msgHandler=Jg,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const $g=this._msgHandler.sendWithStream("GetReader");this._reader=$g.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(Qg=>{this._isStreamingSupported=Qg.isStreamingSupported,this._isRangeSupported=Qg.isRangeSupported,this._contentLength=Qg.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:Jg,done:$g}=await this._reader.read();return $g?{value:void 0,done:!0}:{value:Jg.buffer,done:!1}}cancel(Jg){this._reader.cancel(Jg)}}class Lg{constructor(Jg,$g,Qg){this._msgHandler=Qg,this.onProgress=null;const Kg=this._msgHandler.sendWithStream("GetRangeReader",{begin:Jg,end:$g});this._reader=Kg.getReader()}get isStreamingSupported(){return!1}async read(){const{value:Jg,done:$g}=await this._reader.read();return $g?{value:void 0,done:!0}:{value:Jg.buffer,done:!1}}cancel(Jg){this._reader.cancel(Jg)}}}],Gg={};function Bg(Ng){var Yg=Gg[Ng];if(Yg!==void 0)return Yg.exports;var Xg=Gg[Ng]={exports:{}};return Zg[Ng](Xg,Xg.exports,Bg),Xg.exports}Bg.d=(Ng,Yg)=>{for(var Xg in Yg)Bg.o(Yg,Xg)&&!Bg.o(Ng,Xg)&&Object.defineProperty(Ng,Xg,{enumerable:!0,get:Yg[Xg]})},Bg.o=(Ng,Yg)=>Object.prototype.hasOwnProperty.call(Ng,Yg),Bg.r=Ng=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(Ng,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Ng,"__esModule",{value:!0})};var Wg={};return(()=>{var Ng=Wg;Object.defineProperty(Ng,"__esModule",{value:!0}),Object.defineProperty(Ng,"WorkerMessageHandler",{enumerable:!0,get:function(){return Yg.WorkerMessageHandler}});var Yg=Bg(1)})(),Wg})())}(pdf_worker)),pdf_worker.exports}var hasRequiredPdf_worker_entry;function requirePdf_worker_entry(){return hasRequiredPdf_worker_entry||(hasRequiredPdf_worker_entry=1,(typeof window<"u"?window:{}).pdfjsWorker=requirePdf_worker()),pdf_worker_entry}requirePdf_worker_entry();const _hoisted_1$1r={key:0},_hoisted_2$1f=["placeholder"],_hoisted_3$12={key:1,class:"documents-title-cont"},_hoisted_4$Q={class:"doc-title"},_hoisted_5$G={class:"crop-type-cont columns"},_hoisted_6$v={key:1,class:"file-preview has-slimscroll"},_hoisted_7$s={key:0,class:"upload-label"},_hoisted_8$o=vue.createElementVNode("div",{class:"upload-icon"},[vue.createElementVNode("i",{class:"iconify","data-icon":"material-symbols-light:upload-file-outline-rounded"})],-1),_hoisted_9$k={class:"upload-text-cont"},_hoisted_10$h={class:"upload-text"},_hoisted_11$g={class:"or-cont"},_hoisted_12$f=vue.createElementVNode("div",{class:"line"},null,-1),_hoisted_13$e={class:"text"},_hoisted_14$c=vue.createElementVNode("div",{class:"line"},null,-1),_hoisted_15$d={class:"crop-type-cont columns"},_hoisted_16$a={key:0,class:"upload-label"},_hoisted_17$9={class:"crop-type-cont columns"},_hoisted_18$9={class:"bw-title"},_hoisted_19$8=["src"],_hoisted_20$8={key:1,class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_0,style:{"object-fit":"cover","object-position":"30% 70%"}},_hoisted_21$7={class:"bw-title"},_hoisted_22$7=["src"],_hoisted_23$7={key:1,class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_1,style:{"object-fit":"cover","object-position":"30% 70%"}},_hoisted_24$6={class:"bw-title"},_hoisted_25$6={class:"uploader-container"},_hoisted_26$5=vue.createElementVNode("div",{class:"uploader-img-container"},[vue.createElementVNode("img",{class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_0,style:{"object-fit":"cover","object-position":"30% 70%"}})],-1),_hoisted_27$4=vue.createElementVNode("div",{class:"uploader-img-container"},[vue.createElementVNode("img",{class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_1,style:{"object-fit":"cover","object-position":"30% 70%"}})],-1),_hoisted_28$4={class:"bw-title"},_hoisted_29$4=["src"],_hoisted_30$3={class:"bw-title"},_hoisted_31$3=["src"],_hoisted_32$2={key:2,class:"doc-type-cont columns"},_hoisted_33$2=vue.createElementVNode("span",{class:"is-required"},"*",-1),_hoisted_34$2={class:"select-label-text"},_hoisted_35$2={class:"select-label-text"},_hoisted_36$2={class:"help text-danger"},_hoisted_37$2={key:3,class:"file-info-cont"},_hoisted_38$2={key:0,class:"loader-cont"},_hoisted_39$2={class:"progress-ring",width:"60",height:"60"},_hoisted_40$2=vue.createElementVNode("circle",{class:"progress-ring__circle",stroke:"#E5E7EB","stroke-width":"4",fill:"transparent",r:"26",cx:"30",cy:"30"},null,-1),_hoisted_41$2=["stroke-dasharray","stroke-dashoffset"],_hoisted_42$2={class:"progress-text"},_hoisted_43$2={class:"upload-text-cont"},_hoisted_44$2={class:"upload-text"},_hoisted_45$2=["src"],_hoisted_46$2=["src"],_hoisted_47$2={class:"file-text-cont"},_hoisted_48$2=vue.createElementVNode("i",{class:"iconify","data-icon":"eva:file-outline"},null,-1),_hoisted_49$2={class:"file-name-text"},_hoisted_50$2=vue.createElementVNode("p",null,null,-1),_hoisted_51$2=vue.createElementVNode("p",null,null,-1),_hoisted_52$2={class:"icon-toolbar-container"},_hoisted_53$1={key:0,class:"action-button-toolbar"},_hoisted_54$1={key:1,class:"action-button-toolbar"},_hoisted_55$1={key:2,class:"action-button-toolbar"},_hoisted_56$1={class:"camera-option-label"},MAX_FILE_SIZE$1=10*1024*1024,_sfc_main$1I=vue.defineComponent({__name:"V-DocumentLoader",props:{modelValue:{type:Object,required:!1},inputType:{type:String,default:"icon"},icon:{type:String,default:"bytesize:plus"},modaltitle:{type:String,default:"Upload File"},showPreview:{type:Boolean,default:!0},saveAsPdf:{type:Boolean,default:!0},useButtontoOpenModal:{type:Boolean,default:!0},isCropRequired:{type:Boolean,default:!1},isOCRRequired:{type:Boolean,default:!1},OCRType:{type:String,required:!1,default:null},authStore:{type:Object,required:!1},baseURL:{type:String,required:!1,default:""},isRequiredDocType:{type:Boolean,default:!1},isDisabledOptions:{type:Boolean,default:!1},isDisabledComponent:{type:Boolean,default:!1},isAddCameraOption:{type:Boolean,default:!1},isTwoSidedDocument:{type:Boolean,default:!1},isComponentTest:{type:Boolean,default:!1},docTypeOptions:{type:Array,default:[]}},emits:["file-selected","file-selected-with-ocr","close-modal","file-discarded","update:modelValue"],setup(ps,{expose:Ig,emit:Zg}){const{t:Gg,locale:Bg}=useI18n$1(),Wg=ps,Ng=vue.ref(!1),Yg=vue.ref(Wg.modelValue),Xg=vue.ref(""),Vg=vue.ref(""),Fg=vue.ref(),Hg=vue.ref(null),Lg=vue.ref(),Dg=vue.ref(!1),Jg=vue.ref(!1),$g=vue.ref(1),Qg=vue.ref(0);vue.ref();const Kg=vue.ref(),_g=vue.ref(!1),il=vue.ref(!1),Tg=vue.ref(!1),eI=vue.ref(!1),iI=vue.ref(),tI=vue.ref("both"),aI=()=>{const UC=new Date,gA=UC.getFullYear(),AA=String(UC.getMonth()+1).padStart(2,"0"),dA=String(UC.getDate()).padStart(2,"0"),a0=String(UC.getHours()).padStart(2,"0"),o0=String(UC.getMinutes()).padStart(2,"0"),BA=String(UC.getSeconds()).padStart(2,"0"),f0=String(UC.getMilliseconds()).padStart(3,"0");return`IMG_${gA}${AA}${dA}_${a0}${o0}${BA}${f0}.jpeg`},oI=()=>{_g.value=!0,iI.value="Camera will be initializing"},lI=()=>{iI.value="Initializing Camera"},fI=UC=>{UC==="front"?iI.value="Show Front Face to Camera":UC==="back"?iI.value="Show Back Face to Camera":iI.value="Show Document to Camera"},BI=async UC=>{console.log("Captured Image:",Kg.value,UC),iI.value="Crop Image for more accurate text recognition",UC==="front"?(PI(),pI.value=null,gI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},pI.value=HI(Kg.value,aI()),gI.value=URL.createObjectURL(pI.value)):UC==="back"?(PI(),bI.value=null,mI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},bI.value=HI(Kg.value,aI()),mI.value=URL.createObjectURL(bI.value)):IC(HI(Kg.value,aI())),_g.value=!1,tI.value="both",Kg.value=""},vI=vue.computed(()=>{let UC=Wg.docTypeOptions,gA=[];return UC==null||UC.forEach(AA=>{let dA={value:"",localename:""};dA.value=AA.alpha3code,dA.localename=AA.translations[Bg.value],gA==null||gA.push(dA)}),gA}),pI=vue.ref(),gI=vue.ref(),bI=vue.ref(),mI=vue.ref(),II=vue.ref({uploadedFile:null}),CI=vue.ref({uploadedFile:null});vue.ref({uploadedFile:null,docType:null});const NI=vue.computed(()=>({documentType:{required:common.withMessage(Gg("validators.customrequired",{cvalue:Gg("form.doctypetext")}),requiredIf(()=>!!(II.value.uploadedFile&&Wg.isRequiredDocType)))}})),dI=useVuelidate(NI.value,Yg.value),hI=Zg,cI=vue.ref(0),rI=vue.ref(null),uI=vue.ref(null),GI=vue.ref(null),AI=vue.ref(null),RI=vue.ref(null),FI=vue.computed(()=>Math.min(100,Math.max(0,cI.value))),TI=vue.ref(!1),HI=(UC,gA)=>{var w0;const[AA,dA]=UC.split(","),a0=((w0=AA.match(/:(.*?);/))==null?void 0:w0[1])||"image/png",o0=atob(dA),BA=new Uint8Array(o0.length);for(let HC=0;HC<o0.length;HC++)BA[HC]=o0.charCodeAt(HC);const f0=new Blob([BA],{type:a0});return new File([f0],gA,{type:a0})},wI=async UC=>{try{const gA=await QI(pI.value,bI.value),AA=URL.createObjectURL(gA),dA=new File([gA],aI(),{type:"image/jpeg"});PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},console.log("mergeBeforeUpload - Girdi mi ?",dA),AA&&IC(dA)}catch(gA){console.error("Error merging images:",gA)}},WI=async UC=>{tI.value="both",RI.value.click()},xI=UC=>{console.log("handleFileUpload - Girdi mi ?",UC),PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC};const gA=UC.target;gA.files&&gA.files.length>0&&(IC(gA.files[0]),gA.value="")},YI=async UC=>{tI.value="front",GI.value.click()},JI=async UC=>{tI.value="front",_g.value=!0},zI=async UC=>{tI.value="back",_g.value=!0},MI=async UC=>{console.log("handleFrontUpload - Girdi mi ?",UC),PI(),pI.value=null,gI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC};const gA=UC.target;if(gA.files&&gA.files.length>0){pI.value=gA.files[0];const AA=await _I(pI.value);gI.value=URL.createObjectURL(AA),pI.value=AA,gA.value=""}},XI=async UC=>{tI.value="back",AI.value.click()},OI=async UC=>{console.log("handleBackUpload - Girdi mi ?",UC),PI(),bI.value=null,mI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC};const gA=UC.target;if(gA.files&&gA.files.length>0){bI.value=gA.files[0];const AA=await _I(bI.value);mI.value=URL.createObjectURL(AA),bI.value=AA,gA.value=""}},KI=UC=>{var gA;console.log("handleDrop - Girdi mi ?",UC),PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},TI.value=!1,(gA=UC.dataTransfer)!=null&&gA.files.length&&IC(UC.dataTransfer.files[0])},EI=(UC,gA)=>new Promise((AA,dA)=>{var a0=new FileReader;a0.onload=o0=>{var BA;AA((BA=o0==null?void 0:o0.target)==null?void 0:BA.result)},a0.onerror=dA,a0.readAsDataURL(UC)}),UI=UC=>{let gA=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];for(var AA=1;AA<gA.length;AA++)if(UC<Math.pow(1024,AA))return Math.round(UC/Math.pow(1024,AA-1)*100)/100+gA[AA-1];return UC==null?void 0:UC.toString()};vue.ref();const eC=vue.reactive({uploadedDocument:void 0,uploadedDocumentURL:"",uploadedDocumentData:void 0,uploadedImageURL:"",uploadedImageData:void 0,uploadedBLOB:void 0}),LI=vue.reactive({chequeData:{isRecipientMatu:!1,bankName:"",bankCode:"",bankBranch:"",amountNumeric:0,amountWritten:"",payor:"",accountNo:"",recipient:"",dueDate:"",serialNo:"",micr:"",isSigned:!1,signatureBoundingBox:{left:0,top:0,width:0,height:0},modelNotes:""},identityData:{isNewDesign:!1,isFrontExist:!1,isBackExist:!1,nationalIdNumber:"",firstName:"",lastName:"",fatherName:"",motherName:"",placeOfBirth:"",dateOfBirth:"",address:"",expiryDate:"",serialNumber:"",civilRegistrationNumber:"",secureBarcode:"",sex:"",signatureBoundingBox:{left:0,top:0,width:0,height:0},photoBoundingBox:{left:0,top:0,width:0,height:0},modelNotes:""},registrationData:{isFrontExist:!1,isBackExist:!1,registrationNumber:"",previousRegistrationNumber:"",firstRegistrationDate:"",mcInMoroccoDate:"",mutationDate:"",usage:"",ownerName:"",address:"",expiryDate:"",vehicleMake:"",vehicleType:"",vehicleCategory:"",vehicleModel:"",fuelType:"",chassisNumber:"",numberOfCylinders:0,fiscalPower:0,numberOfSeats:0,ptac:0,emptyWeight:0,ptra:0,restrictions:"",secureBarcode:"",registrationType:"",modelNotes:""},cashdepositslipData:{bankName:"",bankCode:"",agency:"",executedBy:"",accountNumber:"",accountHolder:"",isAccountHolderMatu:!1,reference:"",date:"",valueDate:"",amountInWords:"",bills:[],coins:[],subtotal:0,fees:0,vat:0,netAmount:0,agentSignature:!1,clientSignature:!1,modelNotes:""},creditCardData:{isMerchantMatu:!1,merchantName:"",transactionType:"",transactionDateTime:"",posId:"",tpeLogicalCode:"",cardNumber:"",isLocalCard:!1,cardInfo:"",cardNetwork:"",transactionAmount:0,currency:"",transactionNumber:"",authorizationNumber:"",stan:"",handwrittenText:"",modelNotes:""},passportData:{isBioPageExist:!1,nationality:"",passportNumber:"",ownerPid:"",ownerLastName:"",ownerFirstName:"",birthDate:"",birthPlace:"",sex:"",issueDate:"",expiryDate:"",issuingAuthority:"",passportType:"",mrz:"",photoBoundingBox:{left:0,top:0,width:0,height:0},signatureBoundingBox:{left:0,top:0,width:0,height:0},modelNotes:""},driverLicenseData:{isFrontExist:!1,isBackExist:!1,licenseNumber:"",ownerPid:"",ownerLastName:"",ownerFirstName:"",birthDate:"",birthPlace:"",address:"",issueDate:"",expiryDate:"",issuingAuthority:"",authorizedCategories:[],modelNotes:""},medicalReportData:{postalBarcode:"",eventDate:"",policyNo:"",invoiceNo:"",invoiceDate:"",invoiceAmount:"",courtInfo:{courtName:"",caseNumber:"",summonDate:"",victimName:""},patients:[],modelNotes:""},chequeStatementData:{bankCode:"",bankName:"",clientCode:"",clientName:"",errorCode:null,errorMessage:null,isMatu:!1,modelNotes:{en:"",fr:""},rejectedChecks:[],statementDate:{clearingDate:"",processingDate:"",rejectionDate:""}},WWVehicleCertificateData:{buyerAddress:"",buyerName:"",buyerProfession:"",certificateNumber:"",chassisNumber:"",deliveredBy:"",errorCode:"",errorMessage:"",fiscalPower:null,fuelType:null,issuanceDate:"",modelNotes:{en:"",fr:""},numberOfCylinders:null,ptc:"",registrationNumber:"",sellerName:"",serialNumber:"",vehicleCategory:"",vehicleMake:"",vehicleModel:"",vehicleType:""},ModelJData:{activity:"",branchesAgencies:"",businessOrigin:"",chronologicalNumber:null,companyName:"",companyOrigin:"",courtLocation:"",courtLocationCityCode:null,endDate:"",errorCode:null,errorMessage:null,headquartersAddress:"",headquartersCityCode:null,iceNumber:null,industryCode:"",legalForm:"",managers:[],modelNotes:{en:"",fr:""},rcNumber:"",registrationDate:"",shareCapital:null,startDate:"",tradeName:"",tradeSign:""},cnssBordereauData:{documentType:"",packageType:"",documentTitle:"",issueDate:"",submissionDeadline:"",structuredReference:"",formCode:"",employerName:"",employerAddressLines:[],employerCity:"",affiliateNumber:"",agency:"",declarationMonth:null,declarationYear:null,pageCountDetected:null,hasGeneralSalaryPages:!1,hasEntrantPages:!1,pageSummaries:[],displayedFinalCumulativeTotal:null,salaryLines:[],entrantLines:[],signaturePresent:!1,stampPresent:!1,signaturePlace:"",signatureDate:"",modelNotes:"",errorCode:null,errorMessage:""}}),DI=UC=>{const gA={};for(const AA in UC)if(UC.hasOwnProperty(AA)){const dA=UC[AA];typeof dA=="string"?gA[AA]="":typeof dA=="number"?gA[AA]=0:typeof dA=="boolean"?gA[AA]=!1:Array.isArray(dA)?gA[AA]=[]:typeof dA=="object"&&dA!==null?gA[AA]=DI(dA):gA[AA]=null}return gA},PI=()=>{eC.uploadedDocument="",eC.uploadedDocumentURL="",eC.uploadedDocumentData="",eC.uploadedImageURL="",eC.uploadedImageData="",eC.uploadedBLOB=""};function $I(UC){return new Promise((gA,AA)=>{const dA=new Image,a0=URL.createObjectURL(UC);dA.onload=()=>{URL.revokeObjectURL(a0),gA(dA)},dA.onerror=o0=>{AA(o0)},dA.src=a0})}async function QI(UC,gA){const AA=await $I(UC),dA=await $I(gA),a0=(AA==null?void 0:AA.width)>(dA==null?void 0:dA.width)?AA==null?void 0:AA.width:dA==null?void 0:dA.width,o0=(AA==null?void 0:AA.width)>(dA==null?void 0:dA.width)?AA==null?void 0:AA.height:dA==null?void 0:dA.height,BA=a0*2,f0=o0,w0=document.createElement("canvas");w0.width=BA,w0.height=f0;const HC=w0.getContext("2d");if(!HC)throw new Error("Failed to get 2D context from canvas.");return HC.drawImage(AA,0,0,a0,o0),HC.drawImage(dA,a0,0,a0,o0),new Promise((WC,tA)=>{w0.toBlob(rA=>{rA?WC(rA):tA(new Error("Canvas is empty or couldn't be converted to a Blob."))},"image/jpeg",1)})}const _I=async UC=>{let gA=!!UC.type.startsWith("image/"),AA=UC.type==="application/pdf";return!gA&&!AA?(console.log("Error:",Gg("error.NotAllowedFile")),Xg.value=Gg("error.NotAllowedFile"),null):UC.size>MAX_FILE_SIZE$1?(console.log("Error:",Gg("error.FileSize")),Xg.value=Gg("error.FileSize"),null):AA?await rC(UC):UC},IC=async UC=>{let gA=!!UC.type.startsWith("image/"),AA=UC.type==="application/pdf";if(PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),!gA&&!AA){console.log("Error:",Gg("error.NotAllowedFile")),Xg.value=Gg("error.NotAllowedFile");return}if(UC.size>MAX_FILE_SIZE$1){console.log("Error:",Gg("error.FileSize")),Xg.value=Gg("error.FileSize");return}if(gA){Fg.value=URL.createObjectURL(UC);const dA=await EI(UC);eC.uploadedImageData=dA,eC.uploadedImageURL=Fg.value;const a0=new Blob([UC],{type:UC.type});eC.uploadedBLOB=a0}else if(AA){const dA=await rC(UC);Fg.value=URL.createObjectURL(dA);const a0=await EI(UC);eC.uploadedDocumentData=a0,eC.uploadedDocument=UC;const o0=new Blob([UC],{type:UC.type});eC.uploadedBLOB=o0,eC.uploadedDocumentURL=URL.createObjectURL(o0),console.log("updocuments.uploadedDocument- URL",eC.uploadedDocumentURL)}II.value.uploadedFile=UC,CI.value.uploadedFile=UC,Hg.value=URL.createObjectURL(UC),eC.uploadedDocument=UC,Yg.value.updocument={...eC},GC()};function rC(UC,gA=1){return new Promise((AA,dA)=>{const a0=new FileReader;a0.onload=async()=>{try{console.log("convertPdfToImage - fileReader.onload");const o0=new Uint8Array(a0.result),f0=await pdfExports.getDocument({data:o0}).promise;Qg.value=f0.numPages;const w0=await f0.getPage(gA),WC=w0.getViewport({scale:1.5}),tA=document.createElement("canvas"),rA=tA.getContext("2d");tA.width=WC==null?void 0:WC.width,tA.height=WC==null?void 0:WC.height;const YA={canvasContext:rA,viewport:WC};await w0.render(YA).promise,tA.toBlob(QA=>{if(!QA){dA(new Error("Failed to convert canvas to Blob."));return}const OA=new File([QA],aI(),{type:"image/png"});AA(OA)},"image/png")}catch(o0){dA(o0)}},a0.onerror=o0=>{dA(o0)},a0.readAsArrayBuffer(UC)})}const lC=async()=>{if($g.value<Qg.value){$g.value++;const UC=await rC(II.value.uploadedFile,$g.value);Fg.value=URL.createObjectURL(UC)}},uC=async()=>{if($g.value>1){$g.value--;const UC=await rC(II.value.uploadedFile,$g.value);Fg.value=URL.createObjectURL(UC)}},GC=()=>{cI.value=0,rI.value=setInterval(()=>{cI.value<100?cI.value+=Math.random()*100:cC()},100)},cC=()=>{rI.value!==null&&(clearInterval(rI.value),rI.value=null)},dC=()=>{var UC,gA;if(console.log("save:",{...Yg.value}),eI.value=!0,Wg.isRequiredDocType){if((UC=dI.value)==null||UC.$touch(),(gA=dI.value)!=null&&gA.$invalid)return;hI("file-selected",CI.value),hI("update:modelValue",Yg.value)}else hI("file-selected",CI.value),hI("update:modelValue",Yg.value);Ng.value=!1,gI.value&&URL.revokeObjectURL(gI.value),mI.value&&URL.revokeObjectURL(mI.value),pI.value=null,bI.value=null,gI.value=null,mI.value=null,Dg.value=!1,Vg.value="",Xg.value=""},aC=async()=>{var gA,AA;console.log("saveOCR:",{...Yg.value}),eI.value=!0;let UC=!0;if(Tg.value||await _A().then(()=>{UC=!0}).catch(dA=>{console.log("error -- message:",dA.message,dA),UC=!1,dA.message||(Xg.value=Gg("error.processOCR"))}),UC){if(console.log("isOCRpassed"),Wg.isRequiredDocType){if((gA=dI.value)==null||gA.$touch(),(AA=dI.value)!=null&&AA.$invalid)return;hI("file-selected-with-ocr",CI.value),hI("update:modelValue",Yg.value)}else hI("file-selected-with-ocr",CI.value),hI("update:modelValue",Yg.value);Ng.value=!1,gI.value&&URL.revokeObjectURL(gI.value),mI.value&&URL.revokeObjectURL(mI.value),pI.value=null,bI.value=null,gI.value=null,mI.value=null,Dg.value=!1,Tg.value=!1,Vg.value="",Xg.value=""}},oC=()=>{console.log("discard:",{...Yg.value},Yg.value),II.value.uploadedFile=null,Fg.value&&URL.revokeObjectURL(Fg.value),Fg.value=null,gI.value&&URL.revokeObjectURL(gI.value),mI.value&&URL.revokeObjectURL(mI.value),pI.value=null,bI.value=null,gI.value=null,mI.value=null,Dg.value=!1,_g.value=!1,PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.fileName="",Yg.value.size="",Yg.value.mimeType="",Yg.value.lastModifiedDate="",Yg.value.updocument={...eC},Xg.value="",Vg.value="",hI("file-discarded")},CC=()=>{console.log("onCrop:"),Xg.value="",Vg.value="",Lg.value.getResult().canvas.toBlob(async UC=>{if(UC){console.log("croppedImg.value.getResult():");const AA=`${II.value.uploadedFile.name.replace(/\.[^/.]+$/,"")}_cropped.jpeg`;CI.value.uploadedFile=new File([UC],AA,{type:"image/jpeg"}),Hg.value=URL.createObjectURL(CI.value.uploadedFile);const dA=await EI(CI.value.uploadedFile);eC.uploadedImageData=dA,eC.uploadedImageURL=Hg.value,eC.uploadedDocumentData="",eC.uploadedDocumentURL="",eC.uploadedBLOB="",eC.uploadedDocument=CI.value.uploadedFile,Yg.value.updocument={...eC},Dg.value=!0,Vg.value=Gg("warning.imagecropped"),Wg.showPreview||dC()}})},sC=()=>{var gA,AA;const UC={left:Lg.value.coordinates.left+((gA=Lg.value.coordinates)==null?void 0:gA.width)/2,top:Lg.value.coordinates.top+((AA=Lg.value.coordinates)==null?void 0:AA.height)/2};Lg.value.setCoordinates([({coordinates:dA,imageSize:a0})=>({width:a0==null?void 0:a0.width,height:a0==null?void 0:a0.height}),({coordinates:dA,imageSize:a0})=>({left:UC.left-(dA==null?void 0:dA.width)/2,top:UC.top-(dA==null?void 0:dA.height)/2})])},wC=()=>{Lg.value.setCoordinates(({coordinates:UC,imageSize:gA})=>({left:(gA==null?void 0:gA.width)/2-(UC==null?void 0:UC.width)/2,top:(gA==null?void 0:gA.height)/2-(UC==null?void 0:UC.height)/2}))},SC=(UC=1,gA=1)=>{let AA=null;Lg.value.setCoordinates([({coordinates:dA,imageSize:a0})=>(AA=dA,{width:(dA==null?void 0:dA.width)*UC,height:(dA==null?void 0:dA.height)*gA}),({coordinates:dA,imageSize:a0})=>({left:AA.left+((AA==null?void 0:AA.width)-(dA==null?void 0:dA.width))/2,top:AA.top+((AA==null?void 0:AA.height)-(dA==null?void 0:dA.height))/2})])},gC=(UC,gA)=>{Lg.value.imageTransforms.rotate%180!==0?Lg.value.flip(!UC,!gA):Lg.value.flip(UC,gA)},YC=UC=>{Lg.value.rotate(UC)},FC=()=>{Lg.value&&Lg.value.reset()},ZC=()=>{var UC;console.log("setFullCrop"),Lg.value&&((UC=Lg.value)==null||UC.setCoordinates(({coordinates:gA,imageSize:AA})=>({left:0,top:0,width:AA.width,height:AA.height})))},VC=()=>{FC(),IC(II.value.uploadedFile),Dg.value=!1,Tg.value=!1,Xg.value="",Vg.value=""};vue.onBeforeUnmount(()=>{console.log("onBeforeUnmount:",{...Yg.value},Yg.value),Xg.value="",Vg.value="",PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),cC()}),vue.onMounted(()=>{eI.value=!1,Xg.value="",Vg.value="",Ng.value=!Wg.useButtontoOpenModal,II.value.uploadedFile=null,PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Dg.value=!1,Yg.value.documentType&&(Yg.value.documentDescription=jd.value(vI.value,Yg.value.documentType))}),Ig({discard:oC});const pC=vue.computed(()=>II.value.uploadedFile?II.value.uploadedFile.type.startsWith("image/"):!1),lA=vue.computed(()=>II.value.uploadedFile?II.value.uploadedFile.type==="application/pdf":!1);vue.computed(()=>Wg.icon&&Wg.icon.indexOf(":")!==-1);const eA=vue.computed(()=>Fg.value&&(Wg.isCropRequired||Wg.isOCRRequired)),jd=vue.computed(()=>(UC,gA)=>{for(const AA of UC)if(AA.value===gA)return AA.localename}),qA=UC=>{var AA,dA,a0,o0,BA,f0,w0;let gA=null;return console.log("prepareHeader:",UC),!UC||!((AA=UC==null?void 0:UC.auth)!=null&&AA.token)?Xg.value=Gg("error.auth"):gA={Authorization:"Bearer "+((dA=UC==null?void 0:UC.auth)==null?void 0:dA.token),"X-Custom-Header":"custom-value",locale:(a0=UC==null?void 0:UC.user)==null?void 0:a0.defaultLocale,role_name:(o0=UC==null?void 0:UC.user)==null?void 0:o0.mainRole,sessionId:(BA=UC==null?void 0:UC.auth)==null?void 0:BA.sessionId,timezone:(f0=UC==null?void 0:UC.user)==null?void 0:f0.timezone,requestId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",transactionId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",clientIP:"10.120.2.120",companyId:(w0=UC==null?void 0:UC.user)==null?void 0:w0.companyId,trxType:"TEST"},gA},yA=async(UC,gA,AA={},dA,a0={})=>{const o0=new FormData;o0.append(dA,gA),Object.entries(a0).forEach(([BA,f0])=>{o0.append(BA,f0.toString())});try{const BA=await fetch(UC,{method:"POST",body:o0,headers:{...AA}});if(!BA.ok){Vg.value="";const f0=await BA.json();throw Xg.value=`${f0.message} Status: ${BA.status}`,f0}return BA.json()}catch(BA){throw console.log("Error Message:",BA),Vg.value="",Xg.value=`${BA.message} - Name: ${BA.name}`,BA}},_A=async()=>{var gA,AA,dA,a0,o0,BA,f0,w0,HC,WC,tA,rA,YA,QA,OA,TA,GA,n0,jC,aA,IA,KA,RA,g0;console.log("getOCRResults:",Wg.OCRType,Yg.value.documentType);let UC=null;if(Wg.isComponentTest?UC={Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJmYjUxZTdmNS1hMGM3LTRmMTgtYTE0My1hYzI0ZTlhYTdhYTkiLCJwcmFpIjoiOTJlNmFjODYtN2VjYy00Y2ViLWE0NGMtZDY4NDlhOGIyMjMzIiwic2VzcyI6IjVkODUzNmU1LWFhMWMtNGU4OS04NzJmLTcxNGU1YTE2YTczYSIsImF1ZCI6IjIwZDQwZWNhLTE0MjEtNDIxNS1hYzY0LTVlNWQ3MDg5NTRiNSIsImV4cCI6MTc3NTAzNTc4NSwiaWF0IjoxNzc0ODYyOTg1LCJ0bXoiOiIrMDA6MDAifQ.JEPlnUZjSVFP4C5tT_ZP_TVCzX_CKNEs-G_TWJHsmjuxKuArFLrs6x4xtWs5hUDrtFXF6vC2VM7ZUIZsf9l28HJzKkXfgCN6_u4BB3iy2Y92R4tzfINa--EhwkOGnaDaFC22ylZtU6p0TkQMPOMsGWlGfErv7jQvjbzhjDjjmYTZrqdvncGM_zUVTBNnQ5I3ztrSQlrzXvEAsDr6r6_UrGM3dQcRzGRx372nWok_E4n0_X87Fs3xgQg-pIyKPJO2kvMopsqqZLz0VBx2Wxm4wy2_5m4bKvyF7_b7xhVtvZSV_gylxgZnZ-1BOWluaOodOAsXH4Z8b7yECShHz3l2ew","X-Custom-Header":"custom-value",locale:"en",role_name:"ROLE_RESPON_DIRECT",sessionId:"5d8536e5-aa1c-4e89-872f-714e5a16a73a",timezone:"Europe/Istanbul",requestId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",transactionId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",clientIP:"10.120.2.120",companyId:"20d40eca-1421-4215-ac64-5e5d708954b5",trxType:"TEST"}:UC=qA(Wg.authStore),Xg.value="",UC){if(console.log("customHeaders----> OK"),!Wg.OCRType&&!Yg.value.documentType)Xg.value=Gg("error.doctype");else if(Wg.OCRType==="CHQ"||Yg.value.documentType==="CHQ"){if(Wg.isRequiredDocType&&((gA=dI.value)==null||gA.$touch(),(AA=dI.value)!=null&&AA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/cheque/file",CI.value.uploadedFile,UC,"check").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.chequeData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="GRS"||Yg.value.documentType==="GRS"){if(Wg.isRequiredDocType&&((dA=dI.value)==null||dA.$touch(),(a0=dI.value)!=null&&a0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/registrationCard/file",CI.value.uploadedFile,UC,"doc").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.registrationData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Yg.value.documentType==="MID"||Wg.OCRType==="MID"){if(Wg.isRequiredDocType&&((o0=dI.value)==null||o0.$touch(),(BA=dI.value)!=null&&BA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/idCard/file",CI.value.uploadedFile,UC,"card").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.identityData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw console.log("OCR Error:",uA.message),il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="CDS"||Yg.value.documentType==="CDS"){if(Wg.isRequiredDocType&&((f0=dI.value)==null||f0.$touch(),(w0=dI.value)!=null&&w0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/cashDeposit/file",CI.value.uploadedFile,UC,"slip").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.cashdepositslipData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="TPE"||Yg.value.documentType==="TPE"){if(Wg.isRequiredDocType&&((HC=dI.value)==null||HC.$touch(),(WC=dI.value)!=null&&WC.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/tpeSlip/file",CI.value.uploadedFile,UC,"tpe").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.creditCardData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw console.log("jsonError",uA),il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="PAS"||Yg.value.documentType==="PAS"){if(Wg.isRequiredDocType&&((tA=dI.value)==null||tA.$touch(),(rA=dI.value)!=null&&rA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/pasaport/file",CI.value.uploadedFile,UC,"passport").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.passportData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="DRV"||Yg.value.documentType==="DRV"){if(Wg.isRequiredDocType&&((YA=dI.value)==null||YA.$touch(),(QA=dI.value)!=null&&QA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/driversLicence/file",CI.value.uploadedFile,UC,"driver").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.driverLicenseData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="MED"||Yg.value.documentType==="MED"){if(Wg.isRequiredDocType&&((OA=dI.value)==null||OA.$touch(),(TA=dI.value)!=null&&TA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/medicalReport/file",CI.value.uploadedFile,UC,"medical").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.medicalReportData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="SOC"||Yg.value.documentType==="SOC"){if(Wg.isRequiredDocType&&((GA=dI.value)==null||GA.$touch(),(n0=dI.value)!=null&&n0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/chequeStatus/file",CI.value.uploadedFile,UC,"statement").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.chequeStatementData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="WWR"||Yg.value.documentType==="WWR"){if(Wg.isRequiredDocType&&((jC=dI.value)==null||jC.$touch(),(aA=dI.value)!=null&&aA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/wwRegistration/file",CI.value.uploadedFile,UC,"wwreg").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.WWVehicleCertificateData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="RCO"||Yg.value.documentType==="RCO"){if(Wg.isRequiredDocType&&((IA=dI.value)==null||IA.$touch(),(KA=dI.value)!=null&&KA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/modeleJ/file",CI.value.uploadedFile,UC,"modelej").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.ModelJData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="CNS"||Yg.value.documentType==="CNS"){if(Wg.isRequiredDocType&&((RA=dI.value)==null||RA.$touch(),(g0=dI.value)!=null&&g0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/cnssBordereau/file",CI.value.uploadedFile,UC,"cnssbordereau").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.cnssBordereauData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}}else throw console.log("customHeaders----> NOK"),Xg.value="Control Authorization parameters to access GenAI",new Error(Xg.value)},i0=vue.computed(()=>UC=>{const gA=document.getElementById("targetImage");let AA=0,dA=0,a0=0,o0=0;if(gA){const WC=gA==null?void 0:gA.getBoundingClientRect();AA=WC==null?void 0:WC.width,dA=WC==null?void 0:WC.height,a0=WC.top,o0=WC.left}const BA=(UC==null?void 0:UC.width)*AA,f0=(UC==null?void 0:UC.height)*dA,w0=o0+(UC==null?void 0:UC.left)*AA-240;return{top:`${a0+(UC==null?void 0:UC.top)*dA-80}px`,left:`${w0}px`,width:`${BA}px`,height:`${f0}px`}});return vue.watch(()=>Ng.value,(UC,gA)=>{UC===!1&&hI("close-modal")}),vue.watch(()=>II.value.uploadedFile,(UC,gA)=>{UC&&(Yg.value.fileName=UC==null?void 0:UC.name,Yg.value.mimeType=UC==null?void 0:UC.type,Yg.value.size=UI(UC==null?void 0:UC.size),Yg.value.lastModifiedDate=new Date(UC==null?void 0:UC.lastModified).toISOString(),Yg.value.updocument={...eC},console.log("MetaData - uploadedFile:",Yg.value))}),vue.watch(()=>CI.value.uploadedFile,(UC,gA)=>{UC&&(Yg.value.fileName=UC==null?void 0:UC.name,Yg.value.mimeType=UC==null?void 0:UC.type,Yg.value.size=UI(UC==null?void 0:UC.size),Yg.value.lastModifiedDate=new Date(UC==null?void 0:UC.lastModified).toISOString(),Yg.value.updocument={...eC},console.log("MetaData - Cropped:",Yg.value))}),vue.watch(()=>Yg.value.documentType,(UC,gA)=>{UC&&(Xg.value="",Yg.value.documentDescription=jd.value(vI.value,Yg.value.documentType))}),vue.watch(()=>Jg.value,(UC,gA)=>{console.log("isUseCamera.value has changed:",UC,gA)}),(UC,gA)=>{const AA=BWControl,dA=_sfc_main$29,a0=BWField,o0=_sfc_main$1Q,BA=_sfc_main$1J,f0=_sfc_main$1K,w0=_sfc_main$1N,HC=_sfc_main$29,WC=BWIconWrap,tA=_sfc_main$2c,rA=vue.resolveComponent("json-editor-vue"),YA=BWLoader,QA=_sfc_main$1O,OA=_sfc_main$2c,TA=vue.resolveComponent("Multiselect"),GA=BWPdfViewer,n0=_sfc_main$1R,jC=_sfc_main$1S,aA=BWModal;return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[ps.inputType==="form"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1r,[vue.createVNode(a0,null,{default:vue.withCtx(()=>[vue.createElementVNode("label",null,vue.toDisplayString(ps.modaltitle),1),vue.createVNode(a0,{addons:""},{default:vue.withCtx(()=>[vue.createVNode(AA,{expanded:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":gA[0]||(gA[0]=IA=>Yg.value.fileName=IA),type:"text",class:"input",name:"docname",placeholder:ps.modaltitle,autocomplete:"off",disabled:""},null,8,_hoisted_2$1f),[[vue.vModelText,Yg.value.fileName]])]),_:1}),vue.createVNode(AA,null,{default:vue.withCtx(()=>[vue.createVNode(dA,{disabled:ps.isDisabledComponent,color:"success",light:"",onClick:gA[1]||(gA[1]=IA=>Ng.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("Choose File")]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})])):vue.createCommentVNode("",!0),ps.inputType==="title"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$12,[vue.createElementVNode("span",_hoisted_4$Q,vue.toDisplayString(ps.modaltitle),1),vue.createVNode(o0,{disabled:ps.isDisabledComponent,class:"upload-button",outlined:"",circle:"",color:"primary",icon:ps.icon,onClick:gA[2]||(gA[2]=IA=>Ng.value=!0)},null,8,["disabled","icon"])])):vue.createCommentVNode("",!0),ps.inputType==="icon"?(vue.openBlock(),vue.createBlock(o0,{key:2,disabled:ps.isDisabledComponent,class:"upload-button",outlined:"",circle:"",color:"primary",icon:ps.icon,onClick:gA[3]||(gA[3]=IA=>Ng.value=!0)},null,8,["disabled","icon"])):vue.createCommentVNode("",!0),vue.createVNode(aA,{open:Ng.value,title:ps.modaltitle,size:"mega",class:vue.normalizeClass("uploader-page-content-inner"),onClose:gA[34]||(gA[34]=IA=>(oC(),Ng.value=!1)),noscroll:"",noclose:""},{content:vue.withCtx(()=>[Vg.value?(vue.openBlock(),vue.createBlock(BA,{key:0,color:"warning"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Vg.value),1)]),_:1})):vue.createCommentVNode("",!0),Xg.value?(vue.openBlock(),vue.createBlock(BA,{key:1,color:"danger"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Xg.value),1)]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(n0,{gridTemplateColumns:eA.value?"repeat(auto-fill, minmax(50%, 1fr))":"repeat(auto-fill, minmax(100%, 1fr))"},{default:vue.withCtx(()=>{var IA,KA;return[ps.isAddCameraOption&&!((IA=II.value)!=null&&IA.uploadedFile)?(vue.openBlock(),vue.createBlock(w0,{key:0},{default:vue.withCtx(()=>[_g.value?(vue.openBlock(),vue.createBlock(f0,{key:0,modelValue:Kg.value,"onUpdate:modelValue":gA[4]||(gA[4]=RA=>Kg.value=RA),onOnCamera:lI,onOnStarted:gA[5]||(gA[5]=RA=>fI(tI.value)),onOnCapture:gA[6]||(gA[6]=RA=>BI(tI.value))},null,8,["modelValue"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0),eA.value&&((KA=II.value)!=null&&KA.uploadedFile)?(vue.openBlock(),vue.createBlock(w0,{key:1},{default:vue.withCtx(()=>[vue.createVNode(YA,{active:il.value,type:"dot-windmill",size:"medium",width:"100%",height:"100%"},{"waited-content":vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$G,[vue.createVNode(a0,{class:"column is-12"},{default:vue.withCtx(()=>[vue.createVNode(tA,{columnGap:"10px"},{content:vue.withCtx(()=>[vue.createVNode(HC,{color:"primary",bold:"",raised:"",onClick:CC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.crop")),1)]),_:1}),vue.createVNode(HC,{color:"primary",bold:"",raised:"",outlined:"",onClick:VC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.cancel")),1)]),_:1}),vue.createVNode(WC,{icon:"lnir lnir-full-screen",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.maximize"),onClick:sC},null,8,["vtippy"]),vue.createVNode(WC,{icon:"cil:center-focus",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.moveCenter"),onClick:wC},null,8,["vtippy"]),vue.createVNode(WC,{icon:"fluent:auto-fit-height-20-regular",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.extendToHeight"),onClick:gA[7]||(gA[7]=RA=>SC(1,2))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"mdi:flip-vertical",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.flipVertical"),onClick:gA[8]||(gA[8]=RA=>gC(!1,!0))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"mdi:flip-horizontal",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.flipHorizontal"),onClick:gA[9]||(gA[9]=RA=>gC(!0,!1))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"lnir lnir-rotate",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.rotateRight"),onClick:gA[10]||(gA[10]=RA=>YC(90))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"feather:rotate-ccw",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.rotateLeft2Deg"),onClick:gA[11]||(gA[11]=RA=>YC(-2))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"feather:rotate-cw",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.rotateRight2Deg"),onClick:gA[12]||(gA[12]=RA=>YC(2))},null,8,["vtippy"]),ps.isOCRRequired?(vue.openBlock(),vue.createBlock(WC,{key:0,icon:"mdi:ocr",color:"success","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.seeOCR"),onClick:gA[13]||(gA[13]=RA=>_A())},null,8,["vtippy"])):vue.createCommentVNode("",!0),lA.value&&$g.value!==1?(vue.openBlock(),vue.createBlock(WC,{key:1,icon:"mdi:page-previous",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.previousPage"),onClick:uC},null,8,["vtippy"])):vue.createCommentVNode("",!0),lA.value&&$g.value!==Qg.value?(vue.openBlock(),vue.createBlock(WC,{key:2,icon:"mdi:page-next",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.nextPage"),onClick:lC},null,8,["vtippy"])):vue.createCommentVNode("",!0)]),_:1})]),_:1})]),!Tg.value&&!eI.value?(vue.openBlock(),vue.createBlock(vue.unref(fe$2),{key:0,ref_key:"croppedImg",ref:Lg,class:"upload-cropper",src:Fg.value,"min-height":100,"min-width":100,onReady:ZC,"stencil-props":{handlersClasses:{default:"handler",hover:"handler--hover",eastNorth:"handler--east-north",north:"handler--north",westNorth:"handler--west-north",west:"handler--west",westSouth:"handler--west-south",south:"handler--south",eastSouth:"handler--east-south",east:"handler--ease"}}},null,8,["src"])):vue.createCommentVNode("",!0),Tg.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$v,[ps.OCRType==="SOC"||Yg.value.documentType==="SOC"?(vue.openBlock(),vue.createBlock(rA,{key:0,modelValue:LI.chequeStatementData,"onUpdate:modelValue":gA[14]||(gA[14]=RA=>LI.chequeStatementData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="WWR"||Yg.value.documentType==="WWR"?(vue.openBlock(),vue.createBlock(rA,{key:1,modelValue:LI.WWVehicleCertificateData,"onUpdate:modelValue":gA[15]||(gA[15]=RA=>LI.WWVehicleCertificateData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="RCO"||Yg.value.documentType==="RCO"?(vue.openBlock(),vue.createBlock(rA,{key:2,modelValue:LI.ModelJData,"onUpdate:modelValue":gA[16]||(gA[16]=RA=>LI.ModelJData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="CNS"||Yg.value.documentType==="CNS"?(vue.openBlock(),vue.createBlock(rA,{key:3,modelValue:LI.cnssBordereauData,"onUpdate:modelValue":gA[17]||(gA[17]=RA=>LI.cnssBordereauData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="CHQ"||Yg.value.documentType==="CHQ"?(vue.openBlock(),vue.createBlock(rA,{key:4,modelValue:LI.chequeData,"onUpdate:modelValue":gA[18]||(gA[18]=RA=>LI.chequeData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="GRS"||Yg.value.documentType==="GRS"?(vue.openBlock(),vue.createBlock(rA,{key:5,modelValue:LI.registrationData,"onUpdate:modelValue":gA[19]||(gA[19]=RA=>LI.registrationData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="MID"||Yg.value.documentType==="MID"?(vue.openBlock(),vue.createBlock(rA,{key:6,modelValue:LI.identityData,"onUpdate:modelValue":gA[20]||(gA[20]=RA=>LI.identityData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="CDS"||Yg.value.documentType==="CDS"?(vue.openBlock(),vue.createBlock(rA,{key:7,modelValue:LI.cashdepositslipData,"onUpdate:modelValue":gA[21]||(gA[21]=RA=>LI.cashdepositslipData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="TPE"||Yg.value.documentType==="TPE"?(vue.openBlock(),vue.createBlock(rA,{key:8,modelValue:LI.creditCardData,"onUpdate:modelValue":gA[22]||(gA[22]=RA=>LI.creditCardData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="PAS"||Yg.value.documentType==="PAS"?(vue.openBlock(),vue.createBlock(rA,{key:9,modelValue:LI.passportData,"onUpdate:modelValue":gA[23]||(gA[23]=RA=>LI.passportData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="DRV"||Yg.value.documentType==="DRV"?(vue.openBlock(),vue.createBlock(rA,{key:10,modelValue:LI.driverLicenseData,"onUpdate:modelValue":gA[24]||(gA[24]=RA=>LI.driverLicenseData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="MED"||Yg.value.documentType==="MED"?(vue.openBlock(),vue.createBlock(rA,{key:11,modelValue:LI.medicalReportData,"onUpdate:modelValue":gA[25]||(gA[25]=RA=>LI.medicalReportData=RA),"read-only":!0},null,8,["modelValue"])):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0)]),_:1},8,["active"])]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(w0,null,{default:vue.withCtx(()=>{var RA,g0,uA,s0,m0,pA,NA,zA,th;return[!((RA=II.value)!=null&&RA.uploadedFile)&&!_g.value&&!ps.isTwoSidedDocument?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["upload-container",{"drag-over":TI.value}]),onDragover:gA[28]||(gA[28]=vue.withModifiers(ah=>TI.value=!0,["prevent"])),onDragleave:gA[29]||(gA[29]=vue.withModifiers(ah=>TI.value=!1,["prevent"])),onDrop:vue.withModifiers(KI,["prevent"])},[(g0=II.value)!=null&&g0.uploadedFile?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("label",_hoisted_7$s,[_hoisted_8$o,vue.createElementVNode("div",_hoisted_9$k,[vue.createElementVNode("span",_hoisted_10$h,vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadfiledesc")),1)]),vue.createElementVNode("div",_hoisted_11$g,[_hoisted_12$f,vue.createElementVNode("div",_hoisted_13$e,vue.toDisplayString(vue.unref(Gg)("modalmenu.fileortext")),1),_hoisted_14$c]),vue.createElementVNode("div",_hoisted_15$d,[vue.createVNode(a0,{class:"column is-12"},{default:vue.withCtx(()=>[vue.createVNode(tA,{columnGap:"10px"},{content:vue.withCtx(()=>[vue.createVNode(HC,{color:"white",size:"large",onClick:gA[26]||(gA[26]=ah=>uI.value.click())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadfiletext")),1)]),_:1}),ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(HC,{key:0,color:"white",size:"large",onClick:gA[27]||(gA[27]=ah=>oI())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadbycamera")),1)]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1})])])),vue.createElementVNode("input",{ref_key:"fileDLInput",ref:uI,type:"file",onChange:xI,class:"file-input",accept:"application/pdf, image/*",id:"fileDLInput",style:{display:"none"}},null,544)],34)):vue.createCommentVNode("",!0),!((uA=II.value)!=null&&uA.uploadedFile)&&!_g.value&&ps.isTwoSidedDocument?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["upload-container",{"drag-over":TI.value}]),onDragover:gA[30]||(gA[30]=vue.withModifiers(ah=>TI.value=!0,["prevent"])),onDragleave:gA[31]||(gA[31]=vue.withModifiers(ah=>TI.value=!1,["prevent"])),onDrop:vue.withModifiers(KI,["prevent"])},[(s0=II.value)!=null&&s0.uploadedFile?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_16$a,[vue.createElementVNode("div",_hoisted_17$9,[vue.createVNode(a0,{class:"column is-12"},{default:vue.withCtx(()=>[vue.createVNode(tA,{columnGap:"10px"},{content:vue.withCtx(()=>[!Jg.value||!ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:0,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:YI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_18$9,vue.toDisplayString(vue.unref(Gg)("modalmenu.upfrontface")),1),vue.createElementVNode("span",null,[gI.value?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"bw__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:gI.value,style:{"object-fit":"cover","object-position":"30% 70%"}},null,8,_hoisted_19$8)):(vue.openBlock(),vue.createElementBlock("img",_hoisted_20$8))])]),_:1})):vue.createCommentVNode("",!0),vue.createElementVNode("input",{ref_key:"frontInput",ref:GI,id:"front-upload",type:"file",onChange:MI,class:"file-input",accept:"application/pdf, image/*",style:{display:"none"}},null,544),!Jg.value||!ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:1,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:XI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_21$7,vue.toDisplayString(vue.unref(Gg)("modalmenu.upbackface")),1),vue.createElementVNode("span",null,[mI.value?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"bw__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:mI.value,style:{"object-fit":"cover","object-position":"30% 70%"}},null,8,_hoisted_22$7)):(vue.openBlock(),vue.createElementBlock("img",_hoisted_23$7))])]),_:1})):vue.createCommentVNode("",!0),vue.createElementVNode("input",{ref_key:"backInput",ref:AI,id:"back-upload",type:"file",onChange:OI,class:"file-input",accept:"application/pdf, image/*",style:{display:"none"}},null,544),(!Jg.value||!ps.isAddCameraOption)&&!gI.value&&!mI.value?(vue.openBlock(),vue.createBlock(QA,{key:2,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:WI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_24$6,vue.toDisplayString(vue.unref(Gg)("modalmenu.upbothface")),1),vue.createElementVNode("div",_hoisted_25$6,[vue.createVNode(OA,null,{content:vue.withCtx(()=>[_hoisted_26$5,_hoisted_27$4]),_:1})])]),_:1})):vue.createCommentVNode("",!0),vue.createElementVNode("input",{ref_key:"bothInput",ref:RI,id:"both-upload",type:"file",onChange:xI,class:"file-input",accept:"application/pdf, image/*",style:{display:"none"}},null,544),Jg.value&&ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:3,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:JI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_28$4,vue.toDisplayString(vue.unref(Gg)("modalmenu.takefrontface")),1),vue.createElementVNode("span",null,[vue.createElementVNode("img",{class:vue.normalizeClass(gI.value?"bw__image":"bw-scan__image"),loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:gI.value?gI.value:"/@src/assets/illustrations/components/front-of-id-card.svg",style:{"object-fit":"cover","object-position":"30% 70%"}},null,10,_hoisted_29$4)])]),_:1})):vue.createCommentVNode("",!0),Jg.value&&ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:4,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:zI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_30$3,vue.toDisplayString(vue.unref(Gg)("modalmenu.takebackface")),1),vue.createElementVNode("span",null,[vue.createElementVNode("img",{class:vue.normalizeClass(mI.value?"bw__image":"bw-scan__image"),loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:mI.value?mI.value:"/@src/assets/illustrations/components/back-of-id-card.svg",style:{"object-fit":"cover","object-position":"30% 70%"}},null,10,_hoisted_31$3)])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1})])]))],34)):vue.createCommentVNode("",!0),ps.isRequiredDocType&&((m0=II.value)!=null&&m0.uploadedFile)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_32$2,[vue.createVNode(a0,{class:"column is-6"},{default:vue.withCtx(()=>{var ah,om,Vm;return[vue.createElementVNode("label",null,[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("form.doctypetext"))+" ",1),_hoisted_33$2]),vue.createVNode(AA,{"is-valid":!((ah=vue.unref(dI).documentType)!=null&&ah.$error)&&((om=Yg.value.documentType)==null?void 0:om.length)>0,"has-error":(Vm=vue.unref(dI).documentType)==null?void 0:Vm.$error,icon:"solar:document-add-outline"},{default:vue.withCtx(()=>{var Lm,Bm,Qm;return[vue.createVNode(TA,{modelValue:Yg.value.documentType,"onUpdate:modelValue":gA[32]||(gA[32]=$0=>Yg.value.documentType=$0),placeholder:"Type of Document",autocomplete:"off",label:"localename",searchable:!1,"track-by":"localename",caret:!0,clear:!1,class:"doc-uploader-mselect",options:(Lm=vI.value)==null?void 0:Lm.sort(($0,Om)=>$0.localename.localeCompare(Om.localename)),disabled:ps.isDisabledOptions&&Yg.value.documentType},{singlelabel:vue.withCtx(({value:$0})=>[vue.createElementVNode("span",_hoisted_34$2,vue.toDisplayString($0.localename),1)]),option:vue.withCtx(({option:$0})=>[vue.createElementVNode("span",_hoisted_35$2,vue.toDisplayString($0.localename),1)]),_:1},8,["modelValue","options","disabled"]),vue.createElementVNode("p",_hoisted_36$2,vue.toDisplayString((Qm=(Bm=vue.unref(dI).documentType)==null?void 0:Bm.$errors[0])==null?void 0:Qm.$message),1)]}),_:1},8,["is-valid","has-error"])]}),_:1})])):vue.createCommentVNode("",!0),(pA=II.value)!=null&&pA.uploadedFile&&ps.showPreview?(vue.openBlock(),vue.createElementBlock("div",_hoisted_37$2,[FI.value!==100?(vue.openBlock(),vue.createElementBlock("div",_hoisted_38$2,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_39$2,[_hoisted_40$2,vue.createElementVNode("circle",{class:"progress-ring__circle progress-ring__circle--progress",stroke:"#042464","stroke-width":"4",fill:"transparent",r:"26",cx:"30",cy:"30","stroke-dasharray":2*Math.PI*26,"stroke-dashoffset":2*Math.PI*26*(1-FI.value/100)},null,8,_hoisted_41$2)])),vue.createElementVNode("div",_hoisted_42$2,vue.toDisplayString(Math.round(FI.value))+"%",1),vue.createElementVNode("div",_hoisted_43$2,[vue.createElementVNode("span",_hoisted_44$2,vue.toDisplayString(vue.unref(Gg)("modalmenu.fileuploading")),1)])])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"file-preview has-slimscroll",style:vue.normalizeStyle(ps.isCropRequired&&!ps.isRequiredDocType?"margin-top: 125px":"")},[Hg.value?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[ps.OCRType==="CHQ"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"bounding-box",style:vue.normalizeStyle(i0.value((NA=LI.chequeData)==null?void 0:NA.signatureBoundingBox))},null,4)):vue.createCommentVNode("",!0),pC.value?(vue.openBlock(),vue.createElementBlock("img",{key:1,src:Hg.value,alt:"Uploaded image",class:"image-preview",id:"targetImage"},null,8,_hoisted_45$2)):Dg.value?(vue.openBlock(),vue.createElementBlock("img",{key:2,src:Hg.value,alt:"Uploaded image",class:"image-preview",id:"targetImage"},null,8,_hoisted_46$2)):lA.value?(vue.openBlock(),vue.createBlock(GA,{key:3,pdfUrl:eC.uploadedDocument,isEnableOpenNew:!1,isDisplayFooter:!1,isEnableDownload:!1},null,8,["pdfUrl"])):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_47$2,[_hoisted_48$2,vue.createElementVNode("span",_hoisted_49$2,vue.toDisplayString((th=(zA=CI.value)==null?void 0:zA.uploadedFile)==null?void 0:th.name),1)])],4))])):vue.createCommentVNode("",!0)]}),_:1})]}),_:1},8,["gridTemplateColumns"])]),cancel:vue.withCtx(()=>[_hoisted_50$2]),action:vue.withCtx(()=>[_hoisted_51$2]),"icon-toolbar":vue.withCtx(()=>{var IA,KA;return[vue.createElementVNode("div",_hoisted_52$2,[_g.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_53$1,[vue.createVNode(HC,{color:"primary",bold:"",raised:"",outlined:"",onClick:oC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.discard")),1)]),_:1})])):vue.createCommentVNode("",!0),(IA=II.value)!=null&&IA.uploadedFile?(vue.openBlock(),vue.createElementBlock("div",_hoisted_54$1,[vue.createVNode(HC,{color:"primary",bold:"",raised:"",outlined:"",onClick:oC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.discard")),1)]),_:1},8,["class"]),ps.showPreview?(vue.openBlock(),vue.createBlock(HC,{key:0,color:ps.isOCRRequired?"warning":"primary",bold:"",raised:"",onClick:dC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.save")),1)]),_:1},8,["color","class"])):vue.createCommentVNode("",!0),ps.showPreview&&ps.isOCRRequired?(vue.openBlock(),vue.createBlock(HC,{key:1,color:"primary",bold:"",raised:"",onClick:aC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.saveOCR")),1)]),_:1},8,["class"])):lA.value&&!Dg.value&&ps.saveAsPdf?(vue.openBlock(),vue.createBlock(HC,{key:2,color:"primary",bold:"",raised:"",onClick:dC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.savePdf")),1)]),_:1},8,["class"])):pC.value&&!Dg.value?(vue.openBlock(),vue.createBlock(HC,{key:3,color:"primary",bold:"",raised:"",onClick:dC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.saveNoCrop")),1)]),_:1},8,["class"])):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),!((KA=II.value)!=null&&KA.uploadedFile)&&ps.isTwoSidedDocument?(vue.openBlock(),vue.createElementBlock("div",_hoisted_55$1,[(gI.value||mI.value)&&!_g.value?(vue.openBlock(),vue.createBlock(HC,{key:0,color:"primary",bold:"",raised:"",outlined:"",onClick:oC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.discard")),1)]),_:1})):vue.createCommentVNode("",!0),gI.value&&mI.value?(vue.openBlock(),vue.createBlock(HC,{key:1,color:"primary",bold:"",raised:"",onClick:wI},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadfiletext")),1)]),_:1})):vue.createCommentVNode("",!0),!gI.value&&!mI.value&&!_g.value?(vue.openBlock(),vue.createBlock(a0,{key:2,class:"camera-option"},{default:vue.withCtx(()=>[vue.createElementVNode("label",_hoisted_56$1,vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadbycamera")),1),vue.createVNode(AA,{subcontrol:"",class:"mr-2"},{default:vue.withCtx(()=>[vue.createVNode(jC,{color:"success",modelValue:Jg.value,"onUpdate:modelValue":gA[33]||(gA[33]=RA=>Jg.value=RA)},null,8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0)])]}),_:1},8,["open","title"])],64)}}}),_withScopeId$c=ps=>(vue.pushScopeId("data-v-0b071339"),ps=ps(),vue.popScopeId(),ps),_hoisted_1$1q=["onKeydown"],_hoisted_2$1e={ref:"panelFind",class:"panel-body"},_hoisted_3$11={class:"panel-input-b"},_hoisted_4$P=_withScopeId$c(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"search",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-search fa-w-16 fa-sm"},[vue.createElementVNode("path",{fill:"currentColor",d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z",class:""})],-1)),_hoisted_5$F=[_hoisted_4$P],_sfc_main$1H=vue.defineComponent({__name:"NewPanelFind",props:{localizedLabel:{type:Object,default(){return{}}},doFind:{type:Function,default:null}},setup(ps,{expose:Ig}){const Zg=ps,Gg=vue.ref(!1),Bg=vue.ref();vue.ref(!1);const Wg=Vg=>{Vg.target.id==="panelModal"&&Xg()},Ng=(Vg,Fg)=>{Fg&&Fg.preventDefault(),Xg(),Zg.doFind(Bg.value)},Yg=()=>{Gg.value=!0,setTimeout(()=>{var Vg;return(Vg=Bg.value)==null?void 0:Vg.focus()})},Xg=()=>{Gg.value=!1};return vue.onMounted(()=>{console.log("PanelFilter - onMounted")}),Ig({showPanel:Yg,hidePanel:Xg,doFind:Ng,clickOutside:Wg}),(Vg,Fg)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{id:"panelModal",class:"panel-modal",onClick:Wg,onKeydown:vue.withKeys(vue.withModifiers(Xg,["exact"]),["esc"])},[vue.createElementVNode("div",_hoisted_2$1e,[vue.createElementVNode("div",null,[vue.createElementVNode("span",_hoisted_3$11,[vue.withDirectives(vue.createElementVNode("input",{type:"text",ref_key:"inputFind",ref:Bg,"onUpdate:modelValue":Fg[0]||(Fg[0]=Hg=>Bg.value=Hg),class:"panel-input",trim:"",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",onKeydown:Fg[1]||(Fg[1]=vue.withKeys(vue.withModifiers(Hg=>Ng(Bg.value,Hg),["exact"]),["enter"]))},null,544),[[vue.vModelText,Bg.value]])]),vue.createElementVNode("button",{class:"panel-input-button",onClick:Fg[2]||(Fg[2]=Hg=>Zg.doFind(Bg.value))},_hoisted_5$F)])],512)],40,_hoisted_1$1q)),[[vue.vShow,Gg.value]])}}),__unplugin_components_2$1=_export_sfc$1(_sfc_main$1H,[["__scopeId","data-v-0b071339"]]),_withScopeId$b=ps=>(vue.pushScopeId("data-v-4236098f"),ps=ps(),vue.popScopeId(),ps),_hoisted_1$1p=["onKeydown"],_hoisted_2$1d={ref:"panelFilter",class:"panel-body"},_hoisted_3$10={class:"panel-title"},_hoisted_4$O=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sort-amount-down",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-sort-amount-down fa-w-16 fa-1x"},[vue.createElementVNode("path",{fill:"currentColor",d:"M304 416h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-128-64h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.37 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm256-192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-64 128H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM496 32H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",class:""})],-1)),_hoisted_5$E=["innerHTML"],_hoisted_6$u={class:"panel-content"},_hoisted_7$r={class:"panel-action"},_hoisted_8$n=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sort-alpha-down",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:"svg-inline--fa fa-sort-alpha-down fa-w-14"},[vue.createElementVNode("path",{fill:"currentColor",d:"M176 352h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.36 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm240-64H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 446.37V464a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 321.63V304a16 16 0 0 0-16-16zm31.06-85.38l-59.27-160A16 16 0 0 0 372.72 32h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 224h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 224H432a16 16 0 0 0 15.06-21.38zM335.61 144L352 96l16.39 48z",class:""})],-1)),_hoisted_9$j=["innerHTML"],_hoisted_10$g=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sort-alpha-up-alt",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:"svg-inline--fa fa-sort-alpha-up-alt fa-w-14"},[vue.createElementVNode("path",{fill:"currentColor",d:"M16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.38-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160zm272 64h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 65.63V48a16 16 0 0 0-16-16H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 190.37V208a16 16 0 0 0 16 16zm159.06 234.62l-59.27-160A16 16 0 0 0 372.72 288h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 480h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 480H432a16 16 0 0 0 15.06-21.38zM335.61 400L352 352l16.39 48z",class:""})],-1)),_hoisted_11$f=["innerHTML"],_hoisted_12$e={class:"panel-action"},_hoisted_13$d=["innerHTML"],_hoisted_14$b=["innerHTML"],_hoisted_15$c=["innerHTML"],_hoisted_16$9=["innerHTML"],_hoisted_17$8=["innerHTML"],_hoisted_18$8=["innerHTML"],_hoisted_19$7=["innerHTML"],_hoisted_20$7=["innerHTML"],_hoisted_21$6={class:"panel-input-b"},_hoisted_22$6=["placeholder","onKeydown"],_hoisted_23$6=["onClick"],_hoisted_24$5=_withScopeId$b(()=>vue.createElementVNode("input",{type:"checkbox",class:"panel-checkbox"},null,-1)),_hoisted_25$5={key:0,class:"normal-text",style:{float:"right"}},_hoisted_26$4=["innerHTML"],_hoisted_27$3={class:"panel-footer"},_hoisted_28$3=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sign-in-alt",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-sign-in-alt fa-w-16 fa-fw fa-sm"},[vue.createElementVNode("path",{fill:"currentColor",d:"M416 448h-84c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h84c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96zm-47-201L201 79c-15-15-41-4.5-41 17v96H24c-13.3 0-24 10.7-24 24v96c0 13.3 10.7 24 24 24h136v96c0 21.5 26 32 41 17l168-168c9.3-9.4 9.3-24.6 0-34z",class:""})],-1)),_hoisted_29$3=["innerHTML"],_sfc_main$1G=vue.defineComponent({__name:"NewPanelFilter",props:{nFilterCount:{type:Number,default:1e3},fields:{type:Array,default:[]},table:{type:Array,default:[]},sort:{type:Function,default:null},calTable:{type:Function,default:null},localizedLabel:{type:Object,default(){return{sortingAndFiltering:"Sorting And Filtering",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",near:"≒ Near",exactMatch:"= Exact Match",notMatch:"≠ Not Match",greaterThan:"&gt; Greater Than",greaterThanOrEqualTo:"≥ Greater Than or Equal To",lessThan:"&lt; Less Than",lessThanOrEqualTo:"≤ Less Than Or Equal To",regularExpression:"~ Regular Expression",customFilter:"Custom Filter",listFirstNValuesOnly:ps=>`List first ${ps} values only`,apply:"Apply"}}}},setup(ps,{expose:Ig}){const Zg=ps,Gg=vue.ref(!1),Bg=vue.ref(!1);vue.ref(!1);const Wg=vue.ref(),Ng=vue.ref(),Yg=vue.ref(),Xg=vue.ref(),Vg=vue.ref(""),Fg=vue.ref([]),Hg=vue.computed(()=>{var aI,oI,lI,fI;console.log("filteredSortedUniqueValueList:",(aI=Ng.value)==null?void 0:aI.value,Ng.value,Fg.value);const tI=(lI=(oI=Ng.value)==null?void 0:oI.value)==null?void 0:lI.toUpperCase();return(fI=Fg.value)==null?void 0:fI.filter(BI=>BI.toUpperCase().startsWith(tI))}),Lg=vue.computed(()=>{switch(Vg.value){case"":return"≒";case"<=":return"≤";case">=":return"≥";case"<>":return"≠";default:return Vg.value}}),Dg=()=>{Gg.value=!1,_g(),setTimeout(()=>{Fg.value=[]},0)},Jg=tI=>{tI.target.id==="panelModal"&&Dg()},$g=tI=>{var aI;Dg(),Zg.sort(tI,(aI=Wg.value)==null?void 0:aI.colPos)},Qg=tI=>{var aI;Bg.value=!1,Vg.value=tI,(aI=Ng.value)==null||aI.focus()},Kg=()=>{const tI=Yg.value,aI=tI.getBoundingClientRect();tI.setAttribute("style",`width:${aI.width}px; height:${aI.height}px;`)},_g=()=>{Yg.value.removeAttribute("style")},il=()=>{Xg.value&&clearTimeout(Xg.value),Xg.value=setTimeout(()=>{var tI;Ng.value.value=(tI=Ng.value)==null?void 0:tI.value},200)},Tg=()=>{var aI,oI;const tI=Vg.value+((aI=Ng.value)==null?void 0:aI.value);Wg.value.textContent=tI,(oI=Wg.value)==null||oI.$emit("update:modelValue",tI),Dg()},eI=tI=>{Wg.value.textContent="="+tI,Wg.value.$emit("update:modelValue","="+tI),Dg()},iI=(tI,aI)=>{var oI,lI,fI;Wg.value=tI,console.log("ShowPanel - Filter:",Wg.value,aI),Vg.value="",Fg.value=[],Ng.value.value="",Wg.value&&((lI=(oI=Wg.value)==null?void 0:oI.textContent)==null?void 0:lI.trim())!==""&&(Wg.value.textContent="",(fI=Wg.value)==null||fI.$emit("update:modelValue",""),Zg.calTable()),setTimeout(()=>{var gI,bI;Gg.value=!0,setTimeout(()=>{var mI;return(mI=Ng.value)==null?void 0:mI.focus()});const BI={};let vI="";console.log("props.fields:",Zg.fields,aI),((gI=Zg.fields)==null?void 0:gI.length)>0&&(vI=(bI=Zg.fields[aI])==null?void 0:bI.name),Zg.table.forEach(mI=>BI[mI[vI]]=!0);const pI=Object.keys(BI);pI.sort(),pI.length>0&&pI[0]===""&&(pI[0]=" "),Fg.value=pI,setTimeout(()=>Kg())})};return vue.onMounted(()=>{console.log("PanelFilter - onMounted")}),Ig({showPanel:iI,hidePanel:Dg,filterPanelSelect:eI,clickOutside:Jg,doFilter:Tg,doInputFilter:il,removePanelSizeAfterHide:_g,setFilterCondition:Qg,sort:$g,freezePanelSizeAfterShown:Kg}),(tI,aI)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{id:"panelModal",class:"panel-modal",onClick:Jg,onKeydown:vue.withKeys(vue.withModifiers(Dg,["exact"]),["esc"])},[vue.createElementVNode("div",_hoisted_2$1d,[vue.createElementVNode("div",_hoisted_3$10,[_hoisted_4$O,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.sortingAndFiltering},null,8,_hoisted_5$E)]),vue.createElementVNode("div",_hoisted_6$u,[vue.createElementVNode("div",_hoisted_7$r,[vue.createElementVNode("button",{class:"panel-button float-left",onClick:aI[0]||(aI[0]=oI=>$g(1))},[_hoisted_8$n,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.sortAscending},null,8,_hoisted_9$j)]),vue.createElementVNode("button",{class:"panel-button float-right",onClick:aI[1]||(aI[1]=oI=>$g(-1))},[_hoisted_10$g,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.sortDescending},null,8,_hoisted_11$f)])]),vue.createElementVNode("div",_hoisted_12$e,[vue.createElementVNode("div",null,[vue.createElementVNode("button",{class:"panel-input-button",onClick:aI[2]||(aI[2]=oI=>Bg.value=!Bg.value)},vue.toDisplayString(Lg.value),1),vue.createElementVNode("div",{class:vue.normalizeClass([{show:Bg.value},"panel-dropdown"])},[vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[3]||(aI[3]=vue.withModifiers(oI=>Qg(""),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.near},null,8,_hoisted_13$d)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[4]||(aI[4]=vue.withModifiers(oI=>Qg("="),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.exactMatch},null,8,_hoisted_14$b)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[5]||(aI[5]=vue.withModifiers(oI=>Qg("<>"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.notMatch},null,8,_hoisted_15$c)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[6]||(aI[6]=vue.withModifiers(oI=>Qg(">"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.greaterThan},null,8,_hoisted_16$9)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[7]||(aI[7]=vue.withModifiers(oI=>Qg(">="),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.greaterThanOrEqualTo},null,8,_hoisted_17$8)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[8]||(aI[8]=vue.withModifiers(oI=>Qg("<"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.lessThan},null,8,_hoisted_18$8)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[9]||(aI[9]=vue.withModifiers(oI=>Qg("<="),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.lessThanOrEqualTo},null,8,_hoisted_19$7)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[10]||(aI[10]=vue.withModifiers(oI=>Qg("~"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.regularExpression},null,8,_hoisted_20$7)])],2),vue.createElementVNode("span",_hoisted_21$6,[vue.createElementVNode("input",{type:"text",ref_key:"inputFilter",ref:Ng,class:"panel-input",placeholder:ps.localizedLabel.customFilter,trim:"",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",onKeyup:il,onKeydown:vue.withKeys(vue.withModifiers(Tg,["exact"]),["enter"])},null,40,_hoisted_22$6)])])]),vue.createElementVNode("div",null,[vue.createElementVNode("div",{ref_key:"panelList",ref:Yg,class:"panel-list"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Hg.value.slice(0,ps.nFilterCount),(oI,lI)=>(vue.openBlock(),vue.createElementBlock("div",{key:lI,class:"panel-list-item",onClick:vue.withModifiers(fI=>eI(oI),["prevent"])},[_hoisted_24$5,vue.createElementVNode("span",null,vue.toDisplayString(oI),1)],8,_hoisted_23$6))),128))],512),Hg.value.length>ps.nFilterCount?(vue.openBlock(),vue.createElementBlock("div",_hoisted_25$5,[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.listFirstNValuesOnly(ps.nFilterCount)},null,8,_hoisted_26$4)])):vue.createCommentVNode("",!0)])]),vue.createElementVNode("div",_hoisted_27$3,[vue.createElementVNode("button",{class:"panel-button",onClick:Tg},[_hoisted_28$3,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.apply},null,8,_hoisted_29$3)])])],512)],40,_hoisted_1$1p)),[[vue.vShow,Gg.value]])}}),__unplugin_components_1=_export_sfc$1(_sfc_main$1G,[["__scopeId","data-v-4236098f"]]),_hoisted_1$1o=["id","colspan","onKeydown","onKeyup"],_sfc_main$1F=vue.defineComponent({__name:"NewVueExcelFilter",props:{modelValue:{type:String,default:""},interactive:{type:Boolean,default:!1},colspan:{type:[String,Number],default:1},class:{type:[String,Object],default:null},style:{type:[String,Object],default:null},panelFilter:{type:Function,default:null}},emits:["update:modelValue","show-panel-filter","set-focus"],setup(ps,{emit:Ig}){const Zg=vue.useAttrs(),Gg=ps,Bg=Ig,Wg=vue.ref(""),Ng=vue.ref(null),Yg=vue.ref(null),Xg=vue.ref(null),Vg=vue.ref(0),Fg=vue.ref(),Hg=vue.computed(()=>Gg.class),Lg=vue.computed(()=>Gg.style),Dg=vue.computed(()=>({...Zg,input:$g}));vue.computed(()=>({})),vue.watch(()=>Gg.modelValue,oI=>{var lI,fI;console.log("props.modelValue has changed:",oI,(lI=Ng.value)==null?void 0:lI.textContent),oI!==((fI=Ng.value)==null?void 0:fI.textContent)&&Ng.value&&(Ng.value.textContent=oI)}),vue.onMounted(()=>{var oI,lI,fI;Wg.value=`uid${Math.random().toString(36).substr(2,9)}`,Ng.value&&(Ng.value.textContent=Gg.modelValue,Yg.value=Ng.value.parentElement,Xg.value=(oI=Yg.value)==null?void 0:oI.parentElement,Vg.value=Array.from(((lI=Yg.value)==null?void 0:lI.children)||[]).indexOf(Ng.value)-1,Fg.value=(fI=Xg.value)==null?void 0:fI.children[0].children[Vg.value+1])});const Jg=oI=>{const lI=oI.target.textContent;Gg.modelValue!==lI&&Bg("update:modelValue",lI)},$g=oI=>{Gg.interactive&&Jg(oI)},Qg=()=>{setTimeout(()=>{var oI;(oI=Fg.value)==null||oI.classList.add("focus"),Kg(Ng.value),Bg("set-focus",{currentColPos:Vg.value,currentRowPos:-1,classList:"focus"})},0)},Kg=oI=>{if(oI){const lI=window.getSelection();if(lI){const fI=document.createRange();fI.selectNodeContents(oI),lI==null||lI.removeAllRanges(),lI==null||lI.addRange(fI)}}},_g=oI=>{var lI;Jg(oI),(lI=Fg.value)==null||lI.classList.remove("focus"),oI.target.classList.remove("edit")},il=oI=>{const lI=document.getSelection();if((lI==null?void 0:lI.toString())===oI.target.textContent||(lI==null?void 0:lI.focusOffset)===0){let fI=oI.target.previousElementSibling;for(;fI&&fI.style.display==="none";)fI=fI.previousElementSibling;fI==null||fI.focus()}},Tg=oI=>{var fI;const lI=document.getSelection();if((lI==null?void 0:lI.toString())===oI.target.textContent||(lI==null?void 0:lI.focusOffset)===((fI=oI.target.textContent)==null?void 0:fI.length)){let BI=oI.target.nextElementSibling;for(;BI&&BI.style.display==="none";)BI=BI.nextElementSibling;BI==null||BI.focus()}},eI=oI=>{oI.preventDefault(),Kg(Ng.value),Jg(oI)},iI=oI=>{oI.target.textContent===""&&setTimeout(()=>Jg(oI),0)},tI=oI=>{Ng.value&&(Ng.value.style.cursor=Ng.value.offsetWidth-oI.offsetX<15?"pointer":"text")},aI=oI=>{oI.button===0&&Ng.value&&Ng.value.offsetWidth-oI.offsetX<15&&(oI.preventDefault(),setTimeout(()=>{console.log("show-panel-filter:",Ng.value),Bg("show-panel-filter",Vg.value)},0))};return(oI,lI)=>(vue.openBlock(),vue.createElementBlock("td",vue.mergeProps({id:Wg.value,ref_key:"cell",ref:Ng,contenteditable:"",onDragenter:lI[0]||(lI[0]=vue.withModifiers(fI=>fI.dataTransfer.dropEffect="none",["prevent"])),onDragover:lI[1]||(lI[1]=vue.withModifiers(fI=>fI.dataTransfer.dropEffect="none",["prevent"])),class:["cell column-filter",Hg.value],style:[{},Lg.value],autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",tabindex:"-1"},vue.toHandlers(Dg.value,!0),{colspan:ps.colspan,onFocus:Qg,onBlur:_g,onKeydown:[vue.withKeys(vue.withModifiers(il,["exact"]),["left"]),vue.withKeys(vue.withModifiers(Tg,["exact"]),["right"]),vue.withKeys(vue.withModifiers(eI,["exact"]),["enter"])],onKeyup:vue.withKeys(vue.withModifiers(iI,["exact"]),["delete"]),onMousemove:tI,onMousedown:aI}),null,16,_hoisted_1$1o))}}),__unplugin_components_0$7=_export_sfc$1(_sfc_main$1F,[["__scopeId","data-v-859576f7"]]);var xlsx$2={exports:{}},cpexcel$1={exports:{}},cpexcel=cpexcel$1.exports,hasRequiredCpexcel;function requireCpexcel(){return hasRequiredCpexcel||(hasRequiredCpexcel=1,function(ps){var Ig={version:"1.14.0"};Ig[437]=function(){for(var Zg=`\0\x07\b
166
+ `}}class mI extends tI{constructor(cI){super(cI,"span")}}class II extends tI{constructor(cI){super(cI,"sub")}}class CI extends tI{constructor(cI){super(cI,"sup")}}class NI extends tI{constructor(cI){super(cI,"ul")}}class dI{static[Fg.$buildXFAObject](cI,rI){if(dI.hasOwnProperty(cI))return dI[cI](rI)}static a(cI){return new aI(cI)}static b(cI){return new oI(cI)}static body(cI){return new lI(cI)}static br(cI){return new fI(cI)}static html(cI){return new BI(cI)}static i(cI){return new vI(cI)}static li(cI){return new pI(cI)}static ol(cI){return new gI(cI)}static p(cI){return new bI(cI)}static span(cI){return new mI(cI)}static sub(cI){return new II(cI)}static sup(cI){return new CI(cI)}static ul(cI){return new NI(cI)}}Yg.XhtmlNamespace=dI},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.UnknownNamespace=void 0;var Vg=Xg(77),Fg=Xg(75);class Hg{constructor(Dg){this.namespaceId=Dg}[Vg.$buildXFAObject](Dg,Jg){return new Fg.XmlObject(this.namespaceId,Dg,Jg)}}Yg.UnknownNamespace=Hg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.DatasetReader=void 0;var Vg=Xg(2),Fg=Xg(3),Hg=Xg(64);function Lg($g){try{return(0,Vg.stringToUTF8String)($g)}catch(Qg){return(0,Vg.warn)(`UTF-8 decoding failed: "${Qg}".`),$g}}class Dg extends Hg.SimpleXMLParser{constructor(Qg){super(Qg),this.node=null}onEndElement(Qg){const Kg=super.onEndElement(Qg);if(Kg&&Qg==="xfa:datasets")throw this.node=Kg,new Error("Aborting DatasetXMLParser.")}}class Jg{constructor(Qg){if(Qg.datasets)this.node=new Hg.SimpleXMLParser({hasAttributes:!0}).parseFromString(Qg.datasets).documentElement;else{const Kg=new Dg({hasAttributes:!0});try{Kg.parseFromString(Qg["xdp:xdp"])}catch{}this.node=Kg.node}}getValue(Qg){if(!this.node||!Qg)return"";const Kg=this.node.searchNode((0,Fg.parseXFAPath)(Qg),0);if(!Kg)return"";const _g=Kg.firstChild;return _g&&_g.nodeName==="value"?Kg.children.map(il=>Lg(il.textContent)):Lg(Kg.textContent)}}Yg.DatasetReader=Jg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.XRef=void 0;var Vg=Xg(2),Fg=Xg(4),Hg=Xg(15),Lg=Xg(3),Dg=Xg(5),Jg=Xg(65);class $g{constructor(Kg,_g){this.stream=Kg,this.pdfManager=_g,this.entries=[],this.xrefstms=Object.create(null),this._cacheMap=new Map,this._pendingRefs=new Fg.RefSet,this._newPersistentRefNum=null,this._newTemporaryRefNum=null}getNewPersistentRef(Kg){this._newPersistentRefNum===null&&(this._newPersistentRefNum=this.entries.length||1);const _g=this._newPersistentRefNum++;return this._cacheMap.set(_g,Kg),Fg.Ref.get(_g,0)}getNewTemporaryRef(){return this._newTemporaryRefNum===null&&(this._newTemporaryRefNum=this.entries.length||1),Fg.Ref.get(this._newTemporaryRefNum++,0)}resetNewTemporaryRef(){this._newTemporaryRefNum=null}setStartXRef(Kg){this.startXRefQueue=[Kg]}parse(Kg=!1){let _g;Kg?((0,Vg.warn)("Indexing all PDF objects"),_g=this.indexObjects()):_g=this.readXRef(),_g.assignXref(this),this.trailer=_g;let il;try{il=_g.get("Encrypt")}catch(eI){if(eI instanceof Lg.MissingDataException)throw eI;(0,Vg.warn)(`XRef.parse - Invalid "Encrypt" reference: "${eI}".`)}if(il instanceof Fg.Dict){const eI=_g.get("ID"),iI=eI&&eI.length?eI[0]:"";il.suppressEncryption=!0,this.encrypt=new Jg.CipherTransformFactory(il,iI,this.pdfManager.password)}let Tg;try{Tg=_g.get("Root")}catch(eI){if(eI instanceof Lg.MissingDataException)throw eI;(0,Vg.warn)(`XRef.parse - Invalid "Root" reference: "${eI}".`)}if(Tg instanceof Fg.Dict)try{if(Tg.get("Pages")instanceof Fg.Dict){this.root=Tg;return}}catch(eI){if(eI instanceof Lg.MissingDataException)throw eI;(0,Vg.warn)(`XRef.parse - Invalid "Pages" reference: "${eI}".`)}throw Kg?new Vg.InvalidPDFException("Invalid Root reference."):new Lg.XRefParseException}processXRefTable(Kg){"tableState"in this||(this.tableState={entryNum:0,streamPos:Kg.lexer.stream.pos,parserBuf1:Kg.buf1,parserBuf2:Kg.buf2});const _g=this.readXRefTable(Kg);if(!(0,Fg.isCmd)(_g,"trailer"))throw new Vg.FormatError("Invalid XRef table: could not find trailer dictionary");let il=Kg.getObj();if(!(il instanceof Fg.Dict)&&il.dict&&(il=il.dict),!(il instanceof Fg.Dict))throw new Vg.FormatError("Invalid XRef table: could not parse trailer dictionary");return delete this.tableState,il}readXRefTable(Kg){const _g=Kg.lexer.stream,il=this.tableState;_g.pos=il.streamPos,Kg.buf1=il.parserBuf1,Kg.buf2=il.parserBuf2;let Tg;for(;;){if(!("firstEntryNum"in il)||!("entryCount"in il)){if((0,Fg.isCmd)(Tg=Kg.getObj(),"trailer"))break;il.firstEntryNum=Tg,il.entryCount=Kg.getObj()}let eI=il.firstEntryNum;const iI=il.entryCount;if(!Number.isInteger(eI)||!Number.isInteger(iI))throw new Vg.FormatError("Invalid XRef table: wrong types in subsection header");for(let tI=il.entryNum;tI<iI;tI++){il.streamPos=_g.pos,il.entryNum=tI,il.parserBuf1=Kg.buf1,il.parserBuf2=Kg.buf2;const aI={};aI.offset=Kg.getObj(),aI.gen=Kg.getObj();const oI=Kg.getObj();if(oI instanceof Fg.Cmd)switch(oI.cmd){case"f":aI.free=!0;break;case"n":aI.uncompressed=!0;break}if(!Number.isInteger(aI.offset)||!Number.isInteger(aI.gen)||!(aI.free||aI.uncompressed))throw new Vg.FormatError(`Invalid entry in XRef subsection: ${eI}, ${iI}`);tI===0&&aI.free&&eI===1&&(eI=0),this.entries[tI+eI]||(this.entries[tI+eI]=aI)}il.entryNum=0,il.streamPos=_g.pos,il.parserBuf1=Kg.buf1,il.parserBuf2=Kg.buf2,delete il.firstEntryNum,delete il.entryCount}if(this.entries[0]&&!this.entries[0].free)throw new Vg.FormatError("Invalid XRef table: unexpected first object");return Tg}processXRefStream(Kg){if(!("streamState"in this)){const _g=Kg.dict,il=_g.get("W");let Tg=_g.get("Index");Tg||(Tg=[0,_g.get("Size")]),this.streamState={entryRanges:Tg,byteWidths:il,entryNum:0,streamPos:Kg.pos}}return this.readXRefStream(Kg),delete this.streamState,Kg.dict}readXRefStream(Kg){const _g=this.streamState;Kg.pos=_g.streamPos;const[il,Tg,eI]=_g.byteWidths,iI=_g.entryRanges;for(;iI.length>0;){const[tI,aI]=iI;if(!Number.isInteger(tI)||!Number.isInteger(aI))throw new Vg.FormatError(`Invalid XRef range fields: ${tI}, ${aI}`);if(!Number.isInteger(il)||!Number.isInteger(Tg)||!Number.isInteger(eI))throw new Vg.FormatError(`Invalid XRef entry fields length: ${tI}, ${aI}`);for(let oI=_g.entryNum;oI<aI;++oI){_g.entryNum=oI,_g.streamPos=Kg.pos;let lI=0,fI=0,BI=0;for(let pI=0;pI<il;++pI){const gI=Kg.getByte();if(gI===-1)throw new Vg.FormatError("Invalid XRef byteWidths 'type'.");lI=lI<<8|gI}il===0&&(lI=1);for(let pI=0;pI<Tg;++pI){const gI=Kg.getByte();if(gI===-1)throw new Vg.FormatError("Invalid XRef byteWidths 'offset'.");fI=fI<<8|gI}for(let pI=0;pI<eI;++pI){const gI=Kg.getByte();if(gI===-1)throw new Vg.FormatError("Invalid XRef byteWidths 'generation'.");BI=BI<<8|gI}const vI={};switch(vI.offset=fI,vI.gen=BI,lI){case 0:vI.free=!0;break;case 1:vI.uncompressed=!0;break;case 2:break;default:throw new Vg.FormatError(`Invalid XRef entry type: ${lI}`)}this.entries[tI+oI]||(this.entries[tI+oI]=vI)}_g.entryNum=0,_g.streamPos=Kg.pos,iI.splice(0,2)}}indexObjects(){function tI(GI,AI){let RI="",FI=GI[AI];for(;FI!==10&&FI!==13&&FI!==60&&!(++AI>=GI.length);)RI+=String.fromCharCode(FI),FI=GI[AI];return RI}function aI(GI,AI,RI){const FI=RI.length,TI=GI.length;let HI=0;for(;AI<TI;){let wI=0;for(;wI<FI&&GI[AI+wI]===RI[wI];)++wI;if(wI>=FI)break;AI++,HI++}return HI}const oI=/\b(endobj|\d+\s+\d+\s+obj|xref|trailer)\b/g,lI=/\b(startxref|\d+\s+\d+\s+obj)\b/g,fI=/^(\d+)\s+(\d+)\s+obj\b/,BI=new Uint8Array([116,114,97,105,108,101,114]),vI=new Uint8Array([115,116,97,114,116,120,114,101,102]),pI=new Uint8Array([47,88,82,101,102]);this.entries.length=0,this._cacheMap.clear();const gI=this.stream;gI.pos=0;const bI=gI.getBytes(),mI=(0,Vg.bytesToString)(bI),II=bI.length;let CI=gI.start;const NI=[],dI=[];for(;CI<II;){let GI=bI[CI];if(GI===9||GI===10||GI===13||GI===32){++CI;continue}if(GI===37){do{if(++CI,CI>=II)break;GI=bI[CI]}while(GI!==10&&GI!==13);continue}const AI=tI(bI,CI);let RI;if(AI.startsWith("xref")&&(AI.length===4||/\s/.test(AI[4])))CI+=aI(bI,CI,BI),NI.push(CI),CI+=aI(bI,CI,vI);else if(RI=fI.exec(AI)){const FI=RI[1]|0,TI=RI[2]|0,HI=CI+AI.length;let wI,WI=!1;if(!this.entries[FI])WI=!0;else if(this.entries[FI].gen===TI)try{new Hg.Parser({lexer:new Hg.Lexer(gI.makeSubStream(HI))}).getObj(),WI=!0}catch(zI){zI instanceof Lg.ParserEOFException?(0,Vg.warn)(`indexObjects -- checking object (${AI}): "${zI}".`):WI=!0}WI&&(this.entries[FI]={offset:CI-gI.start,gen:TI,uncompressed:!0}),oI.lastIndex=HI;const xI=oI.exec(mI);xI?(wI=oI.lastIndex+1-CI,xI[1]!=="endobj"&&((0,Vg.warn)(`indexObjects: Found "${xI[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`),wI-=xI[1].length+1)):wI=II-CI;const YI=bI.subarray(CI,CI+wI),JI=aI(YI,0,pI);JI<wI&&YI[JI+5]<64&&(dI.push(CI-gI.start),this.xrefstms[CI-gI.start]=1),CI+=wI}else if(AI.startsWith("trailer")&&(AI.length===7||/\s/.test(AI[7]))){NI.push(CI);const FI=CI+AI.length;let TI;lI.lastIndex=FI;const HI=lI.exec(mI);HI?(TI=lI.lastIndex+1-CI,HI[1]!=="startxref"&&((0,Vg.warn)(`indexObjects: Found "${HI[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`),TI-=HI[1].length+1)):TI=II-CI,CI+=TI}else CI+=AI.length+1}for(const GI of dI)this.startXRefQueue.push(GI),this.readXRef(!0);const hI=[];let cI=!1;for(const GI of NI){gI.pos=GI;const AI=new Hg.Parser({lexer:new Hg.Lexer(gI),xref:this,allowStreams:!0,recoveryMode:!0}),RI=AI.getObj();if(!(0,Fg.isCmd)(RI,"trailer"))continue;const FI=AI.getObj();FI instanceof Fg.Dict&&(hI.push(FI),FI.has("Encrypt")&&(cI=!0))}let rI,uI;for(const GI of[...hI,"genFallback",...hI]){if(GI==="genFallback"){if(!uI)break;this._generationFallback=!0;continue}let AI=!1;try{const RI=GI.get("Root");if(!(RI instanceof Fg.Dict))continue;const FI=RI.get("Pages");if(!(FI instanceof Fg.Dict))continue;const TI=FI.get("Count");Number.isInteger(TI)&&(AI=!0)}catch(RI){uI=RI;continue}if(AI&&(!cI||GI.has("Encrypt"))&&GI.has("ID"))return GI;rI=GI}if(rI)return rI;if(this.topDict)return this.topDict;throw new Vg.InvalidPDFException("Invalid PDF structure.")}readXRef(Kg=!1){const _g=this.stream,il=new Set;for(;this.startXRefQueue.length;){try{const Tg=this.startXRefQueue[0];if(il.has(Tg)){(0,Vg.warn)("readXRef - skipping XRef table since it was already parsed."),this.startXRefQueue.shift();continue}il.add(Tg),_g.pos=Tg+_g.start;const eI=new Hg.Parser({lexer:new Hg.Lexer(_g),xref:this,allowStreams:!0});let iI=eI.getObj(),tI;if((0,Fg.isCmd)(iI,"xref")){if(tI=this.processXRefTable(eI),this.topDict||(this.topDict=tI),iI=tI.get("XRefStm"),Number.isInteger(iI)){const aI=iI;aI in this.xrefstms||(this.xrefstms[aI]=1,this.startXRefQueue.push(aI))}}else if(Number.isInteger(iI)){if(!Number.isInteger(eI.getObj())||!(0,Fg.isCmd)(eI.getObj(),"obj")||!((iI=eI.getObj())instanceof Dg.BaseStream))throw new Vg.FormatError("Invalid XRef stream");if(tI=this.processXRefStream(iI),this.topDict||(this.topDict=tI),!tI)throw new Vg.FormatError("Failed to read XRef stream")}else throw new Vg.FormatError("Invalid XRef stream header");iI=tI.get("Prev"),Number.isInteger(iI)?this.startXRefQueue.push(iI):iI instanceof Fg.Ref&&this.startXRefQueue.push(iI.num)}catch(Tg){if(Tg instanceof Lg.MissingDataException)throw Tg;(0,Vg.info)("(while reading XRef): "+Tg)}this.startXRefQueue.shift()}if(this.topDict)return this.topDict;if(!Kg)throw new Lg.XRefParseException}getEntry(Kg){const _g=this.entries[Kg];return _g&&!_g.free&&_g.offset?_g:null}fetchIfRef(Kg,_g=!1){return Kg instanceof Fg.Ref?this.fetch(Kg,_g):Kg}fetch(Kg,_g=!1){if(!(Kg instanceof Fg.Ref))throw new Error("ref object is not a reference");const il=Kg.num,Tg=this._cacheMap.get(il);if(Tg!==void 0)return Tg instanceof Fg.Dict&&!Tg.objId&&(Tg.objId=Kg.toString()),Tg;let eI=this.getEntry(il);if(eI===null)return this._cacheMap.set(il,eI),eI;if(this._pendingRefs.has(Kg))return this._pendingRefs.remove(Kg),(0,Vg.warn)(`Ignoring circular reference: ${Kg}.`),Fg.CIRCULAR_REF;this._pendingRefs.put(Kg);try{eI.uncompressed?eI=this.fetchUncompressed(Kg,eI,_g):eI=this.fetchCompressed(Kg,eI,_g),this._pendingRefs.remove(Kg)}catch(iI){throw this._pendingRefs.remove(Kg),iI}return eI instanceof Fg.Dict?eI.objId=Kg.toString():eI instanceof Dg.BaseStream&&(eI.dict.objId=Kg.toString()),eI}fetchUncompressed(Kg,_g,il=!1){const Tg=Kg.gen;let eI=Kg.num;if(_g.gen!==Tg){const fI=`Inconsistent generation in XRef: ${Kg}`;if(this._generationFallback&&_g.gen<Tg)return(0,Vg.warn)(fI),this.fetchUncompressed(Fg.Ref.get(eI,_g.gen),_g,il);throw new Lg.XRefEntryException(fI)}const iI=this.stream.makeSubStream(_g.offset+this.stream.start),tI=new Hg.Parser({lexer:new Hg.Lexer(iI),xref:this,allowStreams:!0}),aI=tI.getObj(),oI=tI.getObj(),lI=tI.getObj();if(aI!==eI||oI!==Tg||!(lI instanceof Fg.Cmd))throw new Lg.XRefEntryException(`Bad (uncompressed) XRef entry: ${Kg}`);if(lI.cmd!=="obj"){if(lI.cmd.startsWith("obj")&&(eI=parseInt(lI.cmd.substring(3),10),!Number.isNaN(eI)))return eI;throw new Lg.XRefEntryException(`Bad (uncompressed) XRef entry: ${Kg}`)}return this.encrypt&&!il?_g=tI.getObj(this.encrypt.createCipherTransform(eI,Tg)):_g=tI.getObj(),_g instanceof Dg.BaseStream||this._cacheMap.set(eI,_g),_g}fetchCompressed(Kg,_g,il=!1){const Tg=_g.offset,eI=this.fetch(Fg.Ref.get(Tg,0));if(!(eI instanceof Dg.BaseStream))throw new Vg.FormatError("bad ObjStm stream");const iI=eI.dict.get("First"),tI=eI.dict.get("N");if(!Number.isInteger(iI)||!Number.isInteger(tI))throw new Vg.FormatError("invalid first and n parameters for ObjStm stream");let aI=new Hg.Parser({lexer:new Hg.Lexer(eI),xref:this,allowStreams:!0});const oI=new Array(tI),lI=new Array(tI);for(let vI=0;vI<tI;++vI){const pI=aI.getObj();if(!Number.isInteger(pI))throw new Vg.FormatError(`invalid object number in the ObjStm stream: ${pI}`);const gI=aI.getObj();if(!Number.isInteger(gI))throw new Vg.FormatError(`invalid object offset in the ObjStm stream: ${gI}`);oI[vI]=pI,lI[vI]=gI}const fI=(eI.start||0)+iI,BI=new Array(tI);for(let vI=0;vI<tI;++vI){const pI=vI<tI-1?lI[vI+1]-lI[vI]:void 0;if(pI<0)throw new Vg.FormatError("Invalid offset in the ObjStm stream.");aI=new Hg.Parser({lexer:new Hg.Lexer(eI.makeSubStream(fI+lI[vI],pI,eI.dict)),xref:this,allowStreams:!0});const gI=aI.getObj();if(BI[vI]=gI,gI instanceof Dg.BaseStream)continue;const bI=oI[vI],mI=this.entries[bI];mI&&mI.offset===Tg&&mI.gen===vI&&this._cacheMap.set(bI,gI)}if(_g=BI[_g.gen],_g===void 0)throw new Lg.XRefEntryException(`Bad (compressed) XRef entry: ${Kg}`);return _g}async fetchIfRefAsync(Kg,_g){return Kg instanceof Fg.Ref?this.fetchAsync(Kg,_g):Kg}async fetchAsync(Kg,_g){try{return this.fetch(Kg,_g)}catch(il){if(!(il instanceof Lg.MissingDataException))throw il;return await this.pdfManager.requestRange(il.begin,il.end),this.fetchAsync(Kg,_g)}}getCatalogObj(){return this.root}}Yg.XRef=$g},(Ng,Yg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.isNodeJS=void 0;const Xg=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");Yg.isNodeJS=Xg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.MessageHandler=void 0;var Vg=Xg(2);const Fg={DATA:1,ERROR:2},Hg={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Lg(Jg){switch(Jg instanceof Error||typeof Jg=="object"&&Jg!==null||(0,Vg.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),Jg.name){case"AbortException":return new Vg.AbortException(Jg.message);case"MissingPDFException":return new Vg.MissingPDFException(Jg.message);case"PasswordException":return new Vg.PasswordException(Jg.message,Jg.code);case"UnexpectedResponseException":return new Vg.UnexpectedResponseException(Jg.message,Jg.status);case"UnknownErrorException":return new Vg.UnknownErrorException(Jg.message,Jg.details);default:return new Vg.UnknownErrorException(Jg.message,Jg.toString())}}class Dg{constructor($g,Qg,Kg){this.sourceName=$g,this.targetName=Qg,this.comObj=Kg,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),this._onComObjOnMessage=_g=>{const il=_g.data;if(il.targetName!==this.sourceName)return;if(il.stream){this._processStreamMessage(il);return}if(il.callback){const eI=il.callbackId,iI=this.callbackCapabilities[eI];if(!iI)throw new Error(`Cannot resolve callback ${eI}`);if(delete this.callbackCapabilities[eI],il.callback===Fg.DATA)iI.resolve(il.data);else if(il.callback===Fg.ERROR)iI.reject(Lg(il.reason));else throw new Error("Unexpected callback case");return}const Tg=this.actionHandler[il.action];if(!Tg)throw new Error(`Unknown action from worker: ${il.action}`);if(il.callbackId){const eI=this.sourceName,iI=il.sourceName;new Promise(function(tI){tI(Tg(il.data))}).then(function(tI){Kg.postMessage({sourceName:eI,targetName:iI,callback:Fg.DATA,callbackId:il.callbackId,data:tI})},function(tI){Kg.postMessage({sourceName:eI,targetName:iI,callback:Fg.ERROR,callbackId:il.callbackId,reason:Lg(tI)})});return}if(il.streamId){this._createStreamSink(il);return}Tg(il.data)},Kg.addEventListener("message",this._onComObjOnMessage)}on($g,Qg){const Kg=this.actionHandler;if(Kg[$g])throw new Error(`There is already an actionName called "${$g}"`);Kg[$g]=Qg}send($g,Qg,Kg){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:$g,data:Qg},Kg)}sendWithPromise($g,Qg,Kg){const _g=this.callbackId++,il=(0,Vg.createPromiseCapability)();this.callbackCapabilities[_g]=il;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:$g,callbackId:_g,data:Qg},Kg)}catch(Tg){il.reject(Tg)}return il.promise}sendWithStream($g,Qg,Kg,_g){const il=this.streamId++,Tg=this.sourceName,eI=this.targetName,iI=this.comObj;return new ReadableStream({start:tI=>{const aI=(0,Vg.createPromiseCapability)();return this.streamControllers[il]={controller:tI,startCall:aI,pullCall:null,cancelCall:null,isClosed:!1},iI.postMessage({sourceName:Tg,targetName:eI,action:$g,streamId:il,data:Qg,desiredSize:tI.desiredSize},_g),aI.promise},pull:tI=>{const aI=(0,Vg.createPromiseCapability)();return this.streamControllers[il].pullCall=aI,iI.postMessage({sourceName:Tg,targetName:eI,stream:Hg.PULL,streamId:il,desiredSize:tI.desiredSize}),aI.promise},cancel:tI=>{(0,Vg.assert)(tI instanceof Error,"cancel must have a valid reason");const aI=(0,Vg.createPromiseCapability)();return this.streamControllers[il].cancelCall=aI,this.streamControllers[il].isClosed=!0,iI.postMessage({sourceName:Tg,targetName:eI,stream:Hg.CANCEL,streamId:il,reason:Lg(tI)}),aI.promise}},Kg)}_createStreamSink($g){const Qg=$g.streamId,Kg=this.sourceName,_g=$g.sourceName,il=this.comObj,Tg=this,eI=this.actionHandler[$g.action],iI={enqueue(tI,aI=1,oI){if(this.isCancelled)return;const lI=this.desiredSize;this.desiredSize-=aI,lI>0&&this.desiredSize<=0&&(this.sinkCapability=(0,Vg.createPromiseCapability)(),this.ready=this.sinkCapability.promise),il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.ENQUEUE,streamId:Qg,chunk:tI},oI)},close(){this.isCancelled||(this.isCancelled=!0,il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.CLOSE,streamId:Qg}),delete Tg.streamSinks[Qg])},error(tI){(0,Vg.assert)(tI instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.ERROR,streamId:Qg,reason:Lg(tI)}))},sinkCapability:(0,Vg.createPromiseCapability)(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:$g.desiredSize,ready:null};iI.sinkCapability.resolve(),iI.ready=iI.sinkCapability.promise,this.streamSinks[Qg]=iI,new Promise(function(tI){tI(eI($g.data,iI))}).then(function(){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.START_COMPLETE,streamId:Qg,success:!0})},function(tI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.START_COMPLETE,streamId:Qg,reason:Lg(tI)})})}_processStreamMessage($g){const Qg=$g.streamId,Kg=this.sourceName,_g=$g.sourceName,il=this.comObj,Tg=this.streamControllers[Qg],eI=this.streamSinks[Qg];switch($g.stream){case Hg.START_COMPLETE:$g.success?Tg.startCall.resolve():Tg.startCall.reject(Lg($g.reason));break;case Hg.PULL_COMPLETE:$g.success?Tg.pullCall.resolve():Tg.pullCall.reject(Lg($g.reason));break;case Hg.PULL:if(!eI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.PULL_COMPLETE,streamId:Qg,success:!0});break}eI.desiredSize<=0&&$g.desiredSize>0&&eI.sinkCapability.resolve(),eI.desiredSize=$g.desiredSize,new Promise(function(iI){iI(eI.onPull&&eI.onPull())}).then(function(){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.PULL_COMPLETE,streamId:Qg,success:!0})},function(iI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.PULL_COMPLETE,streamId:Qg,reason:Lg(iI)})});break;case Hg.ENQUEUE:if((0,Vg.assert)(Tg,"enqueue should have stream controller"),Tg.isClosed)break;Tg.controller.enqueue($g.chunk);break;case Hg.CLOSE:if((0,Vg.assert)(Tg,"close should have stream controller"),Tg.isClosed)break;Tg.isClosed=!0,Tg.controller.close(),this._deleteStreamController(Tg,Qg);break;case Hg.ERROR:(0,Vg.assert)(Tg,"error should have stream controller"),Tg.controller.error(Lg($g.reason)),this._deleteStreamController(Tg,Qg);break;case Hg.CANCEL_COMPLETE:$g.success?Tg.cancelCall.resolve():Tg.cancelCall.reject(Lg($g.reason)),this._deleteStreamController(Tg,Qg);break;case Hg.CANCEL:if(!eI)break;new Promise(function(iI){iI(eI.onCancel&&eI.onCancel(Lg($g.reason)))}).then(function(){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.CANCEL_COMPLETE,streamId:Qg,success:!0})},function(iI){il.postMessage({sourceName:Kg,targetName:_g,stream:Hg.CANCEL_COMPLETE,streamId:Qg,reason:Lg(iI)})}),eI.sinkCapability.reject(Lg($g.reason)),eI.isCancelled=!0,delete this.streamSinks[Qg];break;default:throw new Error("Unexpected stream case")}}async _deleteStreamController($g,Qg){await Promise.allSettled([$g.startCall&&$g.startCall.promise,$g.pullCall&&$g.pullCall.promise,$g.cancelCall&&$g.cancelCall.promise]),delete this.streamControllers[Qg]}destroy(){this.comObj.removeEventListener("message",this._onComObjOnMessage)}}Yg.MessageHandler=Dg},(Ng,Yg,Xg)=>{Object.defineProperty(Yg,"__esModule",{value:!0}),Yg.PDFWorkerStream=void 0;var Vg=Xg(2);class Fg{constructor(Jg){this._msgHandler=Jg,this._contentLength=null,this._fullRequestReader=null,this._rangeRequestReaders=[]}getFullReader(){return(0,Vg.assert)(!this._fullRequestReader,"PDFWorkerStream.getFullReader can only be called once."),this._fullRequestReader=new Hg(this._msgHandler),this._fullRequestReader}getRangeReader(Jg,$g){const Qg=new Lg(Jg,$g,this._msgHandler);return this._rangeRequestReaders.push(Qg),Qg}cancelAllRequests(Jg){this._fullRequestReader&&this._fullRequestReader.cancel(Jg);for(const $g of this._rangeRequestReaders.slice(0))$g.cancel(Jg)}}Yg.PDFWorkerStream=Fg;class Hg{constructor(Jg){this._msgHandler=Jg,this.onProgress=null,this._contentLength=null,this._isRangeSupported=!1,this._isStreamingSupported=!1;const $g=this._msgHandler.sendWithStream("GetReader");this._reader=$g.getReader(),this._headersReady=this._msgHandler.sendWithPromise("ReaderHeadersReady").then(Qg=>{this._isStreamingSupported=Qg.isStreamingSupported,this._isRangeSupported=Qg.isRangeSupported,this._contentLength=Qg.contentLength})}get headersReady(){return this._headersReady}get contentLength(){return this._contentLength}get isStreamingSupported(){return this._isStreamingSupported}get isRangeSupported(){return this._isRangeSupported}async read(){const{value:Jg,done:$g}=await this._reader.read();return $g?{value:void 0,done:!0}:{value:Jg.buffer,done:!1}}cancel(Jg){this._reader.cancel(Jg)}}class Lg{constructor(Jg,$g,Qg){this._msgHandler=Qg,this.onProgress=null;const Kg=this._msgHandler.sendWithStream("GetRangeReader",{begin:Jg,end:$g});this._reader=Kg.getReader()}get isStreamingSupported(){return!1}async read(){const{value:Jg,done:$g}=await this._reader.read();return $g?{value:void 0,done:!0}:{value:Jg.buffer,done:!1}}cancel(Jg){this._reader.cancel(Jg)}}}],Gg={};function Bg(Ng){var Yg=Gg[Ng];if(Yg!==void 0)return Yg.exports;var Xg=Gg[Ng]={exports:{}};return Zg[Ng](Xg,Xg.exports,Bg),Xg.exports}Bg.d=(Ng,Yg)=>{for(var Xg in Yg)Bg.o(Yg,Xg)&&!Bg.o(Ng,Xg)&&Object.defineProperty(Ng,Xg,{enumerable:!0,get:Yg[Xg]})},Bg.o=(Ng,Yg)=>Object.prototype.hasOwnProperty.call(Ng,Yg),Bg.r=Ng=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(Ng,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Ng,"__esModule",{value:!0})};var Wg={};return(()=>{var Ng=Wg;Object.defineProperty(Ng,"__esModule",{value:!0}),Object.defineProperty(Ng,"WorkerMessageHandler",{enumerable:!0,get:function(){return Yg.WorkerMessageHandler}});var Yg=Bg(1)})(),Wg})())}(pdf_worker)),pdf_worker.exports}var hasRequiredPdf_worker_entry;function requirePdf_worker_entry(){return hasRequiredPdf_worker_entry||(hasRequiredPdf_worker_entry=1,(typeof window<"u"?window:{}).pdfjsWorker=requirePdf_worker()),pdf_worker_entry}requirePdf_worker_entry();const _hoisted_1$1r={key:0},_hoisted_2$1f=["placeholder"],_hoisted_3$12={key:1,class:"documents-title-cont"},_hoisted_4$Q={class:"doc-title"},_hoisted_5$G={class:"crop-type-cont columns"},_hoisted_6$v={key:1,class:"file-preview has-slimscroll"},_hoisted_7$s={key:0,class:"upload-label"},_hoisted_8$o=vue.createElementVNode("div",{class:"upload-icon"},[vue.createElementVNode("i",{class:"iconify","data-icon":"material-symbols-light:upload-file-outline-rounded"})],-1),_hoisted_9$k={class:"upload-text-cont"},_hoisted_10$h={class:"upload-text"},_hoisted_11$g={class:"or-cont"},_hoisted_12$f=vue.createElementVNode("div",{class:"line"},null,-1),_hoisted_13$e={class:"text"},_hoisted_14$c=vue.createElementVNode("div",{class:"line"},null,-1),_hoisted_15$d={class:"crop-type-cont columns"},_hoisted_16$a={key:0,class:"upload-label"},_hoisted_17$9={class:"crop-type-cont columns"},_hoisted_18$9={class:"bw-title"},_hoisted_19$8=["src"],_hoisted_20$8={key:1,class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_0,style:{"object-fit":"cover","object-position":"30% 70%"}},_hoisted_21$7={class:"bw-title"},_hoisted_22$7=["src"],_hoisted_23$7={key:1,class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_1,style:{"object-fit":"cover","object-position":"30% 70%"}},_hoisted_24$6={class:"bw-title"},_hoisted_25$6={class:"uploader-container"},_hoisted_26$5=vue.createElementVNode("div",{class:"uploader-img-container"},[vue.createElementVNode("img",{class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_0,style:{"object-fit":"cover","object-position":"30% 70%"}})],-1),_hoisted_27$4=vue.createElementVNode("div",{class:"uploader-img-container"},[vue.createElementVNode("img",{class:"bw-scan__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:_imports_1,style:{"object-fit":"cover","object-position":"30% 70%"}})],-1),_hoisted_28$4={class:"bw-title"},_hoisted_29$4=["src"],_hoisted_30$3={class:"bw-title"},_hoisted_31$3=["src"],_hoisted_32$2={key:2,class:"doc-type-cont columns"},_hoisted_33$2=vue.createElementVNode("span",{class:"is-required"},"*",-1),_hoisted_34$2={class:"select-label-text"},_hoisted_35$2={class:"select-label-text"},_hoisted_36$2={class:"help text-danger"},_hoisted_37$2={key:3,class:"file-info-cont"},_hoisted_38$2={key:0,class:"loader-cont"},_hoisted_39$2={class:"progress-ring",width:"60",height:"60"},_hoisted_40$2=vue.createElementVNode("circle",{class:"progress-ring__circle",stroke:"#E5E7EB","stroke-width":"4",fill:"transparent",r:"26",cx:"30",cy:"30"},null,-1),_hoisted_41$2=["stroke-dasharray","stroke-dashoffset"],_hoisted_42$2={class:"progress-text"},_hoisted_43$2={class:"upload-text-cont"},_hoisted_44$2={class:"upload-text"},_hoisted_45$2=["src"],_hoisted_46$2=["src"],_hoisted_47$2={class:"file-text-cont"},_hoisted_48$2=vue.createElementVNode("i",{class:"iconify","data-icon":"eva:file-outline"},null,-1),_hoisted_49$2={class:"file-name-text"},_hoisted_50$2=vue.createElementVNode("p",null,null,-1),_hoisted_51$2=vue.createElementVNode("p",null,null,-1),_hoisted_52$2={class:"icon-toolbar-container"},_hoisted_53$1={key:0,class:"action-button-toolbar"},_hoisted_54$1={key:1,class:"action-button-toolbar"},_hoisted_55$1={key:2,class:"action-button-toolbar"},_hoisted_56$1={class:"camera-option-label"},MAX_FILE_SIZE$1=10*1024*1024,_sfc_main$1I=vue.defineComponent({__name:"V-DocumentLoader",props:{modelValue:{type:Object,required:!1},inputType:{type:String,default:"icon"},icon:{type:String,default:"bytesize:plus"},modaltitle:{type:String,default:"Upload File"},showPreview:{type:Boolean,default:!0},saveAsPdf:{type:Boolean,default:!0},useButtontoOpenModal:{type:Boolean,default:!0},isCropRequired:{type:Boolean,default:!1},isOCRRequired:{type:Boolean,default:!1},OCRType:{type:String,required:!1,default:null},authStore:{type:Object,required:!1},baseURL:{type:String,required:!1,default:""},isRequiredDocType:{type:Boolean,default:!1},isDisabledOptions:{type:Boolean,default:!1},isDisabledComponent:{type:Boolean,default:!1},isAddCameraOption:{type:Boolean,default:!1},isTwoSidedDocument:{type:Boolean,default:!1},isComponentTest:{type:Boolean,default:!1},docTypeOptions:{type:Array,default:[]}},emits:["file-selected","file-selected-with-ocr","close-modal","file-discarded","update:modelValue"],setup(ps,{expose:Ig,emit:Zg}){const{t:Gg,locale:Bg}=useI18n$1(),Wg=ps,Ng=vue.ref(!1),Yg=vue.ref(Wg.modelValue),Xg=vue.ref(""),Vg=vue.ref(""),Fg=vue.ref(),Hg=vue.ref(null),Lg=vue.ref(),Dg=vue.ref(!1),Jg=vue.ref(!1),$g=vue.ref(1),Qg=vue.ref(0);vue.ref();const Kg=vue.ref(),_g=vue.ref(!1),il=vue.ref(!1),Tg=vue.ref(!1),eI=vue.ref(!1),iI=vue.ref(),tI=vue.ref("both"),aI=()=>{const UC=new Date,gA=UC.getFullYear(),AA=String(UC.getMonth()+1).padStart(2,"0"),dA=String(UC.getDate()).padStart(2,"0"),a0=String(UC.getHours()).padStart(2,"0"),o0=String(UC.getMinutes()).padStart(2,"0"),BA=String(UC.getSeconds()).padStart(2,"0"),f0=String(UC.getMilliseconds()).padStart(3,"0");return`IMG_${gA}${AA}${dA}_${a0}${o0}${BA}${f0}.jpeg`},oI=()=>{_g.value=!0,iI.value="Camera will be initializing"},lI=()=>{iI.value="Initializing Camera"},fI=UC=>{UC==="front"?iI.value="Show Front Face to Camera":UC==="back"?iI.value="Show Back Face to Camera":iI.value="Show Document to Camera"},BI=async UC=>{console.log("Captured Image:",Kg.value,UC),iI.value="Crop Image for more accurate text recognition",UC==="front"?(PI(),pI.value=null,gI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},pI.value=HI(Kg.value,aI()),gI.value=URL.createObjectURL(pI.value)):UC==="back"?(PI(),bI.value=null,mI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},bI.value=HI(Kg.value,aI()),mI.value=URL.createObjectURL(bI.value)):IC(HI(Kg.value,aI())),_g.value=!1,tI.value="both",Kg.value=""},vI=vue.computed(()=>{let UC=Wg.docTypeOptions,gA=[];return UC==null||UC.forEach(AA=>{let dA={value:"",localename:""};dA.value=AA.alpha3code,dA.localename=AA.translations[Bg.value],gA==null||gA.push(dA)}),gA}),pI=vue.ref(),gI=vue.ref(),bI=vue.ref(),mI=vue.ref(),II=vue.ref({uploadedFile:null}),CI=vue.ref({uploadedFile:null});vue.ref({uploadedFile:null,docType:null});const NI=vue.computed(()=>({documentType:{required:common.withMessage(Gg("validators.customrequired",{cvalue:Gg("form.doctypetext")}),requiredIf(()=>!!(II.value.uploadedFile&&Wg.isRequiredDocType)))}})),dI=useVuelidate(NI.value,Yg.value),hI=Zg,cI=vue.ref(0),rI=vue.ref(null),uI=vue.ref(null),GI=vue.ref(null),AI=vue.ref(null),RI=vue.ref(null),FI=vue.computed(()=>Math.min(100,Math.max(0,cI.value))),TI=vue.ref(!1),HI=(UC,gA)=>{var w0;const[AA,dA]=UC.split(","),a0=((w0=AA.match(/:(.*?);/))==null?void 0:w0[1])||"image/png",o0=atob(dA),BA=new Uint8Array(o0.length);for(let HC=0;HC<o0.length;HC++)BA[HC]=o0.charCodeAt(HC);const f0=new Blob([BA],{type:a0});return new File([f0],gA,{type:a0})},wI=async UC=>{try{const gA=await QI(pI.value,bI.value),AA=URL.createObjectURL(gA),dA=new File([gA],aI(),{type:"image/jpeg"});PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},console.log("mergeBeforeUpload - Girdi mi ?",dA),AA&&IC(dA)}catch(gA){console.error("Error merging images:",gA)}},WI=async UC=>{tI.value="both",RI.value.click()},xI=UC=>{console.log("handleFileUpload - Girdi mi ?",UC),PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC};const gA=UC.target;gA.files&&gA.files.length>0&&(IC(gA.files[0]),gA.value="")},YI=async UC=>{tI.value="front",GI.value.click()},JI=async UC=>{tI.value="front",_g.value=!0},zI=async UC=>{tI.value="back",_g.value=!0},MI=async UC=>{console.log("handleFrontUpload - Girdi mi ?",UC),PI(),pI.value=null,gI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC};const gA=UC.target;if(gA.files&&gA.files.length>0){pI.value=gA.files[0];const AA=await _I(pI.value);gI.value=URL.createObjectURL(AA),pI.value=AA,gA.value=""}},XI=async UC=>{tI.value="back",AI.value.click()},OI=async UC=>{console.log("handleBackUpload - Girdi mi ?",UC),PI(),bI.value=null,mI.value="",LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC};const gA=UC.target;if(gA.files&&gA.files.length>0){bI.value=gA.files[0];const AA=await _I(bI.value);mI.value=URL.createObjectURL(AA),bI.value=AA,gA.value=""}},KI=UC=>{var gA;console.log("handleDrop - Girdi mi ?",UC),PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Yg.value.ocrresults={...LI},Yg.value.updocument={...eC},TI.value=!1,(gA=UC.dataTransfer)!=null&&gA.files.length&&IC(UC.dataTransfer.files[0])},EI=(UC,gA)=>new Promise((AA,dA)=>{var a0=new FileReader;a0.onload=o0=>{var BA;AA((BA=o0==null?void 0:o0.target)==null?void 0:BA.result)},a0.onerror=dA,a0.readAsDataURL(UC)}),UI=UC=>{let gA=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];for(var AA=1;AA<gA.length;AA++)if(UC<Math.pow(1024,AA))return Math.round(UC/Math.pow(1024,AA-1)*100)/100+gA[AA-1];return UC==null?void 0:UC.toString()};vue.ref();const eC=vue.reactive({uploadedDocument:void 0,uploadedDocumentURL:"",uploadedDocumentData:void 0,uploadedImageURL:"",uploadedImageData:void 0,uploadedBLOB:void 0}),LI=vue.reactive({chequeData:{isRecipientMatu:!1,bankName:"",bankCode:"",bankBranch:"",amountNumeric:0,amountWritten:"",payor:"",accountNo:"",recipient:"",dueDate:"",serialNo:"",micr:"",isSigned:!1,signatureBoundingBox:{left:0,top:0,width:0,height:0},modelNotes:""},identityData:{isNewDesign:!1,isFrontExist:!1,isBackExist:!1,nationalIdNumber:"",firstName:"",lastName:"",fatherName:"",motherName:"",placeOfBirth:"",dateOfBirth:"",address:"",expiryDate:"",serialNumber:"",civilRegistrationNumber:"",secureBarcode:"",sex:"",signatureBoundingBox:{left:0,top:0,width:0,height:0},photoBoundingBox:{left:0,top:0,width:0,height:0},modelNotes:""},registrationData:{isFrontExist:!1,isBackExist:!1,registrationNumber:"",previousRegistrationNumber:"",firstRegistrationDate:"",mcInMoroccoDate:"",mutationDate:"",usage:"",ownerName:"",address:"",expiryDate:"",vehicleMake:"",vehicleType:"",vehicleCategory:"",vehicleModel:"",fuelType:"",chassisNumber:"",numberOfCylinders:0,fiscalPower:0,numberOfSeats:0,ptac:0,emptyWeight:0,ptra:0,restrictions:"",secureBarcode:"",registrationType:"",modelNotes:""},cashdepositslipData:{bankName:"",bankCode:"",agency:"",executedBy:"",accountNumber:"",accountHolder:"",isAccountHolderMatu:!1,reference:"",date:"",valueDate:"",amountInWords:"",bills:[],coins:[],subtotal:0,fees:0,vat:0,netAmount:0,agentSignature:!1,clientSignature:!1,modelNotes:""},creditCardData:{isMerchantMatu:!1,merchantName:"",transactionType:"",transactionDateTime:"",posId:"",tpeLogicalCode:"",cardNumber:"",isLocalCard:!1,cardInfo:"",cardNetwork:"",transactionAmount:0,currency:"",transactionNumber:"",authorizationNumber:"",stan:"",handwrittenText:"",modelNotes:""},passportData:{isBioPageExist:!1,nationality:"",passportNumber:"",ownerPid:"",ownerLastName:"",ownerFirstName:"",birthDate:"",birthPlace:"",sex:"",issueDate:"",expiryDate:"",issuingAuthority:"",passportType:"",mrz:"",photoBoundingBox:{left:0,top:0,width:0,height:0},signatureBoundingBox:{left:0,top:0,width:0,height:0},modelNotes:""},driverLicenseData:{isFrontExist:!1,isBackExist:!1,licenseNumber:"",ownerPid:"",ownerLastName:"",ownerFirstName:"",birthDate:"",birthPlace:"",address:"",issueDate:"",expiryDate:"",issuingAuthority:"",authorizedCategories:[],modelNotes:""},medicalReportData:{postalBarcode:"",eventDate:"",policyNo:"",invoiceNo:"",invoiceDate:"",invoiceAmount:"",courtInfo:{courtName:"",caseNumber:"",summonDate:"",victimName:""},patients:[],modelNotes:""},chequeStatementData:{bankCode:"",bankName:"",clientCode:"",clientName:"",errorCode:null,errorMessage:null,isMatu:!1,modelNotes:{en:"",fr:""},rejectedChecks:[],statementDate:{clearingDate:"",processingDate:"",rejectionDate:""}},WWVehicleCertificateData:{buyerAddress:"",buyerName:"",buyerProfession:"",certificateNumber:"",chassisNumber:"",deliveredBy:"",errorCode:"",errorMessage:"",fiscalPower:null,fuelType:null,issuanceDate:"",modelNotes:{en:"",fr:""},numberOfCylinders:null,ptc:"",registrationNumber:"",sellerName:"",serialNumber:"",vehicleCategory:"",vehicleMake:"",vehicleModel:"",vehicleType:""},ModelJData:{activity:"",branchesAgencies:"",businessOrigin:"",chronologicalNumber:null,companyName:"",companyOrigin:"",courtLocation:"",courtLocationCityCode:null,endDate:"",errorCode:null,errorMessage:null,headquartersAddress:"",headquartersCityCode:null,iceNumber:null,industryCode:"",legalForm:"",managers:[],modelNotes:{en:"",fr:""},rcNumber:"",registrationDate:"",shareCapital:null,startDate:"",tradeName:"",tradeSign:""},cnssBordereauData:{documentType:"",packageType:"",documentTitle:"",issueDate:"",submissionDeadline:"",structuredReference:"",formCode:"",employerName:"",employerAddressLines:[],employerCity:"",affiliateNumber:"",agency:"",declarationMonth:null,declarationYear:null,pageCountDetected:null,hasGeneralSalaryPages:!1,hasEntrantPages:!1,pageSummaries:[],displayedFinalCumulativeTotal:null,salaryLines:[],entrantLines:[],signaturePresent:!1,stampPresent:!1,signaturePlace:"",signatureDate:"",modelNotes:"",errorCode:null,errorMessage:""}}),DI=UC=>{const gA={};for(const AA in UC)if(UC.hasOwnProperty(AA)){const dA=UC[AA];typeof dA=="string"?gA[AA]="":typeof dA=="number"?gA[AA]=0:typeof dA=="boolean"?gA[AA]=!1:Array.isArray(dA)?gA[AA]=[]:typeof dA=="object"&&dA!==null?gA[AA]=DI(dA):gA[AA]=null}return gA},PI=()=>{eC.uploadedDocument="",eC.uploadedDocumentURL="",eC.uploadedDocumentData="",eC.uploadedImageURL="",eC.uploadedImageData="",eC.uploadedBLOB=""};function $I(UC){return new Promise((gA,AA)=>{const dA=new Image,a0=URL.createObjectURL(UC);dA.onload=()=>{URL.revokeObjectURL(a0),gA(dA)},dA.onerror=o0=>{AA(o0)},dA.src=a0})}async function QI(UC,gA){const AA=await $I(UC),dA=await $I(gA),a0=(AA==null?void 0:AA.width)>(dA==null?void 0:dA.width)?AA==null?void 0:AA.width:dA==null?void 0:dA.width,o0=(AA==null?void 0:AA.width)>(dA==null?void 0:dA.width)?AA==null?void 0:AA.height:dA==null?void 0:dA.height,BA=a0*2,f0=o0,w0=document.createElement("canvas");w0.width=BA,w0.height=f0;const HC=w0.getContext("2d");if(!HC)throw new Error("Failed to get 2D context from canvas.");return HC.drawImage(AA,0,0,a0,o0),HC.drawImage(dA,a0,0,a0,o0),new Promise((WC,tA)=>{w0.toBlob(rA=>{rA?WC(rA):tA(new Error("Canvas is empty or couldn't be converted to a Blob."))},"image/jpeg",1)})}const _I=async UC=>{let gA=!!UC.type.startsWith("image/"),AA=UC.type==="application/pdf";return!gA&&!AA?(console.log("Error:",Gg("error.NotAllowedFile")),Xg.value=Gg("error.NotAllowedFile"),null):UC.size>MAX_FILE_SIZE$1?(console.log("Error:",Gg("error.FileSize")),Xg.value=Gg("error.FileSize"),null):AA?await rC(UC):UC},IC=async UC=>{let gA=!!UC.type.startsWith("image/"),AA=UC.type==="application/pdf";if(PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),!gA&&!AA){console.log("Error:",Gg("error.NotAllowedFile")),Xg.value=Gg("error.NotAllowedFile");return}if(UC.size>MAX_FILE_SIZE$1){console.log("Error:",Gg("error.FileSize")),Xg.value=Gg("error.FileSize");return}if(gA){Fg.value=URL.createObjectURL(UC);const dA=await EI(UC);eC.uploadedImageData=dA,eC.uploadedImageURL=Fg.value;const a0=new Blob([UC],{type:UC.type});eC.uploadedBLOB=a0}else if(AA){const dA=await rC(UC);Fg.value=URL.createObjectURL(dA);const a0=await EI(UC);eC.uploadedDocumentData=a0,eC.uploadedDocument=UC;const o0=new Blob([UC],{type:UC.type});eC.uploadedBLOB=o0,eC.uploadedDocumentURL=URL.createObjectURL(o0),console.log("updocuments.uploadedDocument- URL",eC.uploadedDocumentURL)}II.value.uploadedFile=UC,CI.value.uploadedFile=UC,Hg.value=URL.createObjectURL(UC),eC.uploadedDocument=UC,Yg.value.updocument={...eC},GC()};function rC(UC,gA=1){return new Promise((AA,dA)=>{const a0=new FileReader;a0.onload=async()=>{try{console.log("convertPdfToImage - fileReader.onload");const o0=new Uint8Array(a0.result),f0=await pdfExports.getDocument({data:o0}).promise;Qg.value=f0.numPages;const w0=await f0.getPage(gA),WC=w0.getViewport({scale:1.5}),tA=document.createElement("canvas"),rA=tA.getContext("2d");tA.width=WC==null?void 0:WC.width,tA.height=WC==null?void 0:WC.height;const YA={canvasContext:rA,viewport:WC};await w0.render(YA).promise,tA.toBlob(QA=>{if(!QA){dA(new Error("Failed to convert canvas to Blob."));return}const OA=new File([QA],aI(),{type:"image/png"});AA(OA)},"image/png")}catch(o0){dA(o0)}},a0.onerror=o0=>{dA(o0)},a0.readAsArrayBuffer(UC)})}const lC=async()=>{if($g.value<Qg.value){$g.value++;const UC=await rC(II.value.uploadedFile,$g.value);Fg.value=URL.createObjectURL(UC)}},uC=async()=>{if($g.value>1){$g.value--;const UC=await rC(II.value.uploadedFile,$g.value);Fg.value=URL.createObjectURL(UC)}},GC=()=>{cI.value=0,rI.value=setInterval(()=>{cI.value<100?cI.value+=Math.random()*100:cC()},100)},cC=()=>{rI.value!==null&&(clearInterval(rI.value),rI.value=null)},dC=()=>{var UC,gA;if(console.log("save:",{...Yg.value}),eI.value=!0,Wg.isRequiredDocType){if((UC=dI.value)==null||UC.$touch(),(gA=dI.value)!=null&&gA.$invalid)return;hI("file-selected",CI.value),hI("update:modelValue",Yg.value)}else hI("file-selected",CI.value),hI("update:modelValue",Yg.value);Ng.value=!1,gI.value&&URL.revokeObjectURL(gI.value),mI.value&&URL.revokeObjectURL(mI.value),pI.value=null,bI.value=null,gI.value=null,mI.value=null,Dg.value=!1,Vg.value="",Xg.value=""},aC=async()=>{var gA,AA;console.log("saveOCR:",{...Yg.value}),eI.value=!0;let UC=!0;if(Tg.value||await _A().then(()=>{UC=!0}).catch(dA=>{console.log("error -- message:",dA.message,dA),UC=!1,dA.message||(Xg.value=Gg("error.processOCR"))}),UC){if(console.log("isOCRpassed"),Wg.isRequiredDocType){if((gA=dI.value)==null||gA.$touch(),(AA=dI.value)!=null&&AA.$invalid)return;hI("file-selected-with-ocr",CI.value),hI("update:modelValue",Yg.value)}else hI("file-selected-with-ocr",CI.value),hI("update:modelValue",Yg.value);Ng.value=!1,gI.value&&URL.revokeObjectURL(gI.value),mI.value&&URL.revokeObjectURL(mI.value),pI.value=null,bI.value=null,gI.value=null,mI.value=null,Dg.value=!1,Tg.value=!1,Vg.value="",Xg.value=""}},oC=()=>{console.log("discard:",{...Yg.value},Yg.value),II.value.uploadedFile=null,Fg.value&&URL.revokeObjectURL(Fg.value),Fg.value=null,gI.value&&URL.revokeObjectURL(gI.value),mI.value&&URL.revokeObjectURL(mI.value),pI.value=null,bI.value=null,gI.value=null,mI.value=null,Dg.value=!1,_g.value=!1,PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),LI.cnssBordereauData=DI(LI.cnssBordereauData),Yg.value.fileName="",Yg.value.size="",Yg.value.mimeType="",Yg.value.lastModifiedDate="",Yg.value.updocument={...eC},Xg.value="",Vg.value="",hI("file-discarded")},CC=()=>{console.log("onCrop:"),Xg.value="",Vg.value="",Lg.value.getResult().canvas.toBlob(async UC=>{if(UC){console.log("croppedImg.value.getResult():");const AA=`${II.value.uploadedFile.name.replace(/\.[^/.]+$/,"")}_cropped.jpeg`;CI.value.uploadedFile=new File([UC],AA,{type:"image/jpeg"}),Hg.value=URL.createObjectURL(CI.value.uploadedFile);const dA=await EI(CI.value.uploadedFile);eC.uploadedImageData=dA,eC.uploadedImageURL=Hg.value,eC.uploadedDocumentData="",eC.uploadedDocumentURL="",eC.uploadedBLOB="",eC.uploadedDocument=CI.value.uploadedFile,Yg.value.updocument={...eC},Dg.value=!0,Vg.value=Gg("warning.imagecropped"),Wg.showPreview||dC()}})},sC=()=>{var gA,AA;const UC={left:Lg.value.coordinates.left+((gA=Lg.value.coordinates)==null?void 0:gA.width)/2,top:Lg.value.coordinates.top+((AA=Lg.value.coordinates)==null?void 0:AA.height)/2};Lg.value.setCoordinates([({coordinates:dA,imageSize:a0})=>({width:a0==null?void 0:a0.width,height:a0==null?void 0:a0.height}),({coordinates:dA,imageSize:a0})=>({left:UC.left-(dA==null?void 0:dA.width)/2,top:UC.top-(dA==null?void 0:dA.height)/2})])},wC=()=>{Lg.value.setCoordinates(({coordinates:UC,imageSize:gA})=>({left:(gA==null?void 0:gA.width)/2-(UC==null?void 0:UC.width)/2,top:(gA==null?void 0:gA.height)/2-(UC==null?void 0:UC.height)/2}))},SC=(UC=1,gA=1)=>{let AA=null;Lg.value.setCoordinates([({coordinates:dA,imageSize:a0})=>(AA=dA,{width:(dA==null?void 0:dA.width)*UC,height:(dA==null?void 0:dA.height)*gA}),({coordinates:dA,imageSize:a0})=>({left:AA.left+((AA==null?void 0:AA.width)-(dA==null?void 0:dA.width))/2,top:AA.top+((AA==null?void 0:AA.height)-(dA==null?void 0:dA.height))/2})])},gC=(UC,gA)=>{Lg.value.imageTransforms.rotate%180!==0?Lg.value.flip(!UC,!gA):Lg.value.flip(UC,gA)},YC=UC=>{Lg.value.rotate(UC)},FC=()=>{Lg.value&&Lg.value.reset()},ZC=()=>{var UC;console.log("setFullCrop"),Lg.value&&((UC=Lg.value)==null||UC.setCoordinates(({coordinates:gA,imageSize:AA})=>({left:0,top:0,width:AA.width,height:AA.height})))},VC=()=>{FC(),IC(II.value.uploadedFile),Dg.value=!1,Tg.value=!1,Xg.value="",Vg.value=""};vue.onBeforeUnmount(()=>{console.log("onBeforeUnmount:",{...Yg.value},Yg.value),Xg.value="",Vg.value="",PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),cC()}),vue.onMounted(()=>{eI.value=!1,Xg.value="",Vg.value="",Ng.value=!Wg.useButtontoOpenModal,II.value.uploadedFile=null,PI(),LI.chequeData=DI(LI.chequeData),LI.registrationData=DI(LI.registrationData),LI.identityData=DI(LI.identityData),LI.cashdepositslipData=DI(LI.cashdepositslipData),LI.creditCardData=DI(LI.creditCardData),LI.passportData=DI(LI.passportData),LI.driverLicenseData=DI(LI.driverLicenseData),LI.medicalReportData=DI(LI.medicalReportData),LI.chequeStatementData=DI(LI.chequeStatementData),LI.WWVehicleCertificateData=DI(LI.WWVehicleCertificateData),LI.ModelJData=DI(LI.ModelJData),Dg.value=!1,Yg.value.documentType&&(Yg.value.documentDescription=jd.value(vI.value,Yg.value.documentType))}),Ig({discard:oC});const pC=vue.computed(()=>II.value.uploadedFile?II.value.uploadedFile.type.startsWith("image/"):!1),lA=vue.computed(()=>II.value.uploadedFile?II.value.uploadedFile.type==="application/pdf":!1);vue.computed(()=>Wg.icon&&Wg.icon.indexOf(":")!==-1);const eA=vue.computed(()=>Fg.value&&(Wg.isCropRequired||Wg.isOCRRequired)),jd=vue.computed(()=>(UC,gA)=>{for(const AA of UC)if(AA.value===gA)return AA.localename}),qA=UC=>{var AA,dA,a0,o0,BA,f0,w0;let gA=null;return console.log("prepareHeader:",UC),!UC||!((AA=UC==null?void 0:UC.auth)!=null&&AA.token)?Xg.value=Gg("error.auth"):gA={Authorization:"Bearer "+((dA=UC==null?void 0:UC.auth)==null?void 0:dA.token),"X-Custom-Header":"custom-value",locale:(a0=UC==null?void 0:UC.user)==null?void 0:a0.defaultLocale,role_name:(o0=UC==null?void 0:UC.user)==null?void 0:o0.mainRole,sessionId:(BA=UC==null?void 0:UC.auth)==null?void 0:BA.sessionId,timezone:(f0=UC==null?void 0:UC.user)==null?void 0:f0.timezone,requestId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",transactionId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",clientIP:"10.120.2.120",companyId:(w0=UC==null?void 0:UC.user)==null?void 0:w0.companyId,trxType:"TEST"},gA},yA=async(UC,gA,AA={},dA,a0={})=>{const o0=new FormData;o0.append(dA,gA),Object.entries(a0).forEach(([BA,f0])=>{o0.append(BA,f0.toString())});try{const BA=await fetch(UC,{method:"POST",body:o0,headers:{...AA}});if(!BA.ok){Vg.value="";const f0=await BA.json();throw Xg.value=`${f0.message} Status: ${BA.status}`,f0}return BA.json()}catch(BA){throw console.log("Error Message:",BA),Vg.value="",Xg.value=`${BA.message} - Name: ${BA.name}`,BA}},_A=async()=>{var gA,AA,dA,a0,o0,BA,f0,w0,HC,WC,tA,rA,YA,QA,OA,TA,GA,n0,jC,aA,IA,KA,RA,g0;console.log("getOCRResults:",Wg.OCRType,Yg.value.documentType);let UC=null;if(Wg.isComponentTest?UC={Authorization:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzUxMiJ9.eyJzdWIiOiJmYjUxZTdmNS1hMGM3LTRmMTgtYTE0My1hYzI0ZTlhYTdhYTkiLCJwcmFpIjoiOTJlNmFjODYtN2VjYy00Y2ViLWE0NGMtZDY4NDlhOGIyMjMzIiwic2VzcyI6IjVkODUzNmU1LWFhMWMtNGU4OS04NzJmLTcxNGU1YTE2YTczYSIsImF1ZCI6IjIwZDQwZWNhLTE0MjEtNDIxNS1hYzY0LTVlNWQ3MDg5NTRiNSIsImV4cCI6MTc3NTAzNTc4NSwiaWF0IjoxNzc0ODYyOTg1LCJ0bXoiOiIrMDA6MDAifQ.JEPlnUZjSVFP4C5tT_ZP_TVCzX_CKNEs-G_TWJHsmjuxKuArFLrs6x4xtWs5hUDrtFXF6vC2VM7ZUIZsf9l28HJzKkXfgCN6_u4BB3iy2Y92R4tzfINa--EhwkOGnaDaFC22ylZtU6p0TkQMPOMsGWlGfErv7jQvjbzhjDjjmYTZrqdvncGM_zUVTBNnQ5I3ztrSQlrzXvEAsDr6r6_UrGM3dQcRzGRx372nWok_E4n0_X87Fs3xgQg-pIyKPJO2kvMopsqqZLz0VBx2Wxm4wy2_5m4bKvyF7_b7xhVtvZSV_gylxgZnZ-1BOWluaOodOAsXH4Z8b7yECShHz3l2ew","X-Custom-Header":"custom-value",locale:"en",role_name:"ROLE_RESPON_DIRECT",sessionId:"5d8536e5-aa1c-4e89-872f-714e5a16a73a",timezone:"Europe/Istanbul",requestId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",transactionId:"57d2009d-52d9-4143-90ad-2f1d5f4f14b4",clientIP:"10.120.2.120",companyId:"20d40eca-1421-4215-ac64-5e5d708954b5",trxType:"TEST"}:UC=qA(Wg.authStore),Xg.value="",UC){if(console.log("customHeaders----> OK"),!Wg.OCRType&&!Yg.value.documentType)Xg.value=Gg("error.doctype");else if(Wg.OCRType==="CHQ"||Yg.value.documentType==="CHQ"){if(Wg.isRequiredDocType&&((gA=dI.value)==null||gA.$touch(),(AA=dI.value)!=null&&AA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/cheque/file",CI.value.uploadedFile,UC,"check").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.chequeData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="GRS"||Yg.value.documentType==="GRS"){if(Wg.isRequiredDocType&&((dA=dI.value)==null||dA.$touch(),(a0=dI.value)!=null&&a0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/registrationCard/file",CI.value.uploadedFile,UC,"doc").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.registrationData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Yg.value.documentType==="MID"||Wg.OCRType==="MID"){if(Wg.isRequiredDocType&&((o0=dI.value)==null||o0.$touch(),(BA=dI.value)!=null&&BA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/idCard/file",CI.value.uploadedFile,UC,"card").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.identityData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw console.log("OCR Error:",uA.message),il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="CDS"||Yg.value.documentType==="CDS"){if(Wg.isRequiredDocType&&((f0=dI.value)==null||f0.$touch(),(w0=dI.value)!=null&&w0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/cashDeposit/file",CI.value.uploadedFile,UC,"slip").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.cashdepositslipData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="TPE"||Yg.value.documentType==="TPE"){if(Wg.isRequiredDocType&&((HC=dI.value)==null||HC.$touch(),(WC=dI.value)!=null&&WC.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/tpeSlip/file",CI.value.uploadedFile,UC,"tpe").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.creditCardData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw console.log("jsonError",uA),il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="PAS"||Yg.value.documentType==="PAS"){if(Wg.isRequiredDocType&&((tA=dI.value)==null||tA.$touch(),(rA=dI.value)!=null&&rA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/pasaport/file",CI.value.uploadedFile,UC,"passport").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.passportData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="DRV"||Yg.value.documentType==="DRV"){if(Wg.isRequiredDocType&&((YA=dI.value)==null||YA.$touch(),(QA=dI.value)!=null&&QA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/driversLicence/file",CI.value.uploadedFile,UC,"driver").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.driverLicenseData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="MED"||Yg.value.documentType==="MED"){if(Wg.isRequiredDocType&&((OA=dI.value)==null||OA.$touch(),(TA=dI.value)!=null&&TA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/medicalReport/file",CI.value.uploadedFile,UC,"medical").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.medicalReportData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="SOC"||Yg.value.documentType==="SOC"){if(Wg.isRequiredDocType&&((GA=dI.value)==null||GA.$touch(),(n0=dI.value)!=null&&n0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/chequeStatus/file",CI.value.uploadedFile,UC,"statement").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.chequeStatementData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="WWR"||Yg.value.documentType==="WWR"){if(Wg.isRequiredDocType&&((jC=dI.value)==null||jC.$touch(),(aA=dI.value)!=null&&aA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/wwRegistration/file",CI.value.uploadedFile,UC,"wwreg").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.WWVehicleCertificateData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="RCO"||Yg.value.documentType==="RCO"){if(Wg.isRequiredDocType&&((IA=dI.value)==null||IA.$touch(),(KA=dI.value)!=null&&KA.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/modeleJ/file",CI.value.uploadedFile,UC,"modelej").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.ModelJData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}else if(Wg.OCRType==="CNS"||Yg.value.documentType==="CNS"){if(Wg.isRequiredDocType&&((RA=dI.value)==null||RA.$touch(),(g0=dI.value)!=null&&g0.$invalid))return;try{il.value=!0,Vg.value=Gg("warning.OCRisworking"),await yA(Wg.baseURL+"/ai/v1/ocr/cnssBordereau/file",CI.value.uploadedFile,UC,"cnssbordereau").then(uA=>{console.log("OCR Result:",uA),Object.assign(LI.cnssBordereauData,uA),Yg.value.ocrresults={...LI},il.value=!1,Tg.value=!0,Vg.value="",Xg.value=""})}catch(uA){throw il.value=!1,Tg.value=!1,Vg.value="",uA.message?Xg.value=uA.message:Xg.value="OCR process getting error. You can continue by just saving image",new Error(Xg.value)}}}else throw console.log("customHeaders----> NOK"),Xg.value="Control Authorization parameters to access GenAI",new Error(Xg.value)},i0=vue.computed(()=>UC=>{const gA=document.getElementById("targetImage");let AA=0,dA=0,a0=0,o0=0;if(gA){const WC=gA==null?void 0:gA.getBoundingClientRect();AA=WC==null?void 0:WC.width,dA=WC==null?void 0:WC.height,a0=WC.top,o0=WC.left}const BA=(UC==null?void 0:UC.width)*AA,f0=(UC==null?void 0:UC.height)*dA,w0=o0+(UC==null?void 0:UC.left)*AA-240;return{top:`${a0+(UC==null?void 0:UC.top)*dA-80}px`,left:`${w0}px`,width:`${BA}px`,height:`${f0}px`}});return vue.watch(()=>Ng.value,(UC,gA)=>{UC===!1&&hI("close-modal")}),vue.watch(()=>II.value.uploadedFile,(UC,gA)=>{UC&&(Yg.value.fileName=UC==null?void 0:UC.name,Yg.value.mimeType=UC==null?void 0:UC.type,Yg.value.size=UI(UC==null?void 0:UC.size),Yg.value.lastModifiedDate=new Date(UC==null?void 0:UC.lastModified).toISOString(),Yg.value.updocument={...eC},console.log("MetaData - uploadedFile:",Yg.value))}),vue.watch(()=>CI.value.uploadedFile,(UC,gA)=>{UC&&(Yg.value.fileName=UC==null?void 0:UC.name,Yg.value.mimeType=UC==null?void 0:UC.type,Yg.value.size=UI(UC==null?void 0:UC.size),Yg.value.lastModifiedDate=new Date(UC==null?void 0:UC.lastModified).toISOString(),Yg.value.updocument={...eC},console.log("MetaData - Cropped:",Yg.value))}),vue.watch(()=>Yg.value.documentType,(UC,gA)=>{UC&&(Xg.value="",Yg.value.documentDescription=jd.value(vI.value,Yg.value.documentType))}),vue.watch(()=>Jg.value,(UC,gA)=>{console.log("isUseCamera.value has changed:",UC,gA)}),(UC,gA)=>{const AA=BWControl,dA=_sfc_main$29,a0=BWField,o0=_sfc_main$1Q,BA=_sfc_main$1J,f0=_sfc_main$1K,w0=_sfc_main$1N,HC=_sfc_main$29,WC=BWIconWrap,tA=_sfc_main$2c,rA=vue.resolveComponent("json-editor-vue"),YA=BWLoader,QA=_sfc_main$1O,OA=_sfc_main$2c,TA=vue.resolveComponent("Multiselect"),GA=BWPdfViewer,n0=_sfc_main$1R,jC=_sfc_main$1S,aA=BWModal;return vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[ps.inputType==="form"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$1r,[vue.createVNode(a0,null,{default:vue.withCtx(()=>[vue.createElementVNode("label",null,vue.toDisplayString(ps.modaltitle),1),vue.createVNode(a0,{addons:""},{default:vue.withCtx(()=>[vue.createVNode(AA,{expanded:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("input",{"onUpdate:modelValue":gA[0]||(gA[0]=IA=>Yg.value.fileName=IA),type:"text",class:"input",name:"docname",placeholder:ps.modaltitle,autocomplete:"off",disabled:""},null,8,_hoisted_2$1f),[[vue.vModelText,Yg.value.fileName]])]),_:1}),vue.createVNode(AA,null,{default:vue.withCtx(()=>[vue.createVNode(dA,{disabled:ps.isDisabledComponent,color:"success",light:"",onClick:gA[1]||(gA[1]=IA=>Ng.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("Choose File")]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1})])):vue.createCommentVNode("",!0),ps.inputType==="title"?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$12,[vue.createElementVNode("span",_hoisted_4$Q,vue.toDisplayString(ps.modaltitle),1),vue.createVNode(o0,{disabled:ps.isDisabledComponent,class:"upload-button",outlined:"",circle:"",color:"primary",icon:ps.icon,onClick:gA[2]||(gA[2]=IA=>Ng.value=!0)},null,8,["disabled","icon"])])):vue.createCommentVNode("",!0),ps.inputType==="icon"?(vue.openBlock(),vue.createBlock(o0,{key:2,disabled:ps.isDisabledComponent,class:"upload-button",outlined:"",circle:"",color:"primary",icon:ps.icon,onClick:gA[3]||(gA[3]=IA=>Ng.value=!0)},null,8,["disabled","icon"])):vue.createCommentVNode("",!0),vue.createVNode(aA,{open:Ng.value,title:ps.modaltitle,size:"mega",class:vue.normalizeClass("uploader-page-content-inner"),onClose:gA[34]||(gA[34]=IA=>(oC(),Ng.value=!1)),noscroll:"",noclose:""},{content:vue.withCtx(()=>[Vg.value?(vue.openBlock(),vue.createBlock(BA,{key:0,color:"warning"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Vg.value),1)]),_:1})):vue.createCommentVNode("",!0),Xg.value?(vue.openBlock(),vue.createBlock(BA,{key:1,color:"danger"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Xg.value),1)]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(n0,{gridTemplateColumns:eA.value?"repeat(auto-fill, minmax(50%, 1fr))":"repeat(auto-fill, minmax(100%, 1fr))"},{default:vue.withCtx(()=>{var IA,KA;return[ps.isAddCameraOption&&!((IA=II.value)!=null&&IA.uploadedFile)?(vue.openBlock(),vue.createBlock(w0,{key:0},{default:vue.withCtx(()=>[_g.value?(vue.openBlock(),vue.createBlock(f0,{key:0,modelValue:Kg.value,"onUpdate:modelValue":gA[4]||(gA[4]=RA=>Kg.value=RA),onOnCamera:lI,onOnStarted:gA[5]||(gA[5]=RA=>fI(tI.value)),onOnCapture:gA[6]||(gA[6]=RA=>BI(tI.value))},null,8,["modelValue"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0),eA.value&&((KA=II.value)!=null&&KA.uploadedFile)?(vue.openBlock(),vue.createBlock(w0,{key:1},{default:vue.withCtx(()=>[vue.createVNode(YA,{active:il.value,type:"dot-windmill",size:"medium",width:"100%",height:"100%"},{"waited-content":vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_5$G,[vue.createVNode(a0,{class:"column is-12"},{default:vue.withCtx(()=>[vue.createVNode(tA,{columnGap:"10px"},{content:vue.withCtx(()=>[vue.createVNode(HC,{color:"primary",bold:"",raised:"",onClick:CC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.crop")),1)]),_:1}),vue.createVNode(HC,{color:"primary",bold:"",raised:"",outlined:"",onClick:VC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.cancel")),1)]),_:1}),vue.createVNode(WC,{icon:"lnir lnir-full-screen",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.maximize"),onClick:sC},null,8,["vtippy"]),vue.createVNode(WC,{icon:"cil:center-focus",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.moveCenter"),onClick:wC},null,8,["vtippy"]),vue.createVNode(WC,{icon:"fluent:auto-fit-height-20-regular",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.extendToHeight"),onClick:gA[7]||(gA[7]=RA=>SC(1,2))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"mdi:flip-vertical",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.flipVertical"),onClick:gA[8]||(gA[8]=RA=>gC(!1,!0))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"mdi:flip-horizontal",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.flipHorizontal"),onClick:gA[9]||(gA[9]=RA=>gC(!0,!1))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"lnir lnir-rotate",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.rotateRight"),onClick:gA[10]||(gA[10]=RA=>YC(90))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"feather:rotate-ccw",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.rotateLeft2Deg"),onClick:gA[11]||(gA[11]=RA=>YC(-2))},null,8,["vtippy"]),vue.createVNode(WC,{icon:"feather:rotate-cw",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.rotateRight2Deg"),onClick:gA[12]||(gA[12]=RA=>YC(2))},null,8,["vtippy"]),ps.isOCRRequired?(vue.openBlock(),vue.createBlock(WC,{key:0,icon:"mdi:ocr",color:"success","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.seeOCR"),onClick:gA[13]||(gA[13]=RA=>_A())},null,8,["vtippy"])):vue.createCommentVNode("",!0),lA.value&&$g.value!==1?(vue.openBlock(),vue.createBlock(WC,{key:1,icon:"mdi:page-previous",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.previousPage"),onClick:uC},null,8,["vtippy"])):vue.createCommentVNode("",!0),lA.value&&$g.value!==Qg.value?(vue.openBlock(),vue.createBlock(WC,{key:2,icon:"mdi:page-next",color:"primary","rectangle-border":"",vtippy:vue.unref(Gg)("modalmenu.nextPage"),onClick:lC},null,8,["vtippy"])):vue.createCommentVNode("",!0)]),_:1})]),_:1})]),!Tg.value&&!eI.value?(vue.openBlock(),vue.createBlock(vue.unref(fe$2),{key:0,ref_key:"croppedImg",ref:Lg,class:"upload-cropper",src:Fg.value,"min-height":100,"min-width":100,onReady:ZC,"stencil-props":{handlersClasses:{default:"handler",hover:"handler--hover",eastNorth:"handler--east-north",north:"handler--north",westNorth:"handler--west-north",west:"handler--west",westSouth:"handler--west-south",south:"handler--south",eastSouth:"handler--east-south",east:"handler--ease"}}},null,8,["src"])):vue.createCommentVNode("",!0),Tg.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_6$v,[ps.OCRType==="SOC"||Yg.value.documentType==="SOC"?(vue.openBlock(),vue.createBlock(rA,{key:0,modelValue:LI.chequeStatementData,"onUpdate:modelValue":gA[14]||(gA[14]=RA=>LI.chequeStatementData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="WWR"||Yg.value.documentType==="WWR"?(vue.openBlock(),vue.createBlock(rA,{key:1,modelValue:LI.WWVehicleCertificateData,"onUpdate:modelValue":gA[15]||(gA[15]=RA=>LI.WWVehicleCertificateData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="RCO"||Yg.value.documentType==="RCO"?(vue.openBlock(),vue.createBlock(rA,{key:2,modelValue:LI.ModelJData,"onUpdate:modelValue":gA[16]||(gA[16]=RA=>LI.ModelJData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="CNS"||Yg.value.documentType==="CNS"?(vue.openBlock(),vue.createBlock(rA,{key:3,modelValue:LI.cnssBordereauData,"onUpdate:modelValue":gA[17]||(gA[17]=RA=>LI.cnssBordereauData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="CHQ"||Yg.value.documentType==="CHQ"?(vue.openBlock(),vue.createBlock(rA,{key:4,modelValue:LI.chequeData,"onUpdate:modelValue":gA[18]||(gA[18]=RA=>LI.chequeData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="GRS"||Yg.value.documentType==="GRS"?(vue.openBlock(),vue.createBlock(rA,{key:5,modelValue:LI.registrationData,"onUpdate:modelValue":gA[19]||(gA[19]=RA=>LI.registrationData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="MID"||Yg.value.documentType==="MID"?(vue.openBlock(),vue.createBlock(rA,{key:6,modelValue:LI.identityData,"onUpdate:modelValue":gA[20]||(gA[20]=RA=>LI.identityData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="CDS"||Yg.value.documentType==="CDS"?(vue.openBlock(),vue.createBlock(rA,{key:7,modelValue:LI.cashdepositslipData,"onUpdate:modelValue":gA[21]||(gA[21]=RA=>LI.cashdepositslipData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="TPE"||Yg.value.documentType==="TPE"?(vue.openBlock(),vue.createBlock(rA,{key:8,modelValue:LI.creditCardData,"onUpdate:modelValue":gA[22]||(gA[22]=RA=>LI.creditCardData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="PAS"||Yg.value.documentType==="PAS"?(vue.openBlock(),vue.createBlock(rA,{key:9,modelValue:LI.passportData,"onUpdate:modelValue":gA[23]||(gA[23]=RA=>LI.passportData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="DRV"||Yg.value.documentType==="DRV"?(vue.openBlock(),vue.createBlock(rA,{key:10,modelValue:LI.driverLicenseData,"onUpdate:modelValue":gA[24]||(gA[24]=RA=>LI.driverLicenseData=RA),"read-only":!0},null,8,["modelValue"])):ps.OCRType==="MED"||Yg.value.documentType==="MED"?(vue.openBlock(),vue.createBlock(rA,{key:11,modelValue:LI.medicalReportData,"onUpdate:modelValue":gA[25]||(gA[25]=RA=>LI.medicalReportData=RA),"read-only":!0},null,8,["modelValue"])):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0)]),_:1},8,["active"])]),_:1})):vue.createCommentVNode("",!0),vue.createVNode(w0,null,{default:vue.withCtx(()=>{var RA,g0,uA,s0,m0,pA,NA,zA,th;return[!((RA=II.value)!=null&&RA.uploadedFile)&&!_g.value&&!ps.isTwoSidedDocument?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(["upload-container",{"drag-over":TI.value}]),onDragover:gA[28]||(gA[28]=vue.withModifiers(ah=>TI.value=!0,["prevent"])),onDragleave:gA[29]||(gA[29]=vue.withModifiers(ah=>TI.value=!1,["prevent"])),onDrop:vue.withModifiers(KI,["prevent"])},[(g0=II.value)!=null&&g0.uploadedFile?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("label",_hoisted_7$s,[_hoisted_8$o,vue.createElementVNode("div",_hoisted_9$k,[vue.createElementVNode("span",_hoisted_10$h,vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadfiledesc")),1)]),vue.createElementVNode("div",_hoisted_11$g,[_hoisted_12$f,vue.createElementVNode("div",_hoisted_13$e,vue.toDisplayString(vue.unref(Gg)("modalmenu.fileortext")),1),_hoisted_14$c]),vue.createElementVNode("div",_hoisted_15$d,[vue.createVNode(a0,{class:"column is-12"},{default:vue.withCtx(()=>[vue.createVNode(tA,{columnGap:"10px"},{content:vue.withCtx(()=>[vue.createVNode(HC,{color:"white",size:"large",onClick:gA[26]||(gA[26]=ah=>uI.value.click())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadfiletext")),1)]),_:1}),ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(HC,{key:0,color:"white",size:"large",onClick:gA[27]||(gA[27]=ah=>oI())},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadbycamera")),1)]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1})])])),vue.createElementVNode("input",{ref_key:"fileDLInput",ref:uI,type:"file",onChange:xI,class:"file-input",accept:"application/pdf, image/*",id:"fileDLInput",style:{display:"none"}},null,544)],34)):vue.createCommentVNode("",!0),!((uA=II.value)!=null&&uA.uploadedFile)&&!_g.value&&ps.isTwoSidedDocument?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(["upload-container",{"drag-over":TI.value}]),onDragover:gA[30]||(gA[30]=vue.withModifiers(ah=>TI.value=!0,["prevent"])),onDragleave:gA[31]||(gA[31]=vue.withModifiers(ah=>TI.value=!1,["prevent"])),onDrop:vue.withModifiers(KI,["prevent"])},[(s0=II.value)!=null&&s0.uploadedFile?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createElementBlock("div",_hoisted_16$a,[vue.createElementVNode("div",_hoisted_17$9,[vue.createVNode(a0,{class:"column is-12"},{default:vue.withCtx(()=>[vue.createVNode(tA,{columnGap:"10px"},{content:vue.withCtx(()=>[!Jg.value||!ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:0,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:YI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_18$9,vue.toDisplayString(vue.unref(Gg)("modalmenu.upfrontface")),1),vue.createElementVNode("span",null,[gI.value?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"bw__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:gI.value,style:{"object-fit":"cover","object-position":"30% 70%"}},null,8,_hoisted_19$8)):(vue.openBlock(),vue.createElementBlock("img",_hoisted_20$8))])]),_:1})):vue.createCommentVNode("",!0),vue.createElementVNode("input",{ref_key:"frontInput",ref:GI,id:"front-upload",type:"file",onChange:MI,class:"file-input",accept:"application/pdf, image/*",style:{display:"none"}},null,544),!Jg.value||!ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:1,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:XI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_21$7,vue.toDisplayString(vue.unref(Gg)("modalmenu.upbackface")),1),vue.createElementVNode("span",null,[mI.value?(vue.openBlock(),vue.createElementBlock("img",{key:0,class:"bw__image",loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:mI.value,style:{"object-fit":"cover","object-position":"30% 70%"}},null,8,_hoisted_22$7)):(vue.openBlock(),vue.createElementBlock("img",_hoisted_23$7))])]),_:1})):vue.createCommentVNode("",!0),vue.createElementVNode("input",{ref_key:"backInput",ref:AI,id:"back-upload",type:"file",onChange:OI,class:"file-input",accept:"application/pdf, image/*",style:{display:"none"}},null,544),(!Jg.value||!ps.isAddCameraOption)&&!gI.value&&!mI.value?(vue.openBlock(),vue.createBlock(QA,{key:2,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:WI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_24$6,vue.toDisplayString(vue.unref(Gg)("modalmenu.upbothface")),1),vue.createElementVNode("div",_hoisted_25$6,[vue.createVNode(OA,null,{content:vue.withCtx(()=>[_hoisted_26$5,_hoisted_27$4]),_:1})])]),_:1})):vue.createCommentVNode("",!0),vue.createElementVNode("input",{ref_key:"bothInput",ref:RI,id:"both-upload",type:"file",onChange:xI,class:"file-input",accept:"application/pdf, image/*",style:{display:"none"}},null,544),Jg.value&&ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:3,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:JI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_28$4,vue.toDisplayString(vue.unref(Gg)("modalmenu.takefrontface")),1),vue.createElementVNode("span",null,[vue.createElementVNode("img",{class:vue.normalizeClass(gI.value?"bw__image":"bw-scan__image"),loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:gI.value?gI.value:"/@src/assets/illustrations/components/front-of-id-card.svg",style:{"object-fit":"cover","object-position":"30% 70%"}},null,10,_hoisted_29$4)])]),_:1})):vue.createCommentVNode("",!0),Jg.value&&ps.isAddCameraOption?(vue.openBlock(),vue.createBlock(QA,{key:4,radius:"smooth",elevated:"",class:"uploader-vcard",onClick:zI},{default:vue.withCtx(()=>[vue.createElementVNode("span",_hoisted_30$3,vue.toDisplayString(vue.unref(Gg)("modalmenu.takebackface")),1),vue.createElementVNode("span",null,[vue.createElementVNode("img",{class:vue.normalizeClass(mI.value?"bw__image":"bw-scan__image"),loading:"lazy",fetchpriority:"auto","aria-hidden":"true",draggable:"false",src:mI.value?mI.value:"/@src/assets/illustrations/components/back-of-id-card.svg",style:{"object-fit":"cover","object-position":"30% 70%"}},null,10,_hoisted_31$3)])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1})])]))],34)):vue.createCommentVNode("",!0),ps.isRequiredDocType&&((m0=II.value)!=null&&m0.uploadedFile)?(vue.openBlock(),vue.createElementBlock("div",_hoisted_32$2,[vue.createVNode(a0,{class:"column is-6"},{default:vue.withCtx(()=>{var ah,om,Vm;return[vue.createElementVNode("label",null,[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("form.doctypetext"))+" ",1),_hoisted_33$2]),vue.createVNode(AA,{"is-valid":!((ah=vue.unref(dI).documentType)!=null&&ah.$error)&&((om=Yg.value.documentType)==null?void 0:om.length)>0,"has-error":(Vm=vue.unref(dI).documentType)==null?void 0:Vm.$error,icon:"solar:document-add-outline"},{default:vue.withCtx(()=>{var Lm,Bm,Qm;return[vue.createVNode(TA,{modelValue:Yg.value.documentType,"onUpdate:modelValue":gA[32]||(gA[32]=$0=>Yg.value.documentType=$0),placeholder:"Type of Document",autocomplete:"off",label:"localename",searchable:!1,"track-by":"localename",caret:!0,clear:!1,class:"doc-uploader-mselect",options:(Lm=vI.value)==null?void 0:Lm.sort(($0,Om)=>$0.localename.localeCompare(Om.localename)),disabled:ps.isDisabledOptions&&Yg.value.documentType},{singlelabel:vue.withCtx(({value:$0})=>[vue.createElementVNode("span",_hoisted_34$2,vue.toDisplayString($0.localename),1)]),option:vue.withCtx(({option:$0})=>[vue.createElementVNode("span",_hoisted_35$2,vue.toDisplayString($0.localename),1)]),_:1},8,["modelValue","options","disabled"]),vue.createElementVNode("p",_hoisted_36$2,vue.toDisplayString((Qm=(Bm=vue.unref(dI).documentType)==null?void 0:Bm.$errors[0])==null?void 0:Qm.$message),1)]}),_:1},8,["is-valid","has-error"])]}),_:1})])):vue.createCommentVNode("",!0),(pA=II.value)!=null&&pA.uploadedFile&&ps.showPreview?(vue.openBlock(),vue.createElementBlock("div",_hoisted_37$2,[FI.value!==100?(vue.openBlock(),vue.createElementBlock("div",_hoisted_38$2,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_39$2,[_hoisted_40$2,vue.createElementVNode("circle",{class:"progress-ring__circle progress-ring__circle--progress",stroke:"#042464","stroke-width":"4",fill:"transparent",r:"26",cx:"30",cy:"30","stroke-dasharray":2*Math.PI*26,"stroke-dashoffset":2*Math.PI*26*(1-FI.value/100)},null,8,_hoisted_41$2)])),vue.createElementVNode("div",_hoisted_42$2,vue.toDisplayString(Math.round(FI.value))+"%",1),vue.createElementVNode("div",_hoisted_43$2,[vue.createElementVNode("span",_hoisted_44$2,vue.toDisplayString(vue.unref(Gg)("modalmenu.fileuploading")),1)])])):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:"file-preview has-slimscroll",style:vue.normalizeStyle(ps.isCropRequired&&!ps.isRequiredDocType?"margin-top: 125px":"")},[Hg.value?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[ps.OCRType==="CHQ"?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:"bounding-box",style:vue.normalizeStyle(i0.value((NA=LI.chequeData)==null?void 0:NA.signatureBoundingBox))},null,4)):vue.createCommentVNode("",!0),pC.value?(vue.openBlock(),vue.createElementBlock("img",{key:1,src:Hg.value,alt:"Uploaded image",class:"image-preview",id:"targetImage"},null,8,_hoisted_45$2)):Dg.value?(vue.openBlock(),vue.createElementBlock("img",{key:2,src:Hg.value,alt:"Uploaded image",class:"image-preview",id:"targetImage"},null,8,_hoisted_46$2)):lA.value?(vue.openBlock(),vue.createBlock(GA,{key:3,pdfUrl:eC.uploadedDocument,isEnableOpenNew:!1,isDisplayFooter:!1,isEnableDownload:!1},null,8,["pdfUrl"])):vue.createCommentVNode("",!0)],64)):vue.createCommentVNode("",!0),vue.createElementVNode("div",_hoisted_47$2,[_hoisted_48$2,vue.createElementVNode("span",_hoisted_49$2,vue.toDisplayString((th=(zA=CI.value)==null?void 0:zA.uploadedFile)==null?void 0:th.name),1)])],4))])):vue.createCommentVNode("",!0)]}),_:1})]}),_:1},8,["gridTemplateColumns"])]),cancel:vue.withCtx(()=>[_hoisted_50$2]),action:vue.withCtx(()=>[_hoisted_51$2]),"icon-toolbar":vue.withCtx(()=>{var IA,KA;return[vue.createElementVNode("div",_hoisted_52$2,[_g.value?(vue.openBlock(),vue.createElementBlock("div",_hoisted_53$1,[vue.createVNode(HC,{color:"primary",bold:"",raised:"",outlined:"",onClick:oC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.discard")),1)]),_:1})])):vue.createCommentVNode("",!0),(IA=II.value)!=null&&IA.uploadedFile?(vue.openBlock(),vue.createElementBlock("div",_hoisted_54$1,[vue.createVNode(HC,{color:"primary",bold:"",raised:"",outlined:"",onClick:oC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.discard")),1)]),_:1},8,["class"]),ps.showPreview?(vue.openBlock(),vue.createBlock(HC,{key:0,color:ps.isOCRRequired?"warning":"primary",bold:"",raised:"",onClick:dC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.save")),1)]),_:1},8,["color","class"])):vue.createCommentVNode("",!0),ps.showPreview&&ps.isOCRRequired?(vue.openBlock(),vue.createBlock(HC,{key:1,color:"primary",bold:"",raised:"",onClick:aC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.saveOCR")),1)]),_:1},8,["class"])):lA.value&&!Dg.value&&ps.saveAsPdf?(vue.openBlock(),vue.createBlock(HC,{key:2,color:"primary",bold:"",raised:"",onClick:dC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.savePdf")),1)]),_:1},8,["class"])):pC.value&&!Dg.value?(vue.openBlock(),vue.createBlock(HC,{key:3,color:"primary",bold:"",raised:"",onClick:dC,class:vue.normalizeClass([(FI.value!==100||il.value)&&"is-disabled"])},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.saveNoCrop")),1)]),_:1},8,["class"])):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0),!((KA=II.value)!=null&&KA.uploadedFile)&&ps.isTwoSidedDocument?(vue.openBlock(),vue.createElementBlock("div",_hoisted_55$1,[(gI.value||mI.value)&&!_g.value?(vue.openBlock(),vue.createBlock(HC,{key:0,color:"primary",bold:"",raised:"",outlined:"",onClick:oC},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("button.discard")),1)]),_:1})):vue.createCommentVNode("",!0),gI.value&&mI.value?(vue.openBlock(),vue.createBlock(HC,{key:1,color:"primary",bold:"",raised:"",onClick:wI},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadfiletext")),1)]),_:1})):vue.createCommentVNode("",!0),!gI.value&&!mI.value&&!_g.value?(vue.openBlock(),vue.createBlock(a0,{key:2,class:"camera-option"},{default:vue.withCtx(()=>[vue.createElementVNode("label",_hoisted_56$1,vue.toDisplayString(vue.unref(Gg)("modalmenu.uploadbycamera")),1),vue.createVNode(AA,{subcontrol:"",class:"mr-2"},{default:vue.withCtx(()=>[vue.createVNode(jC,{color:"success",modelValue:Jg.value,"onUpdate:modelValue":gA[33]||(gA[33]=RA=>Jg.value=RA)},null,8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)])):vue.createCommentVNode("",!0)])]}),_:1},8,["open","title"])],64)}}}),_withScopeId$c=ps=>(vue.pushScopeId("data-v-0b071339"),ps=ps(),vue.popScopeId(),ps),_hoisted_1$1q=["onKeydown"],_hoisted_2$1e={ref:"panelFind",class:"panel-body"},_hoisted_3$11={class:"panel-input-b"},_hoisted_4$P=_withScopeId$c(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"search",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-search fa-w-16 fa-sm"},[vue.createElementVNode("path",{fill:"currentColor",d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z",class:""})],-1)),_hoisted_5$F=[_hoisted_4$P],_sfc_main$1H=vue.defineComponent({__name:"NewPanelFind",props:{localizedLabel:{type:Object,default(){return{}}},doFind:{type:Function,default:null}},setup(ps,{expose:Ig}){const Zg=ps,Gg=vue.ref(!1),Bg=vue.ref();vue.ref(!1);const Wg=Vg=>{Vg.target.id==="panelModal"&&Xg()},Ng=(Vg,Fg)=>{Fg&&Fg.preventDefault(),Xg(),Zg.doFind(Bg.value)},Yg=()=>{Gg.value=!0,setTimeout(()=>{var Vg;return(Vg=Bg.value)==null?void 0:Vg.focus()})},Xg=()=>{Gg.value=!1};return vue.onMounted(()=>{console.log("PanelFilter - onMounted")}),Ig({showPanel:Yg,hidePanel:Xg,doFind:Ng,clickOutside:Wg}),(Vg,Fg)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{id:"panelModal",class:"panel-modal",onClick:Wg,onKeydown:vue.withKeys(vue.withModifiers(Xg,["exact"]),["esc"])},[vue.createElementVNode("div",_hoisted_2$1e,[vue.createElementVNode("div",null,[vue.createElementVNode("span",_hoisted_3$11,[vue.withDirectives(vue.createElementVNode("input",{type:"text",ref_key:"inputFind",ref:Bg,"onUpdate:modelValue":Fg[0]||(Fg[0]=Hg=>Bg.value=Hg),class:"panel-input",trim:"",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",onKeydown:Fg[1]||(Fg[1]=vue.withKeys(vue.withModifiers(Hg=>Ng(Bg.value,Hg),["exact"]),["enter"]))},null,544),[[vue.vModelText,Bg.value]])]),vue.createElementVNode("button",{class:"panel-input-button",onClick:Fg[2]||(Fg[2]=Hg=>Zg.doFind(Bg.value))},_hoisted_5$F)])],512)],40,_hoisted_1$1q)),[[vue.vShow,Gg.value]])}}),__unplugin_components_2$1=_export_sfc$1(_sfc_main$1H,[["__scopeId","data-v-0b071339"]]),_withScopeId$b=ps=>(vue.pushScopeId("data-v-4236098f"),ps=ps(),vue.popScopeId(),ps),_hoisted_1$1p=["onKeydown"],_hoisted_2$1d={ref:"panelFilter",class:"panel-body"},_hoisted_3$10={class:"panel-title"},_hoisted_4$O=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sort-amount-down",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-sort-amount-down fa-w-16 fa-1x"},[vue.createElementVNode("path",{fill:"currentColor",d:"M304 416h-64a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h64a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-128-64h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.37 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm256-192H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h192a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm-64 128H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM496 32H240a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h256a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z",class:""})],-1)),_hoisted_5$E=["innerHTML"],_hoisted_6$u={class:"panel-content"},_hoisted_7$r={class:"panel-action"},_hoisted_8$n=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sort-alpha-down",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:"svg-inline--fa fa-sort-alpha-down fa-w-14"},[vue.createElementVNode("path",{fill:"currentColor",d:"M176 352h-48V48a16 16 0 0 0-16-16H80a16 16 0 0 0-16 16v304H16c-14.19 0-21.36 17.24-11.29 27.31l80 96a16 16 0 0 0 22.62 0l80-96C197.35 369.26 190.22 352 176 352zm240-64H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 446.37V464a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 321.63V304a16 16 0 0 0-16-16zm31.06-85.38l-59.27-160A16 16 0 0 0 372.72 32h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 224h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 224H432a16 16 0 0 0 15.06-21.38zM335.61 144L352 96l16.39 48z",class:""})],-1)),_hoisted_9$j=["innerHTML"],_hoisted_10$g=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sort-alpha-up-alt",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",class:"svg-inline--fa fa-sort-alpha-up-alt fa-w-14"},[vue.createElementVNode("path",{fill:"currentColor",d:"M16 160h48v304a16 16 0 0 0 16 16h32a16 16 0 0 0 16-16V160h48c14.21 0 21.38-17.24 11.31-27.31l-80-96a16 16 0 0 0-22.62 0l-80 96C-5.35 142.74 1.78 160 16 160zm272 64h128a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16h-56l61.26-70.45A32 32 0 0 0 432 65.63V48a16 16 0 0 0-16-16H288a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h56l-61.26 70.45A32 32 0 0 0 272 190.37V208a16 16 0 0 0 16 16zm159.06 234.62l-59.27-160A16 16 0 0 0 372.72 288h-41.44a16 16 0 0 0-15.07 10.62l-59.27 160A16 16 0 0 0 272 480h24.83a16 16 0 0 0 15.23-11.08l4.42-12.92h71l4.41 12.92A16 16 0 0 0 407.16 480H432a16 16 0 0 0 15.06-21.38zM335.61 400L352 352l16.39 48z",class:""})],-1)),_hoisted_11$f=["innerHTML"],_hoisted_12$e={class:"panel-action"},_hoisted_13$d=["innerHTML"],_hoisted_14$b=["innerHTML"],_hoisted_15$c=["innerHTML"],_hoisted_16$9=["innerHTML"],_hoisted_17$8=["innerHTML"],_hoisted_18$8=["innerHTML"],_hoisted_19$7=["innerHTML"],_hoisted_20$7=["innerHTML"],_hoisted_21$6={class:"panel-input-b"},_hoisted_22$6=["placeholder","onKeydown"],_hoisted_23$6=["onClick"],_hoisted_24$5=_withScopeId$b(()=>vue.createElementVNode("input",{type:"checkbox",class:"panel-checkbox"},null,-1)),_hoisted_25$5={key:0,class:"normal-text",style:{float:"right"}},_hoisted_26$4=["innerHTML"],_hoisted_27$3={class:"panel-footer"},_hoisted_28$3=_withScopeId$b(()=>vue.createElementVNode("svg",{"aria-hidden":"true",focusable:"false","data-prefix":"fas","data-icon":"sign-in-alt",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",class:"svg-inline--fa fa-sign-in-alt fa-w-16 fa-fw fa-sm"},[vue.createElementVNode("path",{fill:"currentColor",d:"M416 448h-84c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h84c17.7 0 32-14.3 32-32V160c0-17.7-14.3-32-32-32h-84c-6.6 0-12-5.4-12-12V76c0-6.6 5.4-12 12-12h84c53 0 96 43 96 96v192c0 53-43 96-96 96zm-47-201L201 79c-15-15-41-4.5-41 17v96H24c-13.3 0-24 10.7-24 24v96c0 13.3 10.7 24 24 24h136v96c0 21.5 26 32 41 17l168-168c9.3-9.4 9.3-24.6 0-34z",class:""})],-1)),_hoisted_29$3=["innerHTML"],_sfc_main$1G=vue.defineComponent({__name:"NewPanelFilter",props:{nFilterCount:{type:Number,default:1e3},fields:{type:Array,default:[]},table:{type:Array,default:[]},sort:{type:Function,default:null},calTable:{type:Function,default:null},localizedLabel:{type:Object,default(){return{sortingAndFiltering:"Sorting And Filtering",sortAscending:"Sort Ascending",sortDescending:"Sort Descending",near:"≒ Near",exactMatch:"= Exact Match",notMatch:"≠ Not Match",greaterThan:"&gt; Greater Than",greaterThanOrEqualTo:"≥ Greater Than or Equal To",lessThan:"&lt; Less Than",lessThanOrEqualTo:"≤ Less Than Or Equal To",regularExpression:"~ Regular Expression",customFilter:"Custom Filter",listFirstNValuesOnly:ps=>`List first ${ps} values only`,apply:"Apply"}}}},setup(ps,{expose:Ig}){const Zg=ps,Gg=vue.ref(!1),Bg=vue.ref(!1);vue.ref(!1);const Wg=vue.ref(),Ng=vue.ref(),Yg=vue.ref(),Xg=vue.ref(),Vg=vue.ref(""),Fg=vue.ref([]),Hg=vue.computed(()=>{var aI,oI,lI,fI;console.log("filteredSortedUniqueValueList:",(aI=Ng.value)==null?void 0:aI.value,Ng.value,Fg.value);const tI=(lI=(oI=Ng.value)==null?void 0:oI.value)==null?void 0:lI.toUpperCase();return(fI=Fg.value)==null?void 0:fI.filter(BI=>BI.toUpperCase().startsWith(tI))}),Lg=vue.computed(()=>{switch(Vg.value){case"":return"≒";case"<=":return"≤";case">=":return"≥";case"<>":return"≠";default:return Vg.value}}),Dg=()=>{Gg.value=!1,_g(),setTimeout(()=>{Fg.value=[]},0)},Jg=tI=>{tI.target.id==="panelModal"&&Dg()},$g=tI=>{var aI;Dg(),Zg.sort(tI,(aI=Wg.value)==null?void 0:aI.colPos)},Qg=tI=>{var aI;Bg.value=!1,Vg.value=tI,(aI=Ng.value)==null||aI.focus()},Kg=()=>{const tI=Yg.value,aI=tI.getBoundingClientRect();tI.setAttribute("style",`width:${aI.width}px; height:${aI.height}px;`)},_g=()=>{Yg.value.removeAttribute("style")},il=()=>{Xg.value&&clearTimeout(Xg.value),Xg.value=setTimeout(()=>{var tI;Ng.value.value=(tI=Ng.value)==null?void 0:tI.value},200)},Tg=()=>{var aI,oI;const tI=Vg.value+((aI=Ng.value)==null?void 0:aI.value);Wg.value.textContent=tI,(oI=Wg.value)==null||oI.$emit("update:modelValue",tI),Dg()},eI=tI=>{Wg.value.textContent="="+tI,Wg.value.$emit("update:modelValue","="+tI),Dg()},iI=(tI,aI)=>{var oI,lI,fI;Wg.value=tI,console.log("ShowPanel - Filter:",Wg.value,aI),Vg.value="",Fg.value=[],Ng.value.value="",Wg.value&&((lI=(oI=Wg.value)==null?void 0:oI.textContent)==null?void 0:lI.trim())!==""&&(Wg.value.textContent="",(fI=Wg.value)==null||fI.$emit("update:modelValue",""),Zg.calTable()),setTimeout(()=>{var gI,bI;Gg.value=!0,setTimeout(()=>{var mI;return(mI=Ng.value)==null?void 0:mI.focus()});const BI={};let vI="";console.log("props.fields:",Zg.fields,aI),((gI=Zg.fields)==null?void 0:gI.length)>0&&(vI=(bI=Zg.fields[aI])==null?void 0:bI.name),Zg.table.forEach(mI=>BI[mI[vI]]=!0);const pI=Object.keys(BI);pI.sort(),pI.length>0&&pI[0]===""&&(pI[0]=" "),Fg.value=pI,setTimeout(()=>Kg())})};return vue.onMounted(()=>{console.log("PanelFilter - onMounted")}),Ig({showPanel:iI,hidePanel:Dg,filterPanelSelect:eI,clickOutside:Jg,doFilter:Tg,doInputFilter:il,removePanelSizeAfterHide:_g,setFilterCondition:Qg,sort:$g,freezePanelSizeAfterShown:Kg}),(tI,aI)=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{id:"panelModal",class:"panel-modal",onClick:Jg,onKeydown:vue.withKeys(vue.withModifiers(Dg,["exact"]),["esc"])},[vue.createElementVNode("div",_hoisted_2$1d,[vue.createElementVNode("div",_hoisted_3$10,[_hoisted_4$O,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.sortingAndFiltering},null,8,_hoisted_5$E)]),vue.createElementVNode("div",_hoisted_6$u,[vue.createElementVNode("div",_hoisted_7$r,[vue.createElementVNode("button",{class:"panel-button float-left",onClick:aI[0]||(aI[0]=oI=>$g(1))},[_hoisted_8$n,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.sortAscending},null,8,_hoisted_9$j)]),vue.createElementVNode("button",{class:"panel-button float-right",onClick:aI[1]||(aI[1]=oI=>$g(-1))},[_hoisted_10$g,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.sortDescending},null,8,_hoisted_11$f)])]),vue.createElementVNode("div",_hoisted_12$e,[vue.createElementVNode("div",null,[vue.createElementVNode("button",{class:"panel-input-button",onClick:aI[2]||(aI[2]=oI=>Bg.value=!Bg.value)},vue.toDisplayString(Lg.value),1),vue.createElementVNode("div",{class:vue.normalizeClass([{show:Bg.value},"panel-dropdown"])},[vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[3]||(aI[3]=vue.withModifiers(oI=>Qg(""),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.near},null,8,_hoisted_13$d)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[4]||(aI[4]=vue.withModifiers(oI=>Qg("="),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.exactMatch},null,8,_hoisted_14$b)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[5]||(aI[5]=vue.withModifiers(oI=>Qg("<>"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.notMatch},null,8,_hoisted_15$c)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[6]||(aI[6]=vue.withModifiers(oI=>Qg(">"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.greaterThan},null,8,_hoisted_16$9)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[7]||(aI[7]=vue.withModifiers(oI=>Qg(">="),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.greaterThanOrEqualTo},null,8,_hoisted_17$8)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[8]||(aI[8]=vue.withModifiers(oI=>Qg("<"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.lessThan},null,8,_hoisted_18$8)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[9]||(aI[9]=vue.withModifiers(oI=>Qg("<="),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.lessThanOrEqualTo},null,8,_hoisted_19$7)]),vue.createElementVNode("div",{class:"panel-dropdown-item",onClick:aI[10]||(aI[10]=vue.withModifiers(oI=>Qg("~"),["prevent"]))},[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.regularExpression},null,8,_hoisted_20$7)])],2),vue.createElementVNode("span",_hoisted_21$6,[vue.createElementVNode("input",{type:"text",ref_key:"inputFilter",ref:Ng,class:"panel-input",placeholder:ps.localizedLabel.customFilter,trim:"",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",onKeyup:il,onKeydown:vue.withKeys(vue.withModifiers(Tg,["exact"]),["enter"])},null,40,_hoisted_22$6)])])]),vue.createElementVNode("div",null,[vue.createElementVNode("div",{ref_key:"panelList",ref:Yg,class:"panel-list"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Hg.value.slice(0,ps.nFilterCount),(oI,lI)=>(vue.openBlock(),vue.createElementBlock("div",{key:lI,class:"panel-list-item",onClick:vue.withModifiers(fI=>eI(oI),["prevent"])},[_hoisted_24$5,vue.createElementVNode("span",null,vue.toDisplayString(oI),1)],8,_hoisted_23$6))),128))],512),Hg.value.length>ps.nFilterCount?(vue.openBlock(),vue.createElementBlock("div",_hoisted_25$5,[vue.createElementVNode("span",{innerHTML:ps.localizedLabel.listFirstNValuesOnly(ps.nFilterCount)},null,8,_hoisted_26$4)])):vue.createCommentVNode("",!0)])]),vue.createElementVNode("div",_hoisted_27$3,[vue.createElementVNode("button",{class:"panel-button",onClick:Tg},[_hoisted_28$3,vue.createElementVNode("span",{innerHTML:ps.localizedLabel.apply},null,8,_hoisted_29$3)])])],512)],40,_hoisted_1$1p)),[[vue.vShow,Gg.value]])}}),__unplugin_components_1=_export_sfc$1(_sfc_main$1G,[["__scopeId","data-v-4236098f"]]),_hoisted_1$1o=["id","colspan","onKeydown","onKeyup"],_sfc_main$1F=vue.defineComponent({__name:"NewVueExcelFilter",props:{modelValue:{type:String,default:""},interactive:{type:Boolean,default:!1},colspan:{type:[String,Number],default:1},class:{type:[String,Object],default:null},style:{type:[String,Object],default:null},panelFilter:{type:Function,default:null}},emits:["update:modelValue","show-panel-filter","set-focus"],setup(ps,{emit:Ig}){const Zg=vue.useAttrs(),Gg=ps,Bg=Ig,Wg=vue.ref(""),Ng=vue.ref(null),Yg=vue.ref(null),Xg=vue.ref(null),Vg=vue.ref(0),Fg=vue.ref(),Hg=vue.computed(()=>Gg.class),Lg=vue.computed(()=>Gg.style),Dg=vue.computed(()=>({...Zg,input:$g}));vue.computed(()=>({})),vue.watch(()=>Gg.modelValue,oI=>{var lI,fI;console.log("props.modelValue has changed:",oI,(lI=Ng.value)==null?void 0:lI.textContent),oI!==((fI=Ng.value)==null?void 0:fI.textContent)&&Ng.value&&(Ng.value.textContent=oI)}),vue.onMounted(()=>{var oI,lI,fI;Wg.value=`uid${Math.random().toString(36).substr(2,9)}`,Ng.value&&(Ng.value.textContent=Gg.modelValue,Yg.value=Ng.value.parentElement,Xg.value=(oI=Yg.value)==null?void 0:oI.parentElement,Vg.value=Array.from(((lI=Yg.value)==null?void 0:lI.children)||[]).indexOf(Ng.value)-1,Fg.value=(fI=Xg.value)==null?void 0:fI.children[0].children[Vg.value+1])});const Jg=oI=>{const lI=oI.target.textContent;Gg.modelValue!==lI&&Bg("update:modelValue",lI)},$g=oI=>{Gg.interactive&&Jg(oI)},Qg=()=>{setTimeout(()=>{var oI;(oI=Fg.value)==null||oI.classList.add("focus"),Kg(Ng.value),Bg("set-focus",{currentColPos:Vg.value,currentRowPos:-1,classList:"focus"})},0)},Kg=oI=>{if(oI){const lI=window.getSelection();if(lI){const fI=document.createRange();fI.selectNodeContents(oI),lI==null||lI.removeAllRanges(),lI==null||lI.addRange(fI)}}},_g=oI=>{var lI;Jg(oI),(lI=Fg.value)==null||lI.classList.remove("focus"),oI.target.classList.remove("edit")},il=oI=>{const lI=document.getSelection();if((lI==null?void 0:lI.toString())===oI.target.textContent||(lI==null?void 0:lI.focusOffset)===0){let fI=oI.target.previousElementSibling;for(;fI&&fI.style.display==="none";)fI=fI.previousElementSibling;fI==null||fI.focus()}},Tg=oI=>{var fI;const lI=document.getSelection();if((lI==null?void 0:lI.toString())===oI.target.textContent||(lI==null?void 0:lI.focusOffset)===((fI=oI.target.textContent)==null?void 0:fI.length)){let BI=oI.target.nextElementSibling;for(;BI&&BI.style.display==="none";)BI=BI.nextElementSibling;BI==null||BI.focus()}},eI=oI=>{oI.preventDefault(),Kg(Ng.value),Jg(oI)},iI=oI=>{oI.target.textContent===""&&setTimeout(()=>Jg(oI),0)},tI=oI=>{Ng.value&&(Ng.value.style.cursor=Ng.value.offsetWidth-oI.offsetX<15?"pointer":"text")},aI=oI=>{oI.button===0&&Ng.value&&Ng.value.offsetWidth-oI.offsetX<15&&(oI.preventDefault(),setTimeout(()=>{console.log("show-panel-filter:",Ng.value),Bg("show-panel-filter",Vg.value)},0))};return(oI,lI)=>(vue.openBlock(),vue.createElementBlock("td",vue.mergeProps({id:Wg.value,ref_key:"cell",ref:Ng,contenteditable:"",onDragenter:lI[0]||(lI[0]=vue.withModifiers(fI=>fI.dataTransfer.dropEffect="none",["prevent"])),onDragover:lI[1]||(lI[1]=vue.withModifiers(fI=>fI.dataTransfer.dropEffect="none",["prevent"])),class:["cell column-filter",Hg.value],style:[{},Lg.value],autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",tabindex:"-1"},vue.toHandlers(Dg.value,!0),{colspan:ps.colspan,onFocus:Qg,onBlur:_g,onKeydown:[vue.withKeys(vue.withModifiers(il,["exact"]),["left"]),vue.withKeys(vue.withModifiers(Tg,["exact"]),["right"]),vue.withKeys(vue.withModifiers(eI,["exact"]),["enter"])],onKeyup:vue.withKeys(vue.withModifiers(iI,["exact"]),["delete"]),onMousemove:tI,onMousedown:aI}),null,16,_hoisted_1$1o))}}),__unplugin_components_0$7=_export_sfc$1(_sfc_main$1F,[["__scopeId","data-v-859576f7"]]);var xlsx$2={exports:{}},cpexcel$1={exports:{}},cpexcel=cpexcel$1.exports,hasRequiredCpexcel;function requireCpexcel(){return hasRequiredCpexcel||(hasRequiredCpexcel=1,function(ps){var Ig={version:"1.14.0"};Ig[437]=function(){for(var Zg=`\0\x07\b
167
167
  \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,Gg=[],Bg={},Wg=0;Wg!=Zg.length;++Wg)Zg.charCodeAt(Wg)!==65533&&(Bg[Zg.charAt(Wg)]=Wg),Gg[Wg]=Zg.charAt(Wg);return{enc:Bg,dec:Gg}}(),Ig[620]=function(){for(var Zg=`\0\x07\b
168
168
  \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,Gg=[],Bg={},Wg=0;Wg!=Zg.length;++Wg)Zg.charCodeAt(Wg)!==65533&&(Bg[Zg.charAt(Wg)]=Wg),Gg[Wg]=Zg.charAt(Wg);return{enc:Bg,dec:Gg}}(),Ig[737]=function(){for(var Zg=`\0\x07\b
169
169
  \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ `,Gg=[],Bg={},Wg=0;Wg!=Zg.length;++Wg)Zg.charCodeAt(Wg)!==65533&&(Bg[Zg.charAt(Wg)]=Wg),Gg[Wg]=Zg.charAt(Wg);return{enc:Bg,dec:Gg}}(),Ig[850]=function(){for(var Zg=`\0\x07\b
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue3-beak-ui-framework",
3
3
  "private": false,
4
- "version": "1.2.44",
4
+ "version": "1.2.46",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"