@lifesg/web-frontend-engine 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunks/{file-upload-manager.322f9ebd.js → file-upload-manager.faa055fa.js} +2 -2
- package/chunks/{file-upload-manager.322f9ebd.js.map → file-upload-manager.faa055fa.js.map} +1 -1
- package/chunks/{index.525d4dc8.js → index.2d28e824.js} +93 -92
- package/chunks/index.2d28e824.js.map +1 -0
- package/chunks/{index.001bdfec.js → index.ef942fcf.js} +2 -2
- package/chunks/{index.001bdfec.js.map → index.ef942fcf.js.map} +1 -1
- package/chunks/{index.d39dccc1.js → index.fe54c734.js} +2 -2
- package/chunks/{index.d39dccc1.js.map → index.fe54c734.js.map} +1 -1
- package/chunks/{location-modal.db994c40.js → location-modal.5e4e98fd.js} +2 -2
- package/chunks/{location-modal.db994c40.js.map → location-modal.5e4e98fd.js.map} +1 -1
- package/cjs/chunks/{file-upload-manager.aebae412.js → file-upload-manager.bc7599d2.js} +2 -2
- package/cjs/chunks/{file-upload-manager.aebae412.js.map → file-upload-manager.bc7599d2.js.map} +1 -1
- package/cjs/chunks/{index.594875a2.js → index.17761159.js} +21 -20
- package/cjs/chunks/index.17761159.js.map +1 -0
- package/cjs/chunks/{index.21340464.js → index.51cff881.js} +2 -2
- package/cjs/chunks/{index.21340464.js.map → index.51cff881.js.map} +1 -1
- package/cjs/chunks/{index.516d4b9b.js → index.8d9d1609.js} +2 -2
- package/cjs/chunks/{index.516d4b9b.js.map → index.8d9d1609.js.map} +1 -1
- package/cjs/chunks/{location-modal.c859475a.js → location-modal.ca4904e4.js} +2 -2
- package/cjs/chunks/{location-modal.c859475a.js.map → location-modal.ca4904e4.js.map} +1 -1
- package/cjs/index.js +1 -1
- package/components/fields/checkbox-group/checkbox-group.styles.d.ts +2 -2
- package/components/fields/image-upload/image-review/image-review.styles.d.ts +3 -1
- package/components/fields/index.d.ts +1 -0
- package/components/fields/location-field/location-modal/location-modal.styles.d.ts +3 -1
- package/components/fields/otp-verification-field/index.d.ts +2 -0
- package/components/fields/otp-verification-field/otp-verification-field.d.ts +3 -0
- package/components/fields/otp-verification-field/types.d.ts +46 -0
- package/components/fields/radio-button/radio-button.styles.d.ts +2 -2
- package/components/fields/types.d.ts +3 -1
- package/components/shared/error-messages.d.ts +10 -0
- package/components/shared/prompt/prompt.styles.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/chunks/index.525d4dc8.js.map +0 -1
- package/cjs/chunks/index.594875a2.js.map +0 -1
|
@@ -176,7 +176,7 @@ var Wp=!1;Wp||(Wp=!0,Hp.ENGLISH=new Hp("en"),Hp.US=new Hp("en","US","en"),Hp.UK=
|
|
|
176
176
|
* @copyright (c) 2017, Philipp Thuerwaechter & Pattrick Hueper
|
|
177
177
|
* @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
|
|
178
178
|
*/
|
|
179
|
-
Zf((function(e){Object.getOwnPropertyNames(Vp.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatterBuilder.prototype[t]=Vp.prototype[t])})),Object.getOwnPropertyNames(Yp.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatter.prototype[t]=Yp.prototype[t])})),e.DateTimeFormatter.RFC_1123_DATE_TIME=Yp.RFC_1123_DATE_TIME}));var qp=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Kp=sn,Jp=Rr;var Xp=function(e){return"symbol"==typeof e||Jp(e)&&"[object Symbol]"==Kp(e)},Qp=qp,eh=Hr,th=Xp,nh=qt?qt.prototype:void 0,rh=nh?nh.toString:void 0;var ih=function e(t){if("string"==typeof t)return t;if(eh(t))return Qp(t,e)+"";if(th(t))return rh?rh.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},ah=ih;var oh=function(e){return null==e?"":ah(e)};var sh=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a},uh=sh;var ch=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:uh(e,t,n)},lh=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var dh=function(e){return lh.test(e)};var fh=function(e){return e.split("")},ph="\\ud800-\\udfff",hh="["+ph+"]",mh="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",gh="\\ud83c[\\udffb-\\udfff]",yh="[^"+ph+"]",_h="(?:\\ud83c[\\udde6-\\uddff]){2}",vh="[\\ud800-\\udbff][\\udc00-\\udfff]",bh="(?:"+mh+"|"+gh+")"+"?",Eh="[\\ufe0e\\ufe0f]?",Sh=Eh+bh+("(?:\\u200d(?:"+[yh,_h,vh].join("|")+")"+Eh+bh+")*"),Ah="(?:"+[yh+mh+"?",mh,_h,vh,hh].join("|")+")",xh=RegExp(gh+"(?="+gh+")|"+Ah+Sh,"g");var wh=function(e){return e.match(xh)||[]},Th=fh,Mh=dh,Oh=wh;var Ch=function(e){return Mh(e)?Oh(e):Th(e)},Nh=ch,Dh=dh,Lh=Ch,Ih=oh;var kh=function(e){return function(t){t=Ih(t);var n=Dh(t)?Lh(t):void 0,r=n?n[0]:t.charAt(0),i=n?Nh(n,1).join(""):t.slice(1);return r[e]()+i}},$h=kh("toUpperCase"),Rh=oh,Fh=$h;var zh=function(e){return Fh(Rh(e).toLowerCase())};function Ph(e){return new DataView(e.buffer,e.byteOffset)}const jh={len:1,get:(e,t)=>Ph(e).getUint8(t),put:(e,t,n)=>(Ph(e).setUint8(t,n),t+1)},Zh={len:2,get:(e,t)=>Ph(e).getUint16(t,!0),put:(e,t,n)=>(Ph(e).setUint16(t,n,!0),t+2)},Uh={len:2,get:(e,t)=>Ph(e).getUint16(t),put:(e,t,n)=>(Ph(e).setUint16(t,n),t+2)},Bh={len:4,get:(e,t)=>Ph(e).getUint32(t,!0),put:(e,t,n)=>(Ph(e).setUint32(t,n,!0),t+4)},Vh={len:4,get:(e,t)=>Ph(e).getUint32(t),put:(e,t,n)=>(Ph(e).setUint32(t,n),t+4)},Hh={len:4,get:(e,t)=>Ph(e).getInt32(t),put:(e,t,n)=>(Ph(e).setInt32(t,n),t+4)},Gh={len:8,get:(e,t)=>Ph(e).getBigUint64(t,!0),put:(e,t,n)=>(Ph(e).setBigUint64(t,n,!0),t+8)};class Yh{constructor(e,t){this.len=e,this.encoding=t,this.textDecoder=new TextDecoder(t)}get(e,t){return this.textDecoder.decode(e.subarray(t,t+this.len))}}class Wh extends Error{constructor(){super("End-Of-Stream")}}class qh{constructor(){this.maxStreamReadSize=1048576,this.endOfStream=!1,this.peekQueue=[]}async peek(e,t,n){const r=await this.read(e,t,n);return this.peekQueue.push(e.subarray(t,t+r)),r}async read(e,t,n){if(0===n)return 0;let r=this.readFromPeekBuffer(e,t,n);if(r+=await this.readRemainderFromStream(e,t+r,n-r),0===r)throw new Wh;return r}readFromPeekBuffer(e,t,n){let r=n,i=0;for(;this.peekQueue.length>0&&r>0;){const n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");const a=Math.min(n.length,r);e.set(n.subarray(0,a),t+i),i+=a,r-=a,a<n.length&&this.peekQueue.push(n.subarray(a))}return i}async readRemainderFromStream(e,t,n){let r=n,i=0;for(;r>0&&!this.endOfStream;){const n=Math.min(r,this.maxStreamReadSize),a=await this.readFromStream(e,t+i,n);if(0===a)break;i+=a,r-=a}return i}}class Kh extends qh{constructor(e){super(),this.reader=e.getReader({mode:"byob"})}async readFromStream(e,t,n){if(this.endOfStream)throw new Wh;const r=await this.reader.read(new Uint8Array(n));return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value,t),r.value.byteLength):0}abort(){return this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}class Jh{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",(()=>{this.abort()}))}async readToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new Wh;return e.get(n,0)}async peekToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new Wh;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new Wh;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new Wh;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await(this.onClose?.())}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}abort(){return Promise.resolve()}}class Xh extends Jh{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){const n=this.normalizeOptions(e,t),r=n.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===n.length)return 0;const i=await this.streamReader.read(e,n.offset,n.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new Wh;return i}async peekBuffer(e,t){const n=this.normalizeOptions(e,t);let r=0;if(n.position){const t=n.position-this.position;if(t>0){const i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t),n.offset),r-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{r=await this.streamReader.peek(e,n.offset,n.length)}catch(e){if(t?.mayBeLess&&e instanceof Wh)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new Wh}return r}async ignore(e){const t=Math.min(256e3,e),n=new Uint8Array(t);let r=0;for(;r<e;){const i=e-r,a=await this.readBuffer(n,{length:Math.min(t,i)});if(a<0)return a;r+=a}return r}abort(){return this.streamReader.abort()}supportsRandomAccess(){return!1}}class Qh extends Jh{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){if(t?.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){const n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new Wh;return e.set(this.uint8Array.subarray(n.position,n.position+r),n.offset),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function em(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}function tm(e,t){const n=e.length,r=t.length;if(0===r)return-1;if(r>n)return-1;const i=n-r;for(let n=0;n<=i;n++){let i=!0;for(let a=0;a<r;a++)if(e[n+a]!==t[a]){i=!1;break}if(i)return n}return-1}new globalThis.TextDecoder("utf8"),new globalThis.TextEncoder,Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const nm={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},rm=4100;function im(e,t,n){n={offset:0,...n};for(const[r,i]of t.entries())if(n.mask){if(i!==(n.mask[r]&e[r+n.offset]))return!1}else if(i!==e[r+n.offset])return!1;return!0}class am{constructor(e){this.detectors=e?.customDetectors,this.tokenizerOptions={abortSignal:e?.signal},this.fromTokenizer=this.fromTokenizer.bind(this),this.fromBuffer=this.fromBuffer.bind(this),this.parse=this.parse.bind(this)}async fromTokenizer(e){const t=e.position;for(const n of this.detectors||[]){const r=await n(e);if(r)return r;if(t!==e.position)return}return this.parse(e)}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);var n,r;if(t?.length>1)return this.fromTokenizer((n=t,r=this.tokenizerOptions,new Qh(n,r)))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){const t=await(n=e,r=this.tokenizerOptions,new Xh(new Kh(n),r));var n,r;try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){const{sampleSize:n=rm}=t;let r,i;const a=e.getReader({mode:"byob"});try{const{value:e,done:t}=await a.read(new Uint8Array(n));if(i=e,!t&&e)try{r=await this.fromBuffer(e.slice(0,n))}catch(e){if(!(e instanceof Wh))throw e;r=void 0}i=e}finally{a.releaseLock()}const o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}check(e,t){return im(this.buffer,e,t)}checkString(e,t){return this.check(function(e){return[...e].map((e=>e.charCodeAt(0)))}(e),t)}async parse(e){if(this.buffer=new Uint8Array(rm),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.parse(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(nm);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const n=new DataView(this.buffer.buffer),r={compressedSize:n.getUint32(18,!0),uncompressedSize:n.getUint32(22,!0),filenameLength:n.getUint16(26,!0),extraFieldLength:n.getUint16(28,!0)};if(r.filename=await e.readToken(new Yh(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),/classes\d*\.dex/.test(r.filename))return{ext:"apk",mime:"application/vnd.android.package-archive"};if("META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};case"visio":return{ext:"vsdx",mime:"application/vnd.visio"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){let i=await e.readToken(new Yh(r.compressedSize,"utf-8"));switch(i=i.trim(),i){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let a=-1;for(;a<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),a=tm(this.buffer,new Uint8Array([80,75,3,4])),await e.ignore(a>=0?a:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(o){if(!(o instanceof Wh))throw o}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const s=new Uint8Array(8);return await e.readBuffer(s),im(s,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:im(s,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:im(s,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:im(s,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:im(s,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:im(s,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const u=new Yh(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(u){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return u.startsWith("3g")?u.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{await e.ignore(1350);const c=10485760,l=new Uint8Array(Math.min(c,e.fileInfo.size));if(await e.readBuffer(l,{mayBeLess:!0}),function(e,t){return-1!==tm(e,t)}(l,(new TextEncoder).encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}catch(d){if(!(d instanceof Wh))throw d}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const f=await this.readTiffHeader(!1);if(f)return f}if(this.check([77,77])){const p=await this.readTiffHeader(!0);if(p)return p}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function h(){const t=await e.peekNumber(jh);let n=128,r=0;for(;!(t&n)&&0!==n;)++r,n>>=1;const i=new Uint8Array(r+1);return await e.readBuffer(i),i}async function m(){const e=await h(),t=await h();t[0]^=128>>t.length-1;const n=Math.min(6,t.length),r=new DataView(e.buffer),i=new DataView(t.buffer,t.length-n,n);return{id:em(r),len:em(i)}}async function g(t){for(;t>0;){const n=await m();if(17026===n.id){return(await e.readToken(new Yh(n.len))).replaceAll(/\00.*$/g,"")}await e.ignore(n.len),--t}}const y=await m();switch(await g(y.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const _=new Yh(4,"latin1").get(this.buffer,2);if(_.match("^d*")&&_>=1e3&&_<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new Yh(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((e=>this.checkString(e,{offset:6}))))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){async function v(){return{length:await e.readToken(Hh),type:await e.readToken(new Yh(4,"latin1"))}}await e.ignore(8);do{const b=await v();if(b.length<0)return;switch(b.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(b.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function E(){const t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Gh))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const S=await E();let A=S.size-24;if(im(S.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const x=new Uint8Array(16);if(A-=await e.readBuffer(x),im(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(im(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(A)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new Yh(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const w=new DataView(this.buffer.buffer).getUint32(12,!0);if(w>12&&this.buffer.length>=w+16)try{const T=(new TextDecoder).decode(this.buffer.slice(16,w+16));if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const n=Number.parseInt(new Yh(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let n=t;n<t+148;n++)r+=e[n];for(let n=t+156;n<t+512;n++)r+=e[n];return n===r}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}async readTiffTag(e){const t=await this.tokenizer.readToken(e?Uh:Zh);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?Uh:Zh);for(let n=0;n<t;++n){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t=(e?Uh:Zh).get(this.buffer,2),n=(e?Vh:Bh).get(this.buffer,4);if(42===t){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}await this.tokenizer.ignore(n);return await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(43===t)return{ext:"tif",mime:"image/tiff"}}}new Set(["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk"]),new Set(["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive"]),exports.FileHelper=void 0,function(e){e.truncateFileName=(e,n)=>{let r,i=e,a=0;if(n&&n.current&&(r=t(n.current),a=n.current.getBoundingClientRect().width),r&&r.measureText(e).width>a){const t="...";let n="",o="",s=0,u=e.length-1,c=t,l=c;for(;s<u;){if(n+=e.charAt(s),c=n+t+o,r.measureText(c).width>a){i=l;break}if(l=c,o=e.charAt(u)+o,c=n+t+o,r.measureText(c).width>a){i=l;break}l=c,s++,u--}}return i};const t=e=>{const t=document.createDocumentFragment(),n=document.createElement("canvas");t.appendChild(n);const r=n.getContext("2d"),i=window.getComputedStyle(e);return r.font=i.font?i.font:`${i.fontSize}" "${i.fontFamily}`,r};e.fileToDataUrl=async e=>{if(window&&window.FileReader)return new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)}))},e.dataUrlToBlob=async e=>(await fetch(e)).blob(),e.getFilesizeFromBase64=e=>{const t=e.length;return.75*t-(e.substring(t-2,2).match(/=/g)?.length||0)},e.extensionsToSentence=(e,t)=>{let r=e.map((e=>`.${e.toUpperCase()}`));return t?.setBothJpegAndJpgIfEitherExists&&(r=n(r)),new Intl.ListFormat("en-GB",{style:"long",type:"disjunction"}).format(new Set(r))};const n=e=>{const t=[...e],n=e.includes(".JPG"),r=e.includes(".JPEG");if(n&&r||!n&&!r)return t;const{index:i,toAdd:a}=t.indexOf(".JPG")>-1?{index:t.indexOf(".JPG"),toAdd:".JPEG"}:{index:t.indexOf(".JPEG"),toAdd:".JPG"};return t.splice(i+1,0,a),t};e.fileExtensionToMimeType=e=>{switch(e.toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"heic":return"image/heic";case"heif":return"image/heif";case"webp":return"image/webp"}},e.getType=async e=>{const t=await e.arrayBuffer(),n=await async function(e){return(new am).fromBuffer(e)}(t);if(!n&&e.type.startsWith("text")){const t=e.name||".txt";return{mime:e.type,ext:t.substring(t.lastIndexOf(".")+1,t.length)}}return n},e.deduplicateFileName=(t,n,r,i=r,a=1)=>{if(t.filter(((e,t)=>t!==n)).includes(r)){const o=i.split("."),s=o.pop();return s?(r=o.join(".").concat(` (${a}).`).concat(s),e.deduplicateFileName(t,n,r,i,++a)):r}return r},e.sanitizeFileName=e=>{const t=e.split(".");let n,r;2===t.length&&""===t[0]?r=e:t.length>1?(n=t.pop(),r=t.join(".")):r=t.join(".");let i=r.replace(/[^\u0020-\u007E]*/g,"");return i||(i="file"),n?`${i}.${n}`:`${i}`},e.blobToFile=(e,t)=>{const{name:n,lastModified:r}=t;return new File([e],n,{type:e.type,lastModified:r})}}(exports.FileHelper||(exports.FileHelper={}));const om={COMMON:{FIELD_REQUIRED:"This field is required.",REQUIRED_OPTION:"An option is required.",REQUIRED_OPTIONS:"Both options are required."},CONTACT:{INVALID_SINGAPORE_NUMBER:"Invalid Singapore number.",INVALID_INTERNATIONAL_NUMBER:"Invalid international number."},DATE:{MUST_BE_FUTURE:"Date must be in the future.",MUST_BE_PAST:"Date must be in the past.",CANNOT_BE_FUTURE:"Date cannot be in the future.",CANNOT_BE_PAST:"Date cannot be in the past.",MIN_DATE:e=>`Date cannot be earlier than ${e}.`,MAX_DATE:e=>`Date cannot be later than ${e}.`,DISABLED_DATES:"Date is not allowed.",INVALID:"Invalid date.",WITHIN_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be within ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`},BEYOND_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be beyond ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`}},DATE_RANGE:{MUST_BE_FUTURE:"Dates must be in the future.",MUST_BE_PAST:"Dates must be in the past.",CANNOT_BE_FUTURE:"Dates cannot be in the future.",CANNOT_BE_PAST:"Dates cannot be in the past.",MIN_DATE:e=>`Dates cannot be earlier than ${e}.`,MAX_DATE:e=>`Dates cannot be later than ${e}.`,DISABLED_DATES:"Date range should not include disabled dates.",INVALID:"Invalid dates",REQUIRED:"Both dates are required",MUST_HAVE_NUMBER_OF_DAYS:e=>`Selection should have ${e} days.`},EMAIL:{INVALID:"Invalid email address."},ESIGNATURE:{UPLOAD:"Signature not uploaded."},GENERIC:{INVALID:"Invalid input",UNSUPPORTED:"This component is not supported by the engine."},UPLOAD:(t="file",n=`${t}s`)=>({REQUIRED:`Upload at least 1 ${t}.`,MAX_FILES:e=>`Upload failed. You can only upload a maximum of ${e} ${1!==e?n:t}.`,MAX_FILES_WITH_REMAINING:e=>`Upload failed. You can only upload ${e} more ${1===e?t:n}. To upload more ${n}, you may wish to delete your previously uploaded ${n}.`,MAX_FILE_SIZE:e=>`Upload failed. ${zh(t)} exceeds the maximum size of ${e} KB.`,GENERIC:"Upload failed. Please try again.",FILE_TYPE:e=>`Upload failed. Only ${exports.FileHelper.extensionsToSentence(e,{setBothJpegAndJpgIfEitherExists:!0})} files are accepted.`,FILE_EXTENSION:e=>`Upload failed. Only files with the following file extensions are accepted: ${exports.FileHelper.extensionsToSentence(e)}.`,UPLOADING:`Please wait for all ${n} to finish uploading.`,MODAL:{FILE_TYPE:{TITLE:`Unsupported ${t} format`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," could not be uploaded. Try again with a"," ",exports.FileHelper.extensionsToSentence(n)," file."]})},GENERIC_ERROR:{TITLE:`${zh(t)} not uploaded`,DESCRIPTION:t=>e.jsxs(e.Fragment,{children:["There was a problem uploading ",t,". Please try again."]}),INVALID_FILE_NAME:`Invalid ${t} name`},MAX_FILE_SIZE:{TITLE:`${zh(t)} exceeds maximum size`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," exceeds the maximum size of ",n," KB."]})}}}),SLIDER:{MUST_BE_INCREMENTAL:"Input must be incremental."},UNIT_NUMBER:{INVALID:"Invalid unit number."},LOCATION:{MUST_HAVE_POSTAL_CODE:"Selected location must have postal code."},ARRAY_FIELD:{INVALID:"One or more of the sections is incomplete",REQUIRED:"At least one section must be filled in",MIN:e=>`At least ${e} ${1===e?"entry":"entries"} must be provided`,MAX:e=>`No more than ${e} ${1===e?"entry":"entries"} can be provided`,LENGTH:e=>`Exactly ${e} ${1===e?"entry":"entries"} must be provided`,UNIQUE:"One or more fields are not unique"}};var sm;!function(e){function t(e,t,n){if(e)try{const r=ef.ofPattern(t).withResolverStyle(Ql.STRICT).withLocale(Hp.ENGLISH);switch(n){case"date":return bf.parse(e,r);case"time":return Af.parse(e,r);case"datetime":return Sf.parse(e,r);default:return}}catch(e){return}}function n(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||bf.now();return n>=0?{startDate:a,endDate:a.plusDays(n)}:{startDate:a.plusDays(n),endDate:a}}e.formatDateTime=(e,t,n,r)=>{if(e)try{const i=ef.ofPattern(t).withResolverStyle(Ql.STRICT).withLocale(Hp.ENGLISH);switch(n){case"date":return bf.parse(e).format(i);case"time":return Af.parse(e).format(i);case"datetime":return Sf.parse(e).format(i);default:return r||om.GENERIC.INVALID}}catch(e){return r||om.GENERIC.INVALID}},e.toLocalDateOrTime=t,e.calculateWithinDaysRange=n,e.calculateDisabledWithinDaysRange=function(e){const{numberOfDays:t,inclusive:r}=e,{startDate:i,endDate:a}=n(e);return t>=0?{startDate:r?i:i.plusDays(1),endDate:a}:{startDate:i,endDate:r?a:a.minusDays(1)}},e.calculateDisabledBeyondDaysRange=function(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||bf.now(),o={startDate:void 0,endDate:void 0};return n>=0?o.startDate=a.plusDays(n+1):o.endDate=a.plusDays(n-1),o},e.checkWithinDays=function(e,r){if(!e)return!0;const{dateFormat:i="uuuu-MM-dd"}=r,a=t(e,i,"date");if(!a)return!1;const{startDate:o,endDate:s}=n(r),{numberOfDays:u,inclusive:c}=r;if(u>=0){const e=c?o.minusDays(1):o,t=s.plusDays(1);return a.isAfter(e)&&a.isBefore(t)}{const e=o.minusDays(1),t=c?s.plusDays(1):s;return a.isAfter(e)&&a.isBefore(t)}},e.checkBeyondDays=function(e,n){if(!e)return!0;const{dateFormat:r="uuuu-MM-dd"}=n,i=t(e,r,"date");if(!i)return!1;const{numberOfDays:a,fromDate:o}=n,s=o&&t(o,r,"date")||bf.now();return a>=0?i.isAfter(s.plusDays(a)):i.isBefore(s.plusDays(a))}}(sm||(sm={})),exports.GeoLocationHelper=void 0,function(e){const t=async(e,t)=>new Promise(((n,r)=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition((({coords:e})=>n({lat:e.latitude,lng:e.longitude})),(e=>r(e)),{enableHighAccuracy:!0,timeout:e,maximumAge:t}):r(new Error("geolocation not supported in this browser"))}));e.getCurrentLocation=async(e={})=>{const{maxAttempts:n=3,timeout:r=2e3,maximumAge:i=2e3}=e;let a=0;do{a++;try{return await t(r,i)}catch(e){if(a>=n||!e||e.code!==e.TIMEOUT)throw e}}while(a<n);throw"Failed to get current location"}}(exports.GeoLocationHelper||(exports.GeoLocationHelper={}));const um=()=>Array(5).fill(0).map((()=>Math.random().toString(36).slice(2))).join("");class cm{constructor(e){if(function(e){return"object"!=typeof e||void 0===e.length||void 0===e.readUInt8||void 0===e.readUInt16LE||void 0===e.readUInt16BE||void 0===e.readUInt32LE||void 0===e.readUInt32BE||void 0===e.readInt32LE||void 0===e.readInt32BE}(e))throw new Error("DataView: Passed buffer type is unsupported.");this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}}function lm(e,t,n){try{return new DataView(e,t,n)}catch(r){return new cm(e,t,n)}}function dm(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return mm(r)}function fm(e,t){const n=[];let r=0;for(;t+r<e.byteLength;){const i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return mm(n)}function pm(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),mm(r)}function hm(e,t){const n=e.getUint8(t);return[n,dm(e,t+1,n)]}function mm(e){return e.map((e=>String.fromCharCode(e))).join("")}function gm(){for(let e=1;e<arguments.length;e++)for(const t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function ym(e,t,n){let r=!1;Object.defineProperty(e,t,{get:()=>(r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]),configurable:!0,enumerable:!0})}function _m(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),((e,t)=>e+String.fromCharCode(t)),"")):"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function vm(e,t){return new Array(t+1).join(e)}const bm=void 0;function Em(e,t,n,r="string"){if(0===t&&"function"==typeof DecompressionStream){const t=new DecompressionStream("deflate"),i=new Blob([e]).stream().pipeThrough(t);return"dataview"===r?new Response(i).arrayBuffer().then((e=>new DataView(e))):new Response(i).arrayBuffer().then((e=>new TextDecoder(n).decode(e)))}return void 0!==t?Promise.reject(`Unknown compression method ${t}.`):e}var Sm=!0,Am=!0;function xm(e){return e.map((e=>String.fromCharCode(e))).join("")}function wm(e){if(e.length>=8){const t=xm(e.slice(0,8));if("ASCII\0\0\0"===t)return xm(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function Tm(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}const Mm=18761,Om=19789;var Cm={BIG_ENDIAN:Om,LITTLE_ENDIAN:Mm,getByteOrder:function(e,t){if(e.getUint16(t)===Mm)return Mm;if(e.getUint16(t)===Om)return Om;throw new Error("Illegal byte order value. Faulty image.")}};var Nm={isTiffFile:function(e){return!!e&&e.byteLength>=4&&function(e){const t=42,n=2,r=e.getUint16(0)===Cm.LITTLE_ENDIAN;return e.getUint16(n,r)===t}(e)},findTiffOffsets:function(){return{hasAppMarkers:!0,tiffHeaderOffset:0}}};var Dm={isJpegFile:function(e){return!!e&&e.byteLength>=Lm&&e.getUint16(0)===Im},findJpegOffsets:function(e){let t,n,r,i,a,o,s,u,c,l=km;for(;l+$m+5<=e.byteLength;){if(fg(e,l))t=e.getUint16(l+Rm),n=l+Rm;else if(pg(e,l))t=e.getUint16(l+Rm),r=l+Rm;else if(gg(e,l))t=e.getUint16(l+Rm),i=l+Fm;else if(yg(e,l))t=e.getUint16(l+Rm),a=l+zm;else if(_g(e,l))s||(s=[]),t=e.getUint16(l+Rm),s.push(bg(l,t));else if(vg(e,l))s||(s=[]),t=e.getUint16(l+Rm),s.push(Eg(l,t));else if(Sg(e,l))t=e.getUint16(l+Rm),o=l+Pm;else if(hg(e,l)){t=e.getUint16(l+Rm);const n=l+Um,r=t-(Um-Rm),i=e.getUint8(l+Hm),a=e.getUint8(l+Gm);u||(u=[]),u.push({offset:n,length:r,chunkNumber:i,chunksTotal:a})}else if(mg(e,l))t=e.getUint16(l+Rm),c=l+Bm;else{if(!Ag(e,l)){if(xg(e,l)){l++;continue}break}t=e.getUint16(l+Rm)}l+=Rm+t}return{hasAppMarkers:l>km,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:a,iptcDataOffset:o,xmpChunks:s,iccChunks:u,mpfDataOffset:c}}};const Lm=2,Im=65496,km=2,$m=4,Rm=2,Fm=2,zm=10,Pm=18,jm=33,Zm=79,Um=18,Bm=8,Vm="ICC_PROFILE\0",Hm=$m+Vm.length,Gm=Hm+1,Ym="MPF\0",Wm=65472,qm=65474,Km=65476,Jm=65499,Xm=65501,Qm=65498,eg=65504,tg=65505,ng=65506,rg=65517,ig=65519,ag=65534,og=65535,sg="JFIF",ug="Exif",cg="http://ns.adobe.com/xap/1.0/\0",lg="http://ns.adobe.com/xmp/extension/\0",dg="Photoshop 3.0";function fg(e,t){return e.getUint16(t)===Wm}function pg(e,t){return e.getUint16(t)===qm}function hg(e,t){const n=Vm.length;return e.getUint16(t)===ng&&dm(e,t+$m,n)===Vm}function mg(e,t){const n=Ym.length;return e.getUint16(t)===ng&&dm(e,t+$m,n)===Ym}function gg(e,t){const n=sg.length;return e.getUint16(t)===eg&&dm(e,t+$m,n)===sg&&0===e.getUint8(t+$m+n)}function yg(e,t){const n=ug.length;return e.getUint16(t)===tg&&dm(e,t+$m,n)===ug&&0===e.getUint8(t+$m+n)}function _g(e,t){return e.getUint16(t)===tg&&function(e,t){const n=cg.length;return dm(e,t+$m,n)===cg}(e,t)}function vg(e,t){return e.getUint16(t)===tg&&function(e,t){const n=lg.length;return dm(e,t+$m,n)===lg}(e,t)}function bg(e,t){return{dataOffset:e+jm,length:t-(jm-Rm)}}function Eg(e,t){return{dataOffset:e+Zm,length:t-(Zm-Rm)}}function Sg(e,t){const n=dg.length;return e.getUint16(t)===rg&&dm(e,t+$m,n)===dg&&0===e.getUint8(t+$m+n)}function Ag(e,t){const n=e.getUint16(t);return n>=eg&&n<=ig||n===ag||n===Wm||n===qm||n===Km||n===Jm||n===Xm||n===Qm}function xg(e,t){return e.getUint16(t)===og}var wg={isPngFile:function(e){return!!e&&dm(e,0,Tg.length)===Tg},findPngOffsets:function(e,t){const n={hasAppMarkers:!1};let r=Tg.length;for(;r+Mg+Og<=e.byteLength;){if(jg(e,r))n.hasAppMarkers=!0,n.pngHeaderOffset=r+Dg;else if(Zg(e,r)){const t=Gg(e,r);void 0!==t&&(n.hasAppMarkers=!0,n.xmpChunks=[{dataOffset:t,length:e.getUint32(r+Cg)-(t-(r+Dg))}])}else if(Ug(e,r,t)){n.hasAppMarkers=!0;const t=dm(e,r+Ng,Og);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+Cg),type:t,offset:r+Dg})}else if(Bg(e,r))n.hasAppMarkers=!0,n.tiffHeaderOffset=r+Dg;else if(t&&Vg(e,r)){n.hasAppMarkers=!0;const t=e.getUint32(r+Cg),i=r+Dg,{profileName:a,compressionMethod:o,compressedProfileOffset:s}=Yg(e,i);n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:s,length:t-(s-i),chunkNumber:1,chunksTotal:1,profileName:a,compressionMethod:o})}else Hg(e,r)&&(n.hasAppMarkers=!0,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+Cg));r+=e.getUint32(r+Cg)+Mg+Og+4}return n}};const Tg="PNG\r\n\n",Mg=4,Og=4,Cg=0,Ng=Mg,Dg=Mg+Og,Lg="XML:com.adobe.xmp\0",Ig="tEXt",kg="iTXt",$g="zTXt",Rg="pHYs",Fg="tIME",zg="eXIf",Pg="iCCP";function jg(e,t){return"IHDR"===dm(e,t+Ng,Og)}function Zg(e,t){return dm(e,t+Ng,Og)===kg&&dm(e,t+Dg,Lg.length)===Lg}function Ug(e,t,n){const r=dm(e,t+Ng,Og);return r===Ig||r===kg||r===$g&&n}function Bg(e,t){return dm(e,t+Ng,Og)===zg}function Vg(e,t){return dm(e,t+Ng,Og)===Pg}function Hg(e,t){const n=[Rg,Fg],r=dm(e,t+Ng,Og);return n.includes(r)}function Gg(e,t){t+=Dg+Lg.length+1+1;let n=0;for(;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function Yg(e,t){const n=fm(e,t);t+=n.length+1;return{profileName:n,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}function Wg(e,t,n,r){const{offsets:i,sizes:a}=function(e,t){const n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4);n.item.constructionMethod=1===e||2===e?2:0;const r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),o=e.getUint8(i.offsetSize)>>4;a.item.extent.extentOffset=o;const s=15&e.getUint8(i.lengthSize);a.item.extent.extentLength=s;const u=e.getUint8(i.baseOffsetSize)>>4;a.item.baseOffset=u;const c=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t);return}(e,i.indexSize,t);a.item.extent.extentIndex=void 0!==c?c:0;const l=function(e,t,n){if(n<2)return e.getUint16(t);if(2===n)return e.getUint32(t);return}(e,i.itemCount,t);return{type:"iloc",items:qg(e,t,i,a,o,s,c,l),length:r}}function qg(e,t,n,r,i,a,o,s){if(void 0===s)return[];const u=[];let c=n.items;for(let n=0;n<s;n++){const n={extents:[]};n.itemId=Kg(e,c,t),c+=r.item.itemId,n.constructionMethod=1===t||2===t?15&e.getUint16(c):void 0,c+=r.item.constructionMethod,n.dataReferenceIndex=e.getUint16(c),c+=r.item.dataReferenceIndex,n.baseOffset=Xg(e,c,r.item.baseOffset),c+=r.item.baseOffset,n.extentCount=e.getUint16(c),c+=r.item.extentCount;for(let s=0;s<n.extentCount;s++){const s={};s.extentIndex=Jg(e,t,c,o),c+=r.item.extent.extentIndex,s.extentOffset=Xg(e,c,i),c+=r.item.extent.extentOffset,s.extentLength=Xg(e,c,a),c+=r.item.extent.extentLength,n.extents.push(s)}u.push(n)}return u}function Kg(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function Jg(e,t,n,r){if((1===t||2===t)&&r>0)return Xg(e,n,r)}function Xg(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}const Qg=1165519206,ey=1835625829,ty=1970432288;function ny(e,t){const{length:n,contentOffset:r}=function(e,t){const n=4,r=4,i=8,a=12,o=e.getUint32(t);if(function(e){return 0===e}(o))return{length:e.byteLength-t,contentOffset:t+n+r};if(function(e){return 1===e}(o)&&function(e,t){const n=8;return 0===e.getUint32(t+n)}(e,t))return{length:e.getUint32(t+a),contentOffset:t+n+r+i};return{length:o,contentOffset:t+n+r}}(e,t);if(n<8)return;const i=e.getUint32(t+4);if(1718909296===i)return function(e,t,n){const r=dm(e,t,4);return{type:"ftyp",majorBrand:r,length:n}}(e,r,n);if(1768977008===i)return function(e,t,n,r){return{type:"iprp",subBoxes:oy(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1768973167===i)return function(e,t,n,r){return{type:"ipco",properties:oy(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1668246642===i)return function(e,t,n){return{type:"colr",icc:ay(e,t),length:n}}(e,r,n);const a=e.getUint8(r);return 1835365473===i?function(e,t,n,r){const i=3;return{type:"meta",subBoxes:oy(e,n+i,r-(n+i-t)),length:r}}(e,t,r+1,n):1768714083===i?Wg(e,a,r+1,n):1768517222===i?function(e,t,n,r,i){const{offsets:a}=function(e,t){const n={entryCount:t+3},r={};r.entryCount=0===e?2:4;return n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r);return{type:"iinf",itemInfos:oy(e,a.itemInfos,i-(a.itemInfos-t)),length:i}}(e,t,a,r+1,n):1768842853===i?function(e,t,n,r,i){r+=3;const a={type:"infe",length:i};0!==n&&1!==n||(a.itemId=e.getUint16(r),r+=2,a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemName=fm(e,r),r+=a.itemName.length+1);n>=2&&(2===n?(a.itemId=e.getUint16(r),r+=2):3===n&&(a.itemId=e.getUint32(r),r+=4),a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemType=e.getUint32(r),r+=4,a.itemName=fm(e,r),r+=a.itemName.length+1,a.itemType===ey?(a.contentType=fm(e,r),t+i>(r+=a.contentType.length+1)&&(a.contentEncoding=fm(e,r),r+=a.contentEncoding.length+1)):a.itemType===ty&&(a.itemUri=fm(e,r),r+=a.itemUri.length+1));return a}(e,t,a,r+1,n):{type:void 0,length:n}}function ry(e){{const t={},n=function(e){const t=4,n=4;let r=0;for(;r+t+n<=e.byteLength;){const t=ny(e,r);if(void 0===t)break;if("meta"===t.type)return t;r+=t.length}return}(e);return n?(t.tiffHeaderOffset=function(e,t){try{const n=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===Qg))}(t).itemId,r=iy(t,n);return function(e,t){return t+4+e.getUint32(t)}(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n),t.xmpChunks=function(e){try{const t=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===ey&&"application/rdf+xml"===e.contentType))}(e).itemId,n=iy(e,t),r=iy(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n),t.iccChunks=function(e){try{const t=e.subBoxes.find((e=>"iprp"===e.type)).subBoxes.find((e=>"ipco"===e.type)).properties.find((e=>"colr"===e.type)).icc;if(t)return[t]}catch(e){}return}(n),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:!1}}}function iy(e,t){return e.subBoxes.find((e=>"iloc"===e.type)).items.find((e=>e.itemId===t))}function ay(e,t){const n=dm(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function oy(e,t,n){const r=[Qg,ey],i=[];let a=t;for(;a<t+n;){const t=ny(e,a);if(void 0===t)break;void 0===t.type||void 0!==t.itemType&&-1===r.indexOf(t.itemType)||i.push(t),a+=t.length}return i}var sy={isHeicFile:function(e){if(!e)return!1;const t=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const n=ny(e,0);return n&&-1!==t.indexOf(n.majorBrand)}catch(e){return!1}},findHeicOffsets:function(e){return ry(e)}};var uy={isAvifFile:function(e){if(!e)return!1;try{const t=ny(e,0);return t&&"avif"===t.majorBrand}catch(e){return!1}},findAvifOffsets:function(e){return ry(e)}};var cy={isWebpFile:function(e){const t="RIFF",n="WEBP";return!!e&&dm(e,0,4)===t&&dm(e,8,4)===n},findOffsets:function(e){const t="Exif\0\0";let n,r,i,a,o=12,s=!1;for(;o+8<e.byteLength;){const u=dm(e,o,4),c=e.getUint32(o+4,!0);"EXIF"===u?(s=!0,n=dm(e,o+8,6)===t?o+8+6:o+8):"XMP "===u?(s=!0,r=[{dataOffset:o+8,length:c}]):"ICCP"===u?(s=!0,i=[{offset:o+8,length:c,chunkNumber:1,chunksTotal:1}]):"VP8X"===u&&(s=!0,a=o+8),o+=8+(c%2==0?c:c+1)}return{hasAppMarkers:s,tiffHeaderOffset:n,xmpChunks:r,iccChunks:i,vp8xChunkOffset:a}}};var ly={isGifFile:function(e){return!!e&&fy.includes(dm(e,0,dy))},findOffsets:function(){return{gifHeaderOffset:0}}};const dy=6,fy=["GIF87a","GIF89a"];var py={isXMLFile:function(e){return!!e&&dm(e,hy,my.length)===my},findOffsets:function(e){const t=[];return t.push({dataOffset:hy,length:e.byteLength}),{xmpChunks:t}}};const hy=0,my="<?xpacket begin";var gy={parseAppMarkers:function(e,t){if(Nm.isTiffFile(e))return yy(Nm.findTiffOffsets(),"tiff","TIFF");if(Dm.isJpegFile(e))return yy(Dm.findJpegOffsets(e),"jpeg","JPEG");if(wg.isPngFile(e))return yy(wg.findPngOffsets(e,t),"png","PNG");if(sy.isHeicFile(e))return yy(sy.findHeicOffsets(e),"heic","HEIC");if(uy.isAvifFile(e))return yy(uy.findAvifOffsets(e),"avif","AVIF");if(cy.isWebpFile(e))return yy(cy.findOffsets(e),"webp","WebP");if(ly.isGifFile(e))return yy(ly.findOffsets(e),"gif","GIF");if(py.isXMLFile(e))return yy(py.findOffsets(e),"xml","XML");throw new Error("Invalid image format")}};function yy(e,t,n){return gm({},e,{fileType:{value:t,description:n}})}var _y={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace:e=>1===e?"sRGB":65535===e?"Uncalibrated":"Unknown",ComponentsConfiguration:e=>e.map((e=>49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0)).join(""),Contrast:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",CustomRendered:e=>0===e?"Normal process":1===e?"Custom process":"Unknown",ExposureMode:e=>0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown",ExposureProgram:e=>0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown",ExposureTime(e){if(e[0]/e[1]>.25){const t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[0]?`1/${Math.round(e[1]/e[0])}`:`0/${e[1]}`},FNumber:e=>"f/"+e[0]/e[1],FocalLength:e=>e[0]/e[1]+" mm",FocalPlaneResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",LightSource:e=>1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown",MeteringMode:e=>1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown",ResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",Saturation:e=>0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown",SceneCaptureType:e=>0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown",Sharpness:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",ShutterSpeedValue(e){const t=Math.pow(2,e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance:e=>0===e?"Auto white balance":1===e?"Manual white balance":"Unknown",XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},vy={11:"ProcessingSoftware",254:{name:"SubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"}[e]||"Unknown")},255:{name:"OldSubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"}[e]||"Unknown")},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:e=>({1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"}[e]||"Unknown")},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:e=>({1:"Normal",2:"Reversed"}[e]||"Unknown")},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:e=>1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:_y.XResolution},283:{name:"YResolution",description:_y.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:e=>""+Math.round(e[0]/e[1])},287:{name:"YPosition",description:e=>""+Math.round(e[0]/e[1])},290:{name:"GrayResponseUnit",description:e=>({1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"}[e]||"Unknown")},296:{name:"ResolutionUnit",description:_y.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:e=>({1:"CMYK",2:"Not CMYK"}[e]||"Unknown")},337:"TargetPrinter",338:{name:"ExtraSamples",description:e=>({0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"}[e]||"Unknown")},339:{name:"SampleFormat",description:e=>{const t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((e=>t[e]||"Unknown")).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map((e=>""+e[0]/e[1])).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>1===e?"centered":2===e?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map((e=>""+e[0]/e[1])).join(", ")},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:e=>e.join("; ")},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:by},40092:{name:"XPComment",description:by},40093:{name:"XPAuthor",description:by},40094:{name:"XPKeywords",description:by},40095:{name:"XPSubject",description:by},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:e=>({0:"Unsafe",1:"Safe"}[e]||"Unknown")},50778:{name:"CalibrationIlluminant1",description:_y.LightSource},50779:{name:"CalibrationIlluminant2",description:_y.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50885:"SRawType",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:{name:"ProfileEmbedPolicy",description:e=>({0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"}[e]||"Unknown")},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:e=>({1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"}[e]||"Unknown")},50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:{name:"ProfileHueSatMapEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51108:{name:"ProfileLookTableEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:e=>({0:"Auto",1:"None"}[e]||"Unknown")},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function by(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}var Ey={33434:{name:"ExposureTime",description:_y.ExposureTime},33437:{name:"FNumber",description:_y.FNumber},34850:{name:"ExposureProgram",description:_y.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:e=>({1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"}[e]||"Unknown")},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:e=>xm(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:_y.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:_y.ShutterSpeedValue},37378:{name:"ApertureValue",description:_y.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},37382:{name:"SubjectDistance",description:e=>e[0]/e[1]+" m"},37383:{name:"MeteringMode",description:_y.MeteringMode},37384:{name:"LightSource",description:_y.LightSource},37385:{name:"Flash",description:e=>0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:_y.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:e=>({C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"}[e]||"Unknown")},37395:"ImageHistory",37396:{name:"SubjectArea",description:e=>2===e.length?`Location; X: ${e[0]}, Y: ${e[1]}`:3===e.length?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:4===e.length?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:wm},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:e=>e[0]/e[1]+" °C"},37889:{name:"Humidity",description:e=>e[0]/e[1]+" %"},37890:{name:"Pressure",description:e=>e[0]/e[1]+" hPa"},37891:{name:"WaterDepth",description:e=>e[0]/e[1]+" m"},37892:{name:"Acceleration",description:e=>e[0]/e[1]+" mGal"},37893:{name:"CameraElevationAngle",description:e=>e[0]/e[1]+" °"},40960:{name:"FlashpixVersion",description:e=>e.map((e=>String.fromCharCode(e))).join("")},40961:{name:"ColorSpace",description:_y.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:_y.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,t])=>`X: ${e}, Y: ${t}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>3===e?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>1===e?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:_y.CustomRendered},41986:{name:"ExposureMode",description:_y.ExposureMode},41987:{name:"WhiteBalance",description:_y.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>0===e[0]?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:e=>0===e?"Unknown":e},41990:{name:"SceneCaptureType",description:_y.SceneCaptureType},41991:{name:"GainControl",description:e=>0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"},41992:{name:"Contrast",description:_y.Contrast},41993:{name:"Saturation",description:_y.Saturation},41994:{name:"Sharpness",description:_y.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;if(0===e[3][1])return`${t} f/?`;const n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${t} f/${parseFloat(n.toFixed(5))}`}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:e=>({1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}[e]||"Unknown")},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",42240:"Gamma",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},Sy={0:{name:"GPSVersionID",description:e=>2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:Tm},3:{name:"GPSLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:Tm},5:{name:"GPSAltitudeRef",description:e=>0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map((([e,t])=>{const n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n})).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:"GPSDestLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:"GPSDestBearingRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:wm},28:{name:"GPSAreaInformation",description:wm},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},Ay={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>xm(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},xy={45056:{name:"MPFVersion",description:e=>xm(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};const wy=gm({},vy,Ey),Ty="0th",My="1st",Oy="exif",Cy="gps",Ny="interoperability",Dy="mpf",Ly="canon";var Iy={[Ty]:wy,[My]:vy,[Oy]:wy,[Cy]:Sy,[Ny]:Ay,[Dy]:xy,[Ly]:{4:{name:"ShotInfo",description:e=>e}}};const ky={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},$y={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13};var Ry={getAsciiValue:function(e){return e.map((e=>String.fromCharCode(e)))},getByteAt:Fy,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===Cm.LITTLE_ENDIAN)},getLongAt:zy,getRationalAt:function(e,t,n){return[zy(e,t,n),zy(e,t+4,n)]},getUndefinedAt:function(e,t){return Fy(e,t)},getSlongAt:Py,getSrationalAt:function(e,t,n){return[Py(e,t,n),Py(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return zy(e,t,n)},typeSizes:ky,tagTypes:$y,getTypeSize:function(e){if(void 0===$y[e])throw new Error("No such type found.");return ky[$y[e]]}};function Fy(e,t){return e.getUint8(t)}function zy(e,t,n){return e.getUint32(t,n===Cm.LITTLE_ENDIAN)}function Py(e,t,n){return e.getInt32(t,n===Cm.LITTLE_ENDIAN)}const jy={1:Ry.getByteAt,2:Ry.getAsciiAt,3:Ry.getShortAt,4:Ry.getLongAt,5:Ry.getRationalAt,7:Ry.getUndefinedAt,9:Ry.getSlongAt,10:Ry.getSrationalAt,13:Ry.getIfdPointerAt};function Zy(e,t,n){return t+Ry.getLongAt(e,t+4,n)}function Uy(e,t,n,r,i,a){const o=Ry.getTypeSize("SHORT"),s={},u=function(e,t,n){if(t+Ry.getTypeSize("SHORT")<=e.byteLength)return Ry.getShortAt(e,t,n);return 0}(e,r,i);r+=o;for(let o=0;o<u&&!(r+12>e.byteLength);o++){const o=By(e,t,n,r,i,a);void 0!==o&&(s[o.name]={id:o.id,value:o.value,description:o.description},"MakerNote"===o.name&&(s[o.name].__offset=o.__offset)),r+=12}if(r<e.byteLength-Ry.getTypeSize("LONG")){const o=Ry.getLongAt(e,r,i);0!==o&&t===Ty&&(s.Thumbnail=Uy(e,"1st",n,n+o,i,a))}return s}function By(e,t,n,r,i,a){const o=Ry.getTypeSize("SHORT"),s=o+Ry.getTypeSize("SHORT"),u=s+Ry.getTypeSize("LONG"),c=Ry.getShortAt(e,r,i),l=Ry.getShortAt(e,r+o,i),d=Ry.getLongAt(e,r+s,i);let f,p;if(void 0===Ry.typeSizes[l]||!a&&void 0===Iy[t][c])return;if(function(e,t){return Ry.typeSizes[e]*t<=Ry.getTypeSize("LONG")}(l,d))p=r+u,f=Vy(e,p,l,d,i);else if(p=Ry.getLongAt(e,r+u,i),function(e,t,n,r,i){return t+n+Ry.typeSizes[r]*i<=e.byteLength}(e,n,p,l,d)){f=Vy(e,n+p,l,d,i,33723===c)}else f="<faulty value>";l===Ry.tagTypes.ASCII&&(f=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(f),f=function(e){try{return e.map((e=>decodeURIComponent(escape(e))))}catch(t){return e}}(f));let h=`undefined-${c}`,m=f;if(void 0!==Iy[t][c])if(void 0!==Iy[t][c].name&&void 0!==Iy[t][c].description){h=Iy[t][c].name;try{m=Iy[t][c].description(f)}catch(e){m=Hy(f)}}else l===Ry.tagTypes.RATIONAL||l===Ry.tagTypes.SRATIONAL?(h=Iy[t][c],m=""+f[0]/f[1]):(h=Iy[t][c],m=Hy(f));return{id:c,name:h,value:f,description:m,__offset:p}}function Vy(e,t,n,r,i,a=!1){let o=[];a&&(r*=Ry.typeSizes[n],n=Ry.tagTypes.BYTE);for(let a=0;a<r;a++)o.push(jy[n](e,t,i)),t+=Ry.typeSizes[n];return n===Ry.tagTypes.ASCII?o=Ry.getAsciiValue(o):1===o.length&&(o=o[0]),o}function Hy(e){return e instanceof Array?e.join(", "):e}const Gy="Exif IFD Pointer",Yy="GPS Info IFD Pointer",Wy="Interoperability IFD Pointer";var qy={read:function(e,t,n){const r=Cm.getByteOrder(e,t);let i=function(e,t,n,r){return Uy(e,Ty,t,Zy(e,t,n),n,r)}(e,t,r,n);return i=Ky(i,e,t,r,n),i=Jy(i,e,t,r,n),i=Xy(i,e,t,r,n),{tags:i,byteOrder:r}}};function Ky(e,t,n,r,i){return void 0!==e[Gy]?gm(e,Uy(t,Oy,n,n+e[Gy].value,r,i)):e}function Jy(e,t,n,r,i){return void 0!==e[Yy]?gm(e,Uy(t,"gps",n,n+e[Yy].value,r,i)):e}function Xy(e,t,n,r,i){return void 0!==e[Wy]?gm(e,Uy(t,Ny,n,n+e[Wy].value,r,i)):e}var Qy={read:function(e,t,n){const r=Cm.getByteOrder(e,t),i=Uy(e,"mpf",t,Zy(e,t,r),r,n);return function(e,t,n,r){if(!n.MPEntry)return n;const i=[];for(let a=0;a<Math.ceil(n.MPEntry.value.length/e_);a++){i[a]={};const o=t_(n.MPEntry.value,a*e_,Ry.getTypeSize("LONG"),r);i[a].ImageFlags=n_(o),i[a].ImageFormat=r_(o),i[a].ImageType=i_(o);const s=t_(n.MPEntry.value,a*e_+4,Ry.getTypeSize("LONG"),r);i[a].ImageSize={value:s,description:""+s};const u=a_(a,n.MPEntry,r,t);i[a].ImageOffset={value:u,description:""+u};const c=t_(n.MPEntry.value,a*e_+12,Ry.getTypeSize("SHORT"),r);i[a].DependentImage1EntryNumber={value:c,description:""+c};const l=t_(n.MPEntry.value,a*e_+14,Ry.getTypeSize("SHORT"),r);i[a].DependentImage2EntryNumber={value:l,description:""+l},i[a].image=e.buffer.slice(u,u+s),ym(i[a],"base64",(function(){return _m(this.image)}))}return n.Images=i,n}(e,t,i,r)}};const e_=16;function t_(e,t,n,r){if(r===Cm.LITTLE_ENDIAN){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function n_(e){const t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function r_(e){const t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function i_(e){const t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function a_(e,t,n,r){return function(e){return 0===e}(e)?0:t_(t.value,e*e_+8,Ry.getTypeSize("LONG"),n)+r}var o_={read:function(e,t){const n=function(e,t){return Ry.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=7;if(r+1>n)return;const i=Ry.getByteAt(e,t+r);return{value:i,description:""+i}}(e,t,n);return{"Bits Per Sample":s_(e,t,n),"Image Height":u_(e,t,n),"Image Width":c_(e,t,n),"Color Components":r,Subsampling:r&&l_(e,t,r.value,n)}}};function s_(e,t,n){if(3>n)return;const r=Ry.getByteAt(e,t+2);return{value:r,description:""+r}}function u_(e,t,n){if(5>n)return;const r=Ry.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function c_(e,t,n){if(7>n)return;const r=Ry.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function l_(e,t,n,r){if(8+3*n>r)return;const i=[];for(let r=0;r<n;r++){const n=t+8+3*r;i.push([Ry.getByteAt(e,n),Ry.getByteAt(e,n+1),Ry.getByteAt(e,n+2)])}return{value:i,description:i.length>1?d_(i)+f_(i):""}}function d_(e){const t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((e=>t[e[0]])).join("")}function f_(e){const t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var p_={read:function(e,t){const n=function(e,t){return Ry.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=14;if(r+1>n)return;const i=Ry.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),i=function(e,t,n){const r=15;if(r+1>n)return;const i=Ry.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),a={"JFIF Version":h_(e,t,n),"Resolution Unit":m_(e,t,n),XResolution:y_(e,t,n),YResolution:__(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){const o=function(e,t,n,r){const i=16;if(0===n||i+n>r)return;const a=e.buffer.slice(t+i,t+i+n);return{value:a,description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);o&&(a["JFIF Thumbnail"]=o)}for(const e in a)void 0===a[e]&&delete a[e];return a}};function h_(e,t,n){if(9>n)return;const r=Ry.getByteAt(e,t+7),i=Ry.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}function m_(e,t,n){if(10>n)return;const r=Ry.getByteAt(e,t+9);return{value:r,description:g_(r)}}function g_(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function y_(e,t,n){if(12>n)return;const r=Ry.getShortAt(e,t+10);return{value:r,description:""+r}}function __(e,t,n){if(14>n)return;const r=Ry.getShortAt(e,t+12);return{value:r,description:""+r}}var v_={iptc:{256:{name:"Model Version",description:e=>((e[0]<<8)+e[1]).toString()},261:{name:"Destination",repeatable:!0},276:{name:"File Format",description:e=>((e[0]<<8)+e[1]).toString()},278:{name:"File Format Version",description:e=>((e[0]<<8)+e[1]).toString()},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:b_},336:{name:"Time Sent",description:E_},346:{name:"Coded Character Set",description:S_,encoding_name:S_},356:"UNO",376:{name:"ARM Identifier",description:e=>((e[0]<<8)+e[1]).toString()},378:{name:"ARM Version",description:e=>((e[0]<<8)+e[1]).toString()},512:{name:"Record Version",description:e=>((e[0]<<8)+e[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:e=>"01"===xm(e)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const t=xm(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:e=>{const t=xm(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:b_},572:{name:"Time Created",description:E_},574:{name:"Digital Creation Date",description:b_},575:{name:"Digital Creation Time",description:E_},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const t=xm(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:e=>e},642:"Image Type",643:{name:"Image Orientation",description:e=>{const t=xm(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const t=xm(e),n=t.charAt(0),r=t.charAt(1);let i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:e=>parseInt(xm(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const t=parseInt(xm(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const t=xm(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>2===e.length?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(2===e.length){const t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":`Unknown format ${t}`}return xm(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,t)=>{const n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=xm(e);if(t["ObjectData Preview File Format"]){const e=xm(t["ObjectData Preview File Format"].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function b_(e){const t=xm(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function E_(e){const t=xm(e);let n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function S_(e){const t=xm(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var A_={get:function(){if("undefined"!=typeof TextDecoder)return TextDecoder;return}};var x_={decode:function(e,t){const n=A_.get();if(void 0!==n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((e=>String.fromCharCode(e))).join(""))},TAG_HEADER_SIZE:5};var w_={read:function(e,t,n){try{if(Array.isArray(e))return C_(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n);const{naaBlock:r,dataOffset:i}=function(e,t){for(;t+12<=e.byteLength;){const n=T_(e,t);if(M_(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+O_(n)}throw new Error("No IPTC NAA resource block.")}(e,t);return C_(e,r,i,n)}catch(e){return{}}}};function T_(e,t){if(943868237!==e.getUint32(t,!1))throw new Error("Not an IPTC resource block.");const n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function M_(e){return 1028===e.type}function O_(e){return e.size%2!=0?1:0}function C_(e,t,n,r){const i={};let a;const o=n+t.size;for(;n<o&&n<e.byteLength;){const{tag:t,tagSize:o}=N_(e,n,i,a,r);if(null===t)break;t&&("encoding"in t&&(a=t.encoding),void 0===i[t.name]||void 0===t.repeatable?i[t.name]={id:t.id,value:t.value,description:t.description}:(i[t.name]instanceof Array||(i[t.name]=[{id:i[t.name].id,value:i[t.name].value,description:i[t.name].description}]),i[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=5+o}return i}function N_(e,t,n,r,i){if(function(e,t){const n=28;return e.getUint8(t)!==n}(e,t))return{tag:null,tagSize:0};const a=e.getUint16(t+1),o=e.getUint16(t+3);if(!i&&!v_.iptc[a])return{tag:void 0,tagSize:o};const s=function(e,t,n){const r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,o),u={id:a,name:D_(v_.iptc[a],a,s),value:s,description:L_(v_.iptc[a],s,n,r)};return function(e){return v_.iptc[e]&&v_.iptc[e].repeatable}(a)&&(u.repeatable=!0),function(e){return v_.iptc[e]&&void 0!==v_.iptc[e].encoding_name}(a)&&(u.encoding=v_.iptc[a].encoding_name(s)),{tag:u,tagSize:o}}function D_(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:`undefined-${t}`}function L_(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?x_.decode(r,t):t}var I_={"tiff:Orientation":e=>"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e,"tiff:ResolutionUnit":e=>_y.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>k_(_y.XResolution,e),"tiff:YResolution":e=>k_(_y.YResolution,e),"exif:ApertureValue":e=>k_(_y.ApertureValue,e),"exif:GPSLatitude":R_,"exif:GPSLongitude":R_,"exif:FNumber":e=>k_(_y.FNumber,e),"exif:FocalLength":e=>k_(_y.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>_y.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>_y.ColorSpace(function(e){if("0x"===e.substring(0,2))return parseInt(e.substring(2),16);return parseInt(e,10)}(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){const e=t.split(", ").map((e=>e.charCodeAt(0)));return _y.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>_y.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>_y.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>_y.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>_y.ExposureProgram(parseInt(e,10)),"exif:ExposureTime":e=>$_(e)?_y.ExposureTime(e.split("/").map((e=>parseInt(e,10)))):e,"exif:MeteringMode":e=>_y.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>_y.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>_y.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>_y.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>k_(_y.ShutterSpeedValue,e),"exif:WhiteBalance":e=>_y.WhiteBalance(parseInt(e,10))};function k_(e,t){return $_(t)?e(t.split("/")):t}function $_(e){return/^-?\d+\/-?\d+$/.test(e)}function R_(e){const[t,n]=e.split(",");if(void 0!==t&&void 0!==n){const e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return""+(e+r/60)+i}return e}var F_={get:function(e){if(e)return e;if("undefined"!=typeof DOMParser)return new DOMParser;try{const{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new e({onError:t})}catch(e){return}}};function z_(e){const t=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!t)return e;const n=t[1],r=function(e){const t=[],n=/xmlns:([\w-]+)=["'][^"']+["']/g;let r;for(;null!==(r=n.exec(e));)-1===t.indexOf(r[1])&&t.push(r[1]);return t}(e),i=function(e){const t=[],n=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let r;for(;null!==(r=n.exec(e));){const e=r[1];"xmlns"!==e&&"xml"!==e&&(-1===t.indexOf(e)&&t.push(e))}return t}(e),a=i.filter((e=>-1===r.indexOf(e)));if(0===a.length)return e;const o=function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=P_[r]||"http://fallback.namespace/"+r;t.push(" xmlns:"+r+'="'+i+'"')}return t.join("")}(a);return function(e,t,n){const r=new RegExp("<"+t+"([^>]*)>");return e.replace(r,"<"+t+"$1"+n+">")}(e,n,o)}const P_={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};var j_={read:function(e,t,n){const r={};if("string"==typeof e)return B_(r,e,n),r;const[i,a]=function(e,t){if(0===t.length)return[];const n=[U_(e,t.slice(0,1))];t.length>1&&n.push(U_(e,t.slice(1)));return n}(e,t),o=B_(r,i,n);if(a){const i=B_(r,a,n);o||i||(delete r._raw,B_(r,U_(e,t),n))}return r}};class Z_ extends Error{constructor(e){super(e),this.name="ParseError"}}function U_(e,t){const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;for(let n=0;n<t.length;n++){const a=t[n],o=e.buffer.slice(a.dataOffset,a.dataOffset+a.length);r.set(new Uint8Array(o),i),i+=a.length}return new DataView(r.buffer)}function B_(e,t,n){try{const{doc:r,raw:i}=function(e,t){const n=F_.get(t);if(!n)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const r="string"==typeof e?e:dm(e,0,e.byteLength),i=V_(n,(a=r,a.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")));var a;return{doc:i,raw:r}}(t,n);e._raw=(e._raw||"")+i;return gm(e,W_(G_(H_(r),!0))),!0}catch(e){return!1}}function V_(e,t,n=!1){try{const n=e.parseFromString(t,"application/xml"),r=n.getElementsByTagName("parsererror");if(r.length>0)throw new Z_(r[0].textContent);return n}catch(r){if("ParseError"===r.name&&function(e){const t=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/];for(let n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}(r)&&!n)return V_(e,z_(t),!0);throw r}}function H_(e){for(let t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return H_(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw new Error}function G_(e,t=!1){const n=function(e){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(r=n).length&&"#text"===r[0].nodeName?t?{}:function(e){return e.nodeValue}(n[0]):function(e){const t={};return e.forEach((e=>{if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){const n=function(e){return{attributes:Y_(e),value:G_(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(n);var r}function Y_(e){const t={};for(let n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function W_(e){const t={};if("string"==typeof e)return e;for(const n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach((e=>{gm(t,q_(e.attributes)),"object"==typeof e.value&&gm(t,tv(e.value))}))}return t}function q_(e){const t={};for(const n in e)try{K_(n)&&(t[X_(n)]={value:e[n],attributes:{},description:Q_(e[n],n)})}catch(e){}return t}function K_(e){return"rdf:parseType"!==e&&!J_(e)}function J_(e){return"xmlns"===e.split(":")[0]}function X_(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function Q_(e,t=void 0){if(Array.isArray(e)){const n=function(e){return e.map((e=>void 0!==e.value?Q_(e.value):Q_(e))).join(", ")}(e);return t&&"function"==typeof I_[t]?I_[t](e,n):n}if("object"==typeof e)return function(e){const t=[];for(const n in e)t.push(`${ev(n)}: ${Q_(e[n].value)}`);return t.join("; ")}(e);try{return t&&"function"==typeof I_[t]?I_[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function ev(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function tv(e){const t={};for(const n in e)try{J_(n)||(t[X_(n)]=nv(e[n],n))}catch(e){}return t}function nv(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return dv(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:rv(e)?iv(e,t):ov(e)?sv(e,t):uv(e)?cv(e,t):function(e){return void 0!==lv(e.value)}(e)?function(e,t){let n=lv(e.value).value["rdf:li"];const r=av(e),i=[];void 0===n?n=[]:Array.isArray(n)||(n=[n]);return n.forEach((e=>{i.push(function(e){if(rv(e))return iv(e);if(ov(e))return sv(e).value;if(uv(e))return cv(e).value;return dv(e)}(e))})),{value:i,attributes:r,description:Q_(i,t)}}(e,t):dv(e,t)}function rv(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function iv(e,t){const n=av(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),gm(n,av(e),function(e){const t={};for(const n in e.value)"rdf:value"===n||J_(n)||(t[X_(n)]=e.value[n].value);return t}(e));const r=function(e){return fv(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:Q_(r,t)}}function av(e){const t={};for(const n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||J_(n)||(t[X_(n)]=e.attributes[n]);return t}function ov(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function sv(e,t){const n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(gm(n.value,q_(e.value["rdf:Description"].attributes)),gm(n.attributes,av(e)),e=e.value["rdf:Description"]),gm(n.value,tv(e.value)),n.description=Q_(n.value,t),n}function uv(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function cv(e,t){const n=q_(e.attributes);return{value:n,attributes:{},description:Q_(n,t)}}function lv(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function dv(e,t){const n=fv(e)||W_(e.value);return{value:n,attributes:av(e),description:Q_(n,t)}}function fv(e){return e.attributes&&e.attributes["rdf:resource"]}const pv=0,hv=1,mv=2,gv=3,yv=4,_v=5,vv=6,bv=7,Ev=8;var Sv={2e3:{name:"PathInformation",description:function(e){const t={},n=[];for(let r=0;r<e.byteLength;r+=26){const i=Ry.getShortAt(e,r);Av[i]&&(t[i]||(t[i]=Av[i].description),n.push({type:i,path:Av[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description(e){const[,t]=hm(e,0);return t}}};const Av={[pv]:{description:"Closed subpath length",path:(e,t)=>[Ry.getShortAt(e,t)]},[hv]:{description:"Closed subpath Bezier knot, linked",path:xv},[mv]:{description:"Closed subpath Bezier knot, unlinked",path:xv},[gv]:{description:"Open subpath length",path:(e,t)=>[Ry.getShortAt(e,t)]},[yv]:{description:"Open subpath Bezier knot, linked",path:xv},[_v]:{description:"Open subpath Bezier knot, unlinked",path:xv},[vv]:{description:"Path fill rule",path:()=>[]},[Ev]:{description:"Initial fill rule",path:(e,t)=>[Ry.getShortAt(e,t)]},[bv]:{description:"Clipboard",path:function(e,t){return[[Tv(e,t,8),Tv(e,t+4,8),Tv(e,t+8,8),Tv(e,t+12,8)],Tv(e,t+16,8)]}}};function xv(e,t){const n=[];for(let r=0;r<24;r+=8)n.push(wv(e,t+r));return n}function wv(e,t){const n=Tv(e,t,8);return[Tv(e,t+4,8),n]}function Tv(e,t,n){const r=Ry.getLongAt(e,t),i=r>>>31==0?1:-1,a=(2130706432&r)>>>32-n,o=r&parseInt(vm("1",32-n),2);return i*function(e,t){return parseInt(e.replace(".",""),t)/Math.pow(t,(e.split(".")[1]||"").length)}(a.toString(2)+"."+function(e,t,n){return vm(n,t-e.length)+e}(o.toString(2),32-n,"0"),2)}var Mv={read:function(e,t){const n=lm(new Uint8Array(e).buffer),r={};let i=0;for(;i<e.length;){const e=dm(n,i,Dv);i+=Dv;const a=Ry.getShortAt(n,i);i+=Cv;const{tagName:o,tagNameSize:s}=Lv(n,i);i+=s;const u=Ry.getLongAt(n,i);if(i+=Nv,e===Ov){const e=lm(n.buffer,i,u),s={id:a,value:dm(e,0,u)};if(Sv[a]){try{s.description=Sv[a].description(e)}catch(e){s.description="<no description formatter>"}r[o||Sv[a].name]=s}else t&&(r[`undefined-${a}`]=s)}i+=u+u%2}return r}};const Ov="8BIM",Cv=2,Nv=4,Dv=Ov.length;function Lv(e,t){const[n,r]=hm(e,t);return{tagName:r,tagNameSize:1+n+(n%2==0?1:0)}}const Iv={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},kv={4:{name:"Preferred CMM type",value:(e,t)=>dm(e,t,4),description:e=>null!==e?$v(e):""},8:{name:"Profile Version",value:(e,t)=>e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,t)=>dm(e,t,4),description:e=>{switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:(e,t)=>dm(e,t,4)},20:{name:"Connection Space",value:(e,t)=>dm(e,t,4)},24:{name:"ICC Profile Date",value:(e,t)=>function(e,t){const n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),a=e.getUint16(t+6),o=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,a,o,s))}(e,t).toISOString()},36:{name:"ICC Signature",value:(e,t)=>{return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:(e,t)=>dm(e,t,4),description:e=>$v(e)},48:{name:"Device Manufacturer",value:(e,t)=>dm(e,t,4),description:e=>$v(e)},52:{name:"Device Model Number",value:(e,t)=>dm(e,t,4)},64:{name:"Rendering Intent",value:(e,t)=>e.getUint32(t),description:e=>{switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:(e,t)=>dm(e,t,4)}};function $v(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var Rv={read:function(e,t,n){if(n&&t[0].compressionMethod!==bm)return function(e,t){if(n=t[0].compressionMethod,0!==n)return{};var n;const r=new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length));return Em(r,t[0].compressionMethod,"utf-8","dataview").then(Gv).catch((()=>({})))}(e,t);return function(e,t){try{const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;const a=function(e){if(Array.isArray(e))return new DataView(Uint8Array.from(e).buffer).buffer;return e.buffer}(e);for(let e=1;e<=t.length;e++){const n=t.find((t=>t.chunkNumber===e));if(!n)throw new Error(`ICC chunk ${e} not found`);const o=a.slice(n.offset,n.offset+n.length),s=new Uint8Array(o);r.set(s,i),i+=s.length}return Gv(new DataView(r.buffer))}catch(e){return{}}}(e,t)}};const Fv=84,zv=128,Pv="acsp",jv="desc",Zv="mluc",Uv="text",Bv="sig ",Vv=12;function Hv(e,t){return e.length<t+Vv}function Gv(e){const t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw new Error("ICC profile length not matching");if(e.length<Fv)throw new Error("ICC profile too short");const r={},i=Object.keys(kv);for(let t=0;t<i.length;t++){const n=i[t],a=kv[n],o=a.value(e,parseInt(n,10));let s=o;a.description&&(s=a.description(o)),r[a.name]={value:o,description:s}}if(Yv(t.slice(36,40))!==Pv)throw new Error("ICC profile: missing signature");if(function(e){return e.length<zv+4}(t))return r;const a=e.getUint32(128);let o=132;for(let n=0;n<a;n++){if(Hv(t,o))return r;const n=dm(e,o,4),i=e.getUint32(o+4),a=e.getUint32(o+8);if(i>t.length)return r;const s=dm(e,i,4);if(s===jv){const o=e.getUint32(i+8);if(o>a)return r;Wv(r,n,Yv(t.slice(i+12,i+o+11)))}else if(s===Zv){const t=e.getUint32(i+8),a=e.getUint32(i+12);let o=i+16;const s=[];for(let n=0;n<t;n++){const t=dm(e,o+0,2),n=dm(e,o+2,2),r=e.getUint32(o+4),u=e.getUint32(o+8),c=pm(e,i+u,r);s.push({languageCode:t,countryCode:n,text:c}),o+=a}if(1===t)Wv(r,n,s[0].text);else{const e={};for(let t=0;t<s.length;t++)e[`${s[t].languageCode}-${s[t].countryCode}`]=s[t].text;Wv(r,n,e)}}else if(s===Uv){Wv(r,n,Yv(t.slice(i+8,i+a-7)))}else if(s===Bv){Wv(r,n,Yv(t.slice(i+8,i+12)))}o+=12}return r}function Yv(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Wv(e,t,n){Iv[t]?e[Iv[t].name]={value:n,description:n}:e[t]={value:n,description:n}}const qv=27;var Kv={read:function(e,t,n,r,i){let a=Uy(e,Ly,t,t+n,r,i);a.ShotInfo&&(a=gm({},a,function(e){const t={};void 0!==e[27]&&(t.AutoRotate={value:e[27],description:Jv(e[27])});return t}(a.ShotInfo.value)),delete a.ShotInfo);return a},SHOT_INFO_AUTO_ROTATE:qv};function Jv(e){return 0===e?"None":1===e?"Rotate 90 CW":2===e?"Rotate 180":3===e?"Rotate 270 CW":"Unknown"}var Xv={read:function(e,t){return{"Image Width":Qv(e,t),"Image Height":eb(e,t),"Bit Depth":tb(e,t),"Color Type":nb(e,t),Compression:rb(e,t),Filter:ib(e,t),Interlace:ab(e,t)}}};function Qv(e,t){if(t+0+4>e.byteLength)return;const n=Ry.getLongAt(e,t);return{value:n,description:`${n}px`}}function eb(e,t){if(t+4+4>e.byteLength)return;const n=Ry.getLongAt(e,t+4);return{value:n,description:`${n}px`}}function tb(e,t){if(t+8+1>e.byteLength)return;const n=Ry.getByteAt(e,t+8);return{value:n,description:`${n}`}}function nb(e,t){if(t+9+1>e.byteLength)return;const n=Ry.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}function rb(e,t){if(t+10+1>e.byteLength)return;const n=Ry.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}function ib(e,t){if(t+11+1>e.byteLength)return;const n=Ry.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}function ab(e,t){if(t+12+1>e.byteLength)return;const n=Ry.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}var ob={read:function(e,t,n,r){const i={},a=[];for(let o=0;o<t.length;o++){const{offset:s,length:u,type:c}=t[o],l=mb(e,s,u,c,n);if(l instanceof Promise)a.push(l.then((({name:e,value:t,description:n})=>{try{if(Sm&&Eb(e,t))return{__exif:qy.read(Ab(t),hb,r).tags};if(Am&&Sb(e,t))return{__iptc:w_.read(Ab(t),0,r)};if(e&&!Eb(e,t)&&!Sb(e,t))return{[e]:{value:t,description:n}}}catch(e){}return{}})));else{const{name:e,value:t,description:n}=l;e&&(i[e]={value:t,description:n})}}return{readTags:i,readTagsPromise:a.length>0?Promise.all(a):void 0}}};const sb="STATE_KEYWORD",ub="STATE_COMPRESSION",cb="STATE_LANG",lb="STATE_TRANSLATED_KEYWORD",db="STATE_TEXT",fb=1,pb=1,hb=6;function mb(e,t,n,r,i){const a=[],o=[];let s,u=sb,c=bm;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===ub){c=gb({type:r,dataView:e,offset:t+i}),r===kg&&(i+=fb),u=yb(r,u);continue}if(u===db){s=new DataView(e.buffer.slice(t+i,t+n));break}const l=e.getUint8(t+i);0===l?u=yb(r,u):u===sb?a.push(l):u===cb&&o.push(l)}if(c!==bm&&!i)return{};const l=Em(s,c,function(e){if(e===Ig||e===$g)return"latin1";return"utf-8"}(r));return l instanceof Promise?l.then((e=>_b(e,r,o,a))).catch((()=>_b("<text using unknown compression>".split(""),r,o,a))):_b(l,r,o,a)}function gb({type:e,dataView:t,offset:n}){if(e===kg){if(t.getUint8(n)===pb)return t.getUint8(n+1)}else if(e===$g)return t.getUint8(n);return bm}function yb(e,t){return t===sb&&[kg,$g].includes(e)?ub:t===ub?e===kg?cb:db:t===cb?lb:db}function _b(e,t,n,r){const i=function(e){if(e instanceof DataView)return dm(e,0,e.byteLength);return e}(e);return{name:vb(t,n,r),value:i,description:t===kg?bb(e):i}}function vb(e,t,n){const r=mm(n);if(e===Ig||0===t.length)return r;return`${r} (${mm(t)})`}function bb(e){return x_.decode("UTF-8",e)}function Eb(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function Sb(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function Ab(e){return function(e){const t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var xb={read:function(e,t){const n={};for(let r=0;r<t.length;r++){const i=Ry.getLongAt(e,t[r]+Cg),a=dm(e,t[r]+Ng,Og);a===Rg?(n["Pixels Per Unit X"]=wb(e,t[r],i),n["Pixels Per Unit Y"]=Tb(e,t[r],i),n["Pixel Units"]=Mb(e,t[r],i)):a===Fg&&(n["Modify Date"]=Ob(e,t[r],i))}return n}};function wb(e,t,n){if(!Cb(e,t,n,0,4))return;const r=Ry.getLongAt(e,t+Dg+0);return{value:r,description:""+r}}function Tb(e,t,n){if(!Cb(e,t,n,4,4))return;const r=Ry.getLongAt(e,t+Dg+4);return{value:r,description:""+r}}function Mb(e,t,n){if(!Cb(e,t,n,8,1))return;const r=Ry.getByteAt(e,t+Dg+8);return{value:r,description:1===r?"meters":"Unknown"}}function Ob(e,t,n){if(!Cb(e,t,n,0,7))return;const r=Ry.getShortAt(e,t+Dg),i=Ry.getByteAt(e,t+Dg+2),a=Ry.getByteAt(e,t+Dg+3),o=Ry.getByteAt(e,t+Dg+4),s=Ry.getByteAt(e,t+Dg+5),u=Ry.getByteAt(e,t+Dg+6);return{value:[r,i,a,o,s,u],description:`${Nb(r,4)}-${Nb(i,2)}-${Nb(a,2)} ${Nb(o,2)}:${Nb(s,2)}:${Nb(u,2)}`}}function Cb(e,t,n,r,i){return r+i<=n&&t+Dg+r+i<=e.byteLength}function Nb(e,t){return`${"0".repeat(t-(""+e).length)}${e}`}var Db={read:function(e,t){const n={},r=Ry.getByteAt(e,t);return n.Alpha=kb(r),n.Animation=$b(r),n.ImageWidth=Rb(e,t+Lb),n.ImageHeight=Rb(e,t+Ib),n}};const Lb=4,Ib=7;function kb(e){const t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}function $b(e){const t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}function Rb(e,t){const n=Ry.getByteAt(e,t)+256*Ry.getByteAt(e,t+1)+65536*Ry.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var Fb={read:function(e){return{"GIF Version":zb(e),"Image Width":Pb(e),"Image Height":jb(e),"Global Color Map":Zb(e),"Bits Per Pixel":Bb(e),"Color Resolution Depth":Ub(e)}}};function zb(e){if(6>e.byteLength)return;const t=dm(e,3,3);return{value:t,description:t}}function Pb(e){if(8>e.byteLength)return;const t=e.getUint16(6,!0);return{value:t,description:`${t}px`}}function jb(e){if(10>e.byteLength)return;const t=e.getUint16(8,!0);return{value:t,description:`${t}px`}}function Zb(e){if(11>e.byteLength)return;const t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}function Ub(e){if(11>e.byteLength)return;const t=1+((112&e.getUint8(10))>>>4);return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}function Bb(e){if(11>e.byteLength)return;const t=1+(7&e.getUint8(10));return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}const Vb=[6,7,99];var Hb={get:function(e,t,n){if(r=t,r&&(void 0===r.Compression||Vb.includes(r.Compression.value))&&r.JPEGInterchangeFormat&&r.JPEGInterchangeFormat.value&&r.JPEGInterchangeFormatLength&&r.JPEGInterchangeFormatLength.value){t.type="image/jpeg";const r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),ym(t,"base64",(function(){return _m(this.image)}))}var r;return t}};function Gb(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=(new Error).stack}Gb.prototype=new Error;var Yb,Wb,qb={MetadataMissingError:Gb},Kb={load:function(e,t={}){if(function(e){return"string"==typeof e}(e))return t.async=!0,function(e,t){if(/^\w+:\/\//.test(e))return"undefined"!=typeof fetch?function(e,{length:t}={}){const n={method:"GET"};Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-"+(t-1)});return fetch(e,n).then((e=>e.arrayBuffer()))}(e,t):function(e,{length:t}={}){return new Promise(((n,r)=>{const i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-"+(t-1)});const a=function(e){if(/^https:\/\//.test(e))return __non_webpack_require__("https").get;return __non_webpack_require__("http").get}(e);a(e,i,(e=>{if(e.statusCode>=200&&e.statusCode<=299){const t=[];e.on("data",(e=>t.push(Buffer.from(e)))),e.on("error",(e=>r(e))),e.on("end",(()=>n(Buffer.concat(t))))}else r(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`),e.resume()})).on("error",(e=>r(e)))}))}(e,t);if(function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e))return Promise.resolve(function(e){const t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer;if("undefined"==typeof Buffer)return;return void 0!==Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}const n=decodeURIComponent(t);return"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(e=>e.charCodeAt(0))).buffer}(e));return function(e,{length:t}={}){return new Promise(((n,r)=>{const i=function(){try{return __non_webpack_require__("fs")}catch(e){return}}();i.open(e,((a,o)=>{a?r(a):i.stat(e,((a,s)=>{if(a)r(a);else{const a=Math.min(s.size,void 0!==t?t:s.size),u=Buffer.alloc(a),c={buffer:u,length:a};i.read(o,c,(t=>{t?r(t):i.close(o,(t=>{t&&console.warn(`Could not close file ${e}:`,t),n(u)}))}))}}))}))}))}(e,t)}(e,t).then((e=>Jb(e,t)));if(function(e){return"undefined"!=typeof File&&e instanceof File}(e))return t.async=!0,(n=e,new Promise(((e,t)=>{const r=new FileReader;r.onload=t=>e(t.target.result),r.onerror=()=>t(r.error),r.readAsArrayBuffer(n)}))).then((e=>Jb(e,t)));var n;return Jb(e,t)},loadView:Xb,errors:qb};function Jb(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return!1}}(e)&&(e=new Uint8Array(e).buffer),Xb(function(e){try{return new DataView(e)}catch(t){return new cm(e)}}(e),t)}function Xb(e,{expanded:t=!1,async:n=!1,includeUnknown:r=!1,domParser:i}={expanded:!1,async:!1,includeUnknown:!1,domParser:void 0}){let a=!1,o={};const s=[],{fileType:u,fileDataOffset:c,jfifDataOffset:l,tiffHeaderOffset:d,iptcDataOffset:f,xmpChunks:p,iccChunks:h,mpfDataOffset:m,pngHeaderOffset:g,pngTextChunks:y,pngChunkOffsets:_,vp8xChunkOffset:v,gifHeaderOffset:b}=gy.parseAppMarkers(e,n);if(function(e){return void 0!==e}(c)){a=!0;const n=o_.read(e,c);t?o.file=n:o=gm({},o,n)}if(function(e){return void 0!==e}(l)){a=!0;const n=p_.read(e,l);t?o.jfif=n:o=gm({},o,n)}if(function(e){return void 0!==e}(d)){a=!0;const{tags:n,byteOrder:s}=qy.read(e,d,r);if(n.Thumbnail&&(o.Thumbnail=n.Thumbnail,delete n.Thumbnail),t?(o.exif=n,function(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=Tm(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=Tm(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}(o)):o=gm({},o,n),n["IPTC-NAA"]&&!Qb(f)){const e=w_.read(n["IPTC-NAA"].value,0,r);t?o.iptc=e:o=gm({},o,e)}if(n.ApplicationNotes&&!eE(p)){const e=j_.read(mm(n.ApplicationNotes.value),void 0,i);t?o.xmp=e:(delete e._raw,o=gm({},o,e))}if(n.ImageSourceData){const e=Mv.read(n.PhotoshopSettings.value,r);t?o.photoshop=e:o=gm({},o,e)}if(n.ICC_Profile&&!tE(h)){const e=Rv.read(n.ICC_Profile.value,[{offset:0,length:n.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);t?o.icc=e:o=gm({},o,e)}if(function(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&"Canon"===e.Make.value[0]&&e.MakerNote&&e.MakerNote.__offset}(n)){const i=Kv.read(e,d,n.MakerNote.__offset,s,r);t?o.makerNotes=i:o=gm({},o,i)}n.MakerNote&&delete n.MakerNote.__offset}if(Qb(f)){a=!0;const n=w_.read(e,f,r);t?o.iptc=n:o=gm({},o,n)}if(eE(p)){a=!0;const n=j_.read(e,p,i);t?o.xmp=n:(delete n._raw,o=gm({},o,n))}if(tE(h)){a=!0;const t=Rv.read(e,h,n);t instanceof Promise?s.push(t.then(S)):S(t)}if(function(e){return void 0!==e}(m)){a=!0;const n=Qy.read(e,m,r);t?o.mpf=n:o=gm({},o,n)}if(void 0!==g){a=!0;const n=Xv.read(e,g);t?(o.png=o.png?gm({},o.png,n):n,o.pngFile=n):o=gm({},o,n)}if(function(e){return void 0!==e}(y)){a=!0;const{readTags:t,readTagsPromise:i}=ob.read(e,y,n,r);A(t),i&&s.push(i.then((e=>e.forEach(A))))}if(function(e){return void 0!==e}(_)){a=!0;const n=xb.read(e,_);t?o.png=o.png?gm({},o.png,n):n:o=gm({},o,n)}if(function(e){return void 0!==e}(v)){a=!0;const n=Db.read(e,v);t?o.riff=o.riff?gm({},o.riff,n):n:o=gm({},o,n)}if(function(e){return void 0!==e}(b)){a=!0;const n=Fb.read(e,b);t?o.gif=o.gif?gm({},o.gif,n):n:o=gm({},o,n)}const E=Hb.get(e,o.Thumbnail,d);if(E?(a=!0,o.Thumbnail=E):delete o.Thumbnail,u&&(t?(o.file||(o.file={}),o.file.FileType=u):o.FileType=u,a=!0),!a)throw new qb.MetadataMissingError;return n?Promise.all(s).then((()=>o)):o;function S(e){t?o.icc=e:o=gm({},o,e)}function A(e){if(t){for(const t of["exif","iptc"]){const n=`__${t}`;e[n]&&(o[t]=o[t]?gm({},o.exif,e[n]):e[n],delete e[n])}o.png=o.png?gm({},o.png,e):e,o.pngText=o.pngText?gm({},o.png,e):e}else o=gm({},o,e.__exif?e.__exif:{},e.__iptc?e.__iptc:{},e),delete o.__exif,delete o.__iptc}}function Qb(e){return void 0!==e}function eE(e){return Array.isArray(e)&&e.length>0}function tE(e){return Array.isArray(e)&&e.length>0}exports.ImageHelper=void 0,(Yb=exports.ImageHelper||(exports.ImageHelper={})).convertBlob=async(e,t="image/jpeg")=>{const n=(await exports.FileHelper.getType(e)).mime;if("image/heic"===n||"image/heif"===n){const{heicTo:n}=await Promise.resolve().then((function(){return require("./heic-to.cfb16ea4.js")}));e=await n({blob:e,type:t})}const r=await Yb.blobToImage(e),i=document.createElement("canvas");return i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),i.toDataURL(t)},Yb.dataUrlToImage=async e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error("dataURLtoImage(): dataURL is illegal")),r.src=e})),Yb.blobToImage=async e=>{const t=URL.createObjectURL(e);return new Promise(((e,n)=>{const r=new Image;r.onload=()=>{URL.revokeObjectURL(t),e(r)},r.onerror=()=>n(new Error("blobToImage(): blob is illegal")),r.src=t}))},Yb.resampleImage=async(e,t)=>{const{crop:n,scale:r,width:i,height:a,quality:o=1,type:s="image/jpeg"}=t,u=document.createElement("canvas"),c=u.getContext("2d");if(r)u.width=e.width*r,u.height=e.height*r,c.drawImage(e,0,0,u.width,u.height);else if(i&&a){u.width=i,u.height=a;let t=e.height/a*i,r=e.height,o=(e.width-t)/2,s=0;(n&&e.height>e.width||!n&&e.height<e.width)&&(t=e.width,r=e.width/i*a,o=0,s=(e.height-r)/2),c.drawImage(e,o,s,t,r,0,0,i,a)}return new Promise((e=>u.toBlob((t=>e(t)),s,o)))},Yb.compressImage=async(e,t)=>{const{quality:n=1,fileSize:r,attempts:i=0,maxAttempts:a}=t,o=await Yb.blobToImage(e);if(e.size<=1024*r||n<0)return e;const s=await Yb.resampleImage(o,{scale:1,quality:n});return s.size>1024*r&&(i<a||!a)?Yb.compressImage(e,{...t,quality:n-.1,attempts:i+1}):s},Yb.getMetadata=async e=>{try{const t=await Kb.load(e),n=t.DateTimeOriginal?.description,r=Number(t.GPSLongitude?.description),i=Number(t.GPSLatitude?.description),a=isNaN(r)?void 0:Number(r);return{dateTimeOriginal:n,lat:isNaN(i)?void 0:Number(i),lng:a}}catch{}},function(e){e.degreesToRadians=e=>Math.PI*e/180,e.radiansToDegrees=e=>180*e/Math.PI,e.nauticalMilesToMetres=e=>1852*e}(Wb||(Wb={}));var nE=xi,rE=qa,iE=Vr,aE=Hr,oE=Mi,sE=Gr.exports,uE=_i,cE=ui,lE=Object.prototype.hasOwnProperty;var dE=function(e){if(null==e)return!0;if(oE(e)&&(aE(e)||"string"==typeof e||"function"==typeof e.splice||sE(e)||cE(e)||iE(e)))return!e.length;var t=rE(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(uE(e))return!nE(e).length;for(var n in e)if(lE.call(e,n))return!1;return!0};var fE,pE,hE=function(e){return null==e};!function(e){e.upsert=(e,t,n)=>{const r={...e};return r[t]=t in r?{...r[t],...n}:n,r},e.getNestedValueByKey=(t,n,r={})=>{const{skipRoot:i,searchIn:a}=r;if(!i&&n in t)return{[n]:t[n]};for(const[i,o]of Object.entries(t))if(o&&"object"==typeof o&&!Array.isArray(o)&&(!a||a.includes(i))){const t=e.getNestedValueByKey(o,n,{...r,skipRoot:!1});if(!dE(t))return t}},e.removeNil=t=>{if(null!==t){if(Array.isArray(t)){const n=t.map((t=>e.removeNil(t))).filter((e=>e));return n.length?n:void 0}if("object"==typeof t){const n={...t};return Object.entries(n).forEach((([t,r])=>{const i=e.removeNil(r);hE(i)?delete n[t]:n[t]=i})),dE(n)?void 0:n}return t}}}(fE||(fE={})),exports.TestHelper=void 0,(pE=exports.TestHelper||(exports.TestHelper={})).generateId=(e,t,n)=>{let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r},pE.getError=e=>{try{return e()}catch(e){return e}};const mE=t.createContext({formValidationConfig:null,setFormValidationConfig:()=>null,warnings:null,setWarnings:()=>null,yupId:null}),gE=({children:n})=>{const[r,i]=t.useState(),[a,o]=t.useState(),[s]=t.useState(um()),u=t.useMemo((()=>({formValidationConfig:r,setFormValidationConfig:i,warnings:a,setWarnings:o,yupId:s})),[r,a,s]);return e.jsx(mE.Provider,{value:u,children:n})};var yE,_E;try{yE=Map}catch(Pf){}try{_E=Set}catch(Pf){}function vE(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(bE);if(yE&&e instanceof yE)return new Map(Array.from(e.entries()));if(_E&&e instanceof _E)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var a=t.findIndex((function(t){return t===e[i]}));r[i]=a>-1?n[a]:vE(e[i],t,n)}return r}return e}function bE(e){return vE(e,[],[])}const EE=Object.prototype.toString,SE=Error.prototype.toString,AE=RegExp.prototype.toString,xE="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",wE=/^Symbol\((.*)\)(.*)$/;function TE(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return xE.call(e).replace(wE,"Symbol($1)");const r=EE.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+SE.call(e)+"]":"RegExp"===r?AE.call(e):null}function ME(e,t){let n=TE(e,t);return null!==n?n:JSON.stringify(e,(function(e,n){let r=TE(this[e],t);return null!==r?r:n}),2)}let OE={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${ME(n,!0)}\``+(i?` (cast from the value \`${ME(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},CE={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},NE={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},DE={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},LE={isValue:"${path} field must be ${value}"},IE={noUnknown:"${path} field has unspecified keys: ${unknown}"},kE={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};var $E=Object.assign(Object.create(null),{mixed:OE,string:CE,number:NE,date:DE,object:IE,array:kE,boolean:LE}),RE=Object.prototype.hasOwnProperty;var FE=function(e,t){return null!=e&&RE.call(e,t)},zE=Hr,PE=Xp,jE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ZE=/^\w*$/;var UE=function(e,t){if(zE(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!PE(e))||(ZE.test(e)||!jE.test(e)||null!=t&&e in Object(t))},BE=dr;function VE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(VE.Cache||BE),n}VE.Cache=BE;var HE=VE;var GE=function(e){var t=HE(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t},YE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,WE=/\\(\\)?/g,qE=GE((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(YE,(function(e,n,r,i){t.push(r?i.replace(WE,"$1"):n||e)})),t})),KE=Hr,JE=UE,XE=qE,QE=oh;var eS=function(e,t){return KE(e)?e:JE(e,t)?[e]:XE(QE(e))},tS=Xp;var nS=function(e){if("string"==typeof e||tS(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},rS=eS,iS=Vr,aS=Hr,oS=qr,sS=Kr,uS=nS;var cS=function(e,t,n){for(var r=-1,i=(t=rS(t,e)).length,a=!1;++r<i;){var o=uS(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&sS(i)&&oS(o,i)&&(aS(e)||iS(e))},lS=FE,dS=cS;var fS=function(e,t){return null!=e&&dS(e,t,lS)};const pS=e=>e&&e.__isYupSchema__;class hS{constructor(e,t){if(this.fn=void 0,this.refs=e,this.refs=e,"function"==typeof t)return void(this.fn=t);if(!fS(t,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every((e=>e===n));this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!pS(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}function mS(e){return null==e?[]:[].concat(e)}function gS(){return gS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gS.apply(this,arguments)}let yS=/\$\{\s*(\w+)\s*\}/g;class _S extends Error{static formatError(e,t){const n=t.label||t.path||"this";return n!==t.path&&(t=gS({},t,{path:n})),"string"==typeof e?e.replace(yS,((e,n)=>ME(t[n]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],mS(e).forEach((e=>{_S.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,_S)}}function vS(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=(e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}})(t),l=r.length;const d=[];if(o=o||[],!l)return o.length?c(new _S(o,a,u)):c(null,a);for(let e=0;e<r.length;e++){(0,r[e])(i,(function(e){if(e){if(!_S.isError(e))return c(e,a);if(n)return e.value=a,c(e,a);d.push(e)}if(--l<=0){if(d.length&&(s&&d.sort(s),o.length&&d.push(...o),o=d),o.length)return void c(new _S(o,a,u),a);c(null,a)}}))}}var bS=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}},ES=bS(),SS=ES,AS=Di;var xS=function(e,t){return e&&SS(e,t,AS)};var wS=dr,TS=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},MS=function(e){return this.__data__.has(e)};function OS(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new wS;++t<n;)this.add(e[t])}OS.prototype.add=OS.prototype.push=TS,OS.prototype.has=MS;var CS=OS;var NS=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var DS=function(e,t){return e.has(t)},LS=CS,IS=NS,kS=DS;var $S=function(e,t,n,r,i,a){var o=1&n,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var d=-1,f=!0,p=2&n?new LS:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var g=o?r(m,h,d,t,e,a):r(h,m,d,e,t,a);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!IS(t,(function(e,t){if(!kS(p,t)&&(h===e||i(h,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(h!==m&&!i(h,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f};var RS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};var FS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},zS=Xa,PS=wt,jS=$S,ZS=RS,US=FS,BS=qt?qt.prototype:void 0,VS=BS?BS.valueOf:void 0;var HS=function(e,t,n,r,i,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new zS(e),new zS(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return PS(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ZS;case"[object Set]":var u=1&r;if(s||(s=US),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;r|=2,o.set(e,t);var l=jS(s(e),s(t),r,i,a,o);return o.delete(e),l;case"[object Symbol]":if(VS)return VS.call(e)==VS.call(t)}return!1},GS=Aa,YS=Object.prototype.hasOwnProperty;var WS=function(e,t,n,r,i,a){var o=1&n,s=GS(e),u=s.length;if(u!=GS(t).length&&!o)return!1;for(var c=u;c--;){var l=s[c];if(!(o?l in t:YS.call(t,l)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var h=o;++c<u;){var m=e[l=s[c]],g=t[l];if(r)var y=o?r(g,m,l,t,e,a):r(m,g,l,e,t,a);if(!(void 0===y?m===g||i(m,g,n,r,a):y)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var _=e.constructor,v=t.constructor;_==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof v&&v instanceof v||(p=!1)}return a.delete(e),a.delete(t),p},qS=Sr,KS=$S,JS=HS,XS=WS,QS=qa,eA=Hr,tA=Gr.exports,nA=ui,rA="[object Arguments]",iA="[object Array]",aA="[object Object]",oA=Object.prototype.hasOwnProperty;var sA=function(e,t,n,r,i,a){var o=eA(e),s=eA(t),u=o?iA:QS(e),c=s?iA:QS(t),l=(u=u==rA?aA:u)==aA,d=(c=c==rA?aA:c)==aA,f=u==c;if(f&&tA(e)){if(!tA(t))return!1;o=!0,l=!1}if(f&&!l)return a||(a=new qS),o||nA(e)?KS(e,t,n,r,i,a):JS(e,t,u,n,r,i,a);if(!(1&n)){var p=l&&oA.call(e,"__wrapped__"),h=d&&oA.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,g=h?t.value():t;return a||(a=new qS),i(m,g,n,r,a)}}return!!f&&(a||(a=new qS),XS(e,t,n,r,i,a))},uA=sA,cA=Rr;var lA=function e(t,n,r,i,a){return t===n||(null==t||null==n||!cA(t)&&!cA(n)?t!=t&&n!=n:uA(t,n,r,i,e,a))},dA=Sr,fA=lA;var pA=function(e,t,n,r){var i=n.length,a=i,o=!r;if(null==e)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var u=(s=n[i])[0],c=e[u],l=s[1];if(o&&s[2]){if(void 0===c&&!(u in e))return!1}else{var d=new dA;if(r)var f=r(c,l,u,e,t,d);if(!(void 0===f?fA(l,c,3,r,d):f))return!1}}return!0},hA=un;var mA=function(e){return e==e&&!hA(e)},gA=mA,yA=Di;var _A=function(e){for(var t=yA(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,gA(i)]}return t};var vA=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},bA=pA,EA=_A,SA=vA;var AA=function(e){var t=EA(e);return 1==t.length&&t[0][2]?SA(t[0][0],t[0][1]):function(n){return n===e||bA(n,e,t)}},xA=eS,wA=nS;var TA=function(e,t){for(var n=0,r=(t=xA(t,e)).length;null!=e&&n<r;)e=e[wA(t[n++])];return n&&n==r?e:void 0},MA=TA;var OA=function(e,t,n){var r=null==e?void 0:MA(e,t);return void 0===r?n:r};var CA=function(e,t){return null!=e&&t in Object(e)},NA=CA,DA=cS;var LA=function(e,t){return null!=e&&DA(e,t,NA)},IA=lA,kA=OA,$A=LA,RA=UE,FA=mA,zA=vA,PA=nS;var jA=function(e,t){return RA(e)&&FA(t)?zA(PA(e),t):function(n){var r=kA(n,e);return void 0===r&&r===t?$A(n,e):IA(t,r,3)}};var ZA=function(e){return e};var UA=function(e){return function(t){return null==t?void 0:t[e]}},BA=TA;var VA=function(e){return function(t){return BA(t,e)}},HA=UA,GA=VA,YA=UE,WA=nS;var qA=AA,KA=jA,JA=ZA,XA=Hr,QA=function(e){return YA(e)?HA(WA(e)):GA(e)};var ex=function(e){return"function"==typeof e?e:null==e?JA:"object"==typeof e?XA(e)?KA(e[0],e[1]):qA(e):QA(e)},tx=Mr,nx=xS,rx=ex;var ix=function(e,t){var n={};return t=rx(t),nx(e,(function(e,r,i){tx(n,r,t(e,r,i))})),n};function ax(e){this._maxSize=e,this.clear()}ax.prototype.clear=function(){this._size=0,this._values=Object.create(null)},ax.prototype.get=function(e){return this._values[e]},ax.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var ox=/[^.^\]^[]+|(?=\[\]|\.\.)/g,sx=/^\d+$/,ux=/^\d/,cx=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,lx=/^\s*(['"]?)(.*?)(\1)\s*$/,dx=new ax(512),fx=new ax(512),px=new ax(512),hx={Cache:ax,split:gx,normalizePath:mx,setter:function(e){var t=mx(e);return fx.get(e)||fx.set(e,(function(e,n){for(var r=0,i=t.length,a=e;r<i-1;){var o=t[r];if("__proto__"===o||"constructor"===o||"prototype"===o)return e;a=a[t[r++]]}a[t[r]]=n}))},getter:function(e,t){var n=mx(e);return px.get(e)||px.set(e,(function(e){for(var r=0,i=n.length;r<i;){if(null==e&&t)return;e=e[n[r++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(yx(t)||sx.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,n){!function(e,t,n){var r,i,a,o,s=e.length;for(i=0;i<s;i++)(r=e[i])&&(_x(r)&&(r='"'+r+'"'),a=!(o=yx(r))&&/^\d+$/.test(r),t.call(n,r,o,a,i,e))}(Array.isArray(e)?e:gx(e),t,n)}};function mx(e){return dx.get(e)||dx.set(e,gx(e).map((function(e){return e.replace(lx,"$2")})))}function gx(e){return e.match(ox)||[""]}function yx(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function _x(e){return!yx(e)&&(function(e){return e.match(ux)&&!e.match(sx)}(e)||function(e){return cx.test(e)}(e))}const vx="$",bx=".";class Ex{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===vx,this.isValue=this.key[0]===bx,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?vx:this.isValue?bx:"";this.path=this.key.slice(n.length),this.getter=this.path&&hx.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}function Sx(){return Sx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sx.apply(this,arguments)}function Ax(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,["value","path","label","options","originalValue","sync"]);const{name:l,test:d,params:f,message:p}=e;let{parent:h,context:m}=o;function g(e){return Ex.isRef(e)?e.getValue(r,h,m):e}function y(e={}){const t=ix(Sx({value:r,originalValue:s,label:a,path:e.path||i},f,e.params),g),n=new _S(_S.formatError(e.message||p,t),r,t.path,e.type||l);return n.params=t,n}let _,v=Sx({path:i,parent:h,type:l,createError:y,resolve:g,options:o,originalValue:s},c);if(u){try{var b;if(_=d.call(v,r,v),"function"==typeof(null==(b=_)?void 0:b.then))throw new Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(e){return void n(e)}_S.isError(_)?n(_):_?n(null,_):n(y())}else try{Promise.resolve(d.call(v,r,v)).then((e=>{_S.isError(e)?n(e):e?n(null,e):n(y())})).catch(n)}catch(e){n(e)}}return t.OPTIONS=e,t}Ex.prototype.__isYupRef=!0;function xx(e,t,n,r=n){let i,a,o;return t?(hx.forEach(t,((s,u,c)=>{let l=u?(e=>e.substr(0,e.length-1).substr(1))(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let r=c?parseInt(l,10):0;if(n&&r>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[r],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s})),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class wx{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const e=[];for(const t of this.list)e.push(t);for(const[,t]of this.refs)e.push(t.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(e){return this.toArray().reduce(((t,n)=>t.concat(Ex.isRef(n)?e(n):n)),[])}add(e){Ex.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){Ex.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}clone(){const e=new wx;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){const n=this.clone();return e.list.forEach((e=>n.add(e))),e.refs.forEach((e=>n.add(e))),t.list.forEach((e=>n.delete(e))),t.refs.forEach((e=>n.delete(e))),n}}function Tx(){return Tx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tx.apply(this,arguments)}class Mx{constructor(e){this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this._typeError=void 0,this._whitelist=new wx,this._blacklist=new wx,this.exclusiveTests=Object.create(null),this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(OE.notType)})),this.type=(null==e?void 0:e.type)||"mixed",this.spec=Tx({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=Tx({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=bE(Tx({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Tx({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return!(!this.spec.nullable||null!==e)||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce(((t,n)=>n.resolve(t,e)),t),t=t.resolve(e)}return t}cast(e,t={}){let n=this.resolve(Tx({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=ME(e),a=ME(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce(((t,n)=>n.call(this,t,e,this)),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,Tx({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},d=[];this._typeError&&d.push(this._typeError);let f=[];this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),vS({args:l,value:c,path:i,sync:r,tests:d,endEarly:u},(e=>{e?n(e,c):vS({tests:this.tests.concat(f),args:l,path:i,sync:r,value:c,endEarly:u},n)}))}validate(e,t,n){let r=this.resolve(Tx({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise(((n,i)=>r._validate(e,t,((e,t)=>{e?i(e):n(t)}))))}validateSync(e,t){let n;return this.resolve(Tx({},t,{value:e}))._validate(e,Tx({},t,{sync:!0}),((e,t)=>{if(e)throw e;n=t})),n}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(_S.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(_S.isError(e))return!1;throw e}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):bE(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){let t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=OE.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=OE.required){return this.clone({presence:"required"}).withMutation((t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}})))}notRequired(){let e=this.clone({presence:"optional"});return e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=OE.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=Ax(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=mS(e).map((e=>new Ex(e)));return r.forEach((e=>{e.isSibling&&n.deps.push(e.key)})),n.conditions.push(new hS(r,t)),n}typeError(e){let t=this.clone();return t._typeError=Ax({message:e,name:"typeError",test(e){return!(void 0!==e&&!this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=OE.oneOf){let n=this.clone();return e.forEach((e=>{n._whitelist.add(e),n._blacklist.delete(e)})),n._whitelistError=Ax({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}notOneOf(e,t=OE.notOneOf){let n=this.clone();return e.forEach((e=>{n._blacklist.add(e),n._whitelist.delete(e)})),n._blacklistError=Ax({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){const e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t))};return r}}Mx.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Mx.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=xx(this,t,n,r.context);return o[e](i&&i[a],Tx({},r,{parent:i,path:t}))};for(const e of["equals","is"])Mx.prototype[e]=Mx.prototype.oneOf;for(const e of["not","nope"])Mx.prototype[e]=Mx.prototype.notOneOf;Mx.prototype.optional=Mx.prototype.notRequired;const Ox=Mx;function Cx(){return new Ox}Cx.prototype=Ox.prototype;const Nx=e=>null==e;function Dx(){return new Lx}class Lx extends Mx{constructor(){super({type:"boolean"}),this.withMutation((()=>{this.transform((function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e}))}))}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=LE.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>Nx(e)||!0===e})}isFalse(e=LE.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>Nx(e)||!1===e})}}Dx.prototype=Lx.prototype;let Ix=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,kx=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,$x=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Rx=e=>Nx(e)||e===e.trim(),Fx={}.toString();function zx(){return new Px}class Px extends Mx{constructor(){super({type:"string"}),this.withMutation((()=>{this.transform((function(e){if(this.isType(e))return e;if(Array.isArray(e))return e;const t=null!=e&&e.toString?e.toString():e;return t===Fx?e:t}))}))}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=CE.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return Nx(t)||t.length===this.resolve(e)}})}min(e,t=CE.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return Nx(t)||t.length>=this.resolve(e)}})}max(e,t=CE.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return Nx(t)||t.length<=this.resolve(e)}})}matches(e,t){let n,r,i=!1;return t&&("object"==typeof t?({excludeEmptyString:i=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||CE.matches,params:{regex:e},test:t=>Nx(t)||""===t&&i||-1!==t.search(e)})}email(e=CE.email){return this.matches(Ix,{name:"email",message:e,excludeEmptyString:!0})}url(e=CE.url){return this.matches(kx,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=CE.uuid){return this.matches($x,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=CE.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:Rx})}lowercase(e=CE.lowercase){return this.transform((e=>Nx(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>Nx(e)||e===e.toLowerCase()})}uppercase(e=CE.uppercase){return this.transform((e=>Nx(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>Nx(e)||e===e.toUpperCase()})}}zx.prototype=Px.prototype;function jx(){return new Zx}class Zx extends Mx{constructor(){super({type:"number"}),this.withMutation((()=>{this.transform((function(e){let t=e;if("string"==typeof t){if(t=t.replace(/\s/g,""),""===t)return NaN;t=+t}return this.isType(t)?t:parseFloat(t)}))}))}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e)}min(e,t=NE.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return Nx(t)||t>=this.resolve(e)}})}max(e,t=NE.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return Nx(t)||t<=this.resolve(e)}})}lessThan(e,t=NE.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return Nx(t)||t<this.resolve(e)}})}moreThan(e,t=NE.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},test(t){return Nx(t)||t>this.resolve(e)}})}positive(e=NE.positive){return this.moreThan(0,e)}negative(e=NE.negative){return this.lessThan(0,e)}integer(e=NE.integer){return this.test({name:"integer",message:e,test:e=>Nx(e)||Number.isInteger(e)})}truncate(){return this.transform((e=>Nx(e)?e:0|e))}round(e){var t;let n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform((t=>Nx(t)?t:Math[e](t)))}}jx.prototype=Zx.prototype;var Ux=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let Bx=new Date("");function Vx(){return new Hx}class Hx extends Mx{constructor(){super({type:"date"}),this.withMutation((()=>{this.transform((function(e){return this.isType(e)?e:(e=function(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=Ux.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,void 0!==n[8]&&""!==n[8]||void 0!==n[9]&&""!==n[9]?("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7])):t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7])}else t=Date.parse?Date.parse(e):NaN;return t}(e),isNaN(e)?Bx:new Date(e))}))}))}_typeCheck(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}prepareParam(e,t){let n;if(Ex.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=DE.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return Nx(e)||e>=this.resolve(n)}})}max(e,t=DE.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return Nx(e)||e<=this.resolve(n)}})}}Hx.INVALID_DATE=Bx,Vx.prototype=Hx.prototype,Vx.INVALID_DATE=Bx;var Gx=function(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n};var Yx=function(e){return function(t){return null==e?void 0:e[t]}},Wx=Yx({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),qx=oh,Kx=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jx=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Xx=function(e){return(e=qx(e))&&e.replace(Kx,Wx).replace(Jx,"")},Qx=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ew=function(e){return e.match(Qx)||[]},tw=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var nw=function(e){return tw.test(e)},rw="\\ud800-\\udfff",iw="\\u2700-\\u27bf",aw="a-z\\xdf-\\xf6\\xf8-\\xff",ow="A-Z\\xc0-\\xd6\\xd8-\\xde",sw="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",uw="["+sw+"]",cw="\\d+",lw="["+iw+"]",dw="["+aw+"]",fw="[^"+rw+sw+cw+iw+aw+ow+"]",pw="(?:\\ud83c[\\udde6-\\uddff]){2}",hw="[\\ud800-\\udbff][\\udc00-\\udfff]",mw="["+ow+"]",gw="(?:"+dw+"|"+fw+")",yw="(?:"+mw+"|"+fw+")",_w="(?:['’](?:d|ll|m|re|s|t|ve))?",vw="(?:['’](?:D|LL|M|RE|S|T|VE))?",bw="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ew="[\\ufe0e\\ufe0f]?",Sw=Ew+bw+("(?:\\u200d(?:"+["[^"+rw+"]",pw,hw].join("|")+")"+Ew+bw+")*"),Aw="(?:"+[lw,pw,hw].join("|")+")"+Sw,xw=RegExp([mw+"?"+dw+"+"+_w+"(?="+[uw,mw,"$"].join("|")+")",yw+"+"+vw+"(?="+[uw,mw+gw,"$"].join("|")+")",mw+"?"+gw+"+"+_w,mw+"+"+vw,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cw,Aw].join("|"),"g");var ww=function(e){return e.match(xw)||[]},Tw=ew,Mw=nw,Ow=oh,Cw=ww;var Nw=function(e,t,n){return e=Ow(e),void 0===(t=n?void 0:t)?Mw(e)?Cw(e):Tw(e):e.match(t)||[]},Dw=Gx,Lw=Xx,Iw=Nw,kw=RegExp("['’]","g");var $w=function(e){return function(t){return Dw(Iw(Lw(t).replace(kw,"")),e,"")}},Rw=$w((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Fw=Rw,zw=zh,Pw=$w((function(e,t,n){return t=t.toLowerCase(),e+(n?zw(t):t)})),jw=Pw,Zw=Mr,Uw=xS,Bw=ex;var Vw=function(e,t){var n={};return t=Bw(t),Uw(e,(function(e,r,i){Zw(n,t(e,r,i),e)})),n},Hw={exports:{}};function Gw(e,t){var n=e.length,r=new Array(n),i={},a=n,o=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)i[a]||u(e[a],a,new Set);return r;function u(e,t,a){if(a.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var l=o.get(e)||new Set;if(t=(l=Array.from(l)).length){a.add(e);do{var d=l[--t];u(d,s.get(d),a)}while(t);a.delete(e)}r[--n]=e}}}function Yw(e,t){let n=1/0;return e.some(((e,r)=>{var i;if(-1!==(null==(i=t.path)?void 0:i.indexOf(e)))return n=r,!0})),n}function Ww(e){return(t,n)=>Yw(e,t)-Yw(e,n)}function qw(){return qw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qw.apply(this,arguments)}Hw.exports=function(e){return Gw(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},Hw.exports.array=Gw;let Kw=e=>"[object Object]"===Object.prototype.toString.call(e);const Jw=Ww([]);class Xw extends Mx{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=Jw,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})),e&&this.shape(e)}))}_typeCheck(e){return Kw(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter((e=>-1===this._nodes.indexOf(e)))),s={},u=qw({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(const e of o){let n=i[e],o=fS(r,e);if(n){let i,a=r[e];u.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:a,context:t.context,parent:s});let o="spec"in n?n.spec:void 0,l=null==o?void 0:o.strict;if(null==o?void 0:o.strip){c=c||e in r;continue}i=t.__validating&&l?r[e]:n.cast(r[e],u),void 0!==i&&(s[e]=i)}else o&&!a&&(s[e]=r[e]);s[e]!==r[e]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,((e,c)=>{if(e){if(!_S.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!Kw(c))return void n(r[0]||null,c);o=o||c;let l=this._nodes.map((e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];s&&"validate"in s?s.validate(c[e],qw({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r):r(null)}));vS({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)}))}clone(e){const t=super.clone(e);return t.fields=qw({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];void 0===r?n[e]=t:r instanceof Mx&&t instanceof Mx&&(n[e]=t.concat(r))}return t.withMutation((()=>t.shape(n,this._excludedEdges)))}getDefaultFromShape(){let e={};return this._nodes.forEach((t=>{const n=this.fields[t];e[t]="default"in n?n.getDefault():void 0})),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);return n.fields=r,n._sortErrors=Ww(Object.keys(r)),t.length&&(Array.isArray(t[0])||(t=[t]),n._excludedEdges=[...n._excludedEdges,...t]),n._nodes=function(e,t=[]){let n=[],r=new Set,i=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=hx.split(e)[0];r.add(a),i.has(`${t}-${a}`)||n.push([t,a])}for(const t in e)if(fS(e,t)){let n=e[t];r.add(t),Ex.isRef(n)&&n.isSibling?a(n.path,t):pS(n)&&"deps"in n&&n.deps.forEach((e=>a(e,t)))}return Hw.exports.array(Array.from(r),n).reverse()}(r,n._excludedEdges),n}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation((e=>(e.fields={},e.shape(t))))}omit(e){const t=this.clone(),n=t.fields;t.fields={};for(const t of e)delete n[t];return t.withMutation((()=>t.shape(n)))}from(e,t,n){let r=hx.getter(e,!0);return this.transform((i=>{if(null==i)return i;let a=i;return fS(i,e)&&(a=qw({},i),n||delete a[e],a[t]=r(i)),a}))}noUnknown(e=!0,t=IE.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=function(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===n.indexOf(e)))}(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=IE.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>t&&Vw(t,((t,n)=>e(n)))))}camelCase(){return this.transformKeys(jw)}snakeCase(){return this.transformKeys(Fw)}constantCase(){return this.transformKeys((e=>Fw(e).toUpperCase()))}describe(){let e=super.describe();return e.fields=ix(this.fields,(e=>e.describe())),e}}function Qw(e){return new Xw(e)}function eT(){return eT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eT.apply(this,arguments)}function tT(e){return new nT(e)}Qw.prototype=Xw.prototype;class nT extends Mx{constructor(e){super({type:"array"}),this.innerType=void 0,this.innerType=e,this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}))}))}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){const n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1;const i=n.map(((e,n)=>{const i=this.innerType.cast(e,eT({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i}));return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,d=null!=t.originalValue?t.originalValue:e;super._validate(e,t,((e,r)=>{if(e){if(!_S.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r))return void n(a[0]||null,r);d=d||r;let i=new Array(r.length);for(let e=0;e<r.length;e++){let n=r[e],a=`${t.path||""}[${e}]`,o=eT({},t,{path:a,strict:!0,parent:r,index:e,originalValue:d[e]});i[e]=(e,t)=>u.validate(n,o,t)}vS({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)}))}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!pS(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ME(e));return t.innerType=e,t}length(e,t=kE.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return Nx(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||kE.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return Nx(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||kE.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return Nx(t)||t.length<=this.resolve(e)}})}ensure(){return this.default((()=>[])).transform(((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t)))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform((e=>null!=e?e.filter(t):e))}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}tT.prototype=nT.prototype;class rT{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.__inputType=void 0,this.__outputType=void 0,this._resolve=(e,t={})=>{let n=this.builder(e,t);if(!pS(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(t)},this.builder=e}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}validate(e,t,n){return this._resolve(e,t).validate(e,t,n)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,n){return this._resolve(t,n).validateAt(e,t,n)}validateSyncAt(e,t,n){return this._resolve(t,n).validateSyncAt(e,t,n)}describe(){return null}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}}function iT(e,t,n){if(!e||!pS(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if("string"!=typeof t)throw new TypeError("A Method name must be provided");if("function"!=typeof n)throw new TypeError("Method function must be provided");e.prototype[t]=n}var aT=Object.freeze({__proto__:null,mixed:Cx,bool:Dx,boolean:Dx,string:zx,number:jx,date:Vx,object:Qw,array:tT,ref:function(e,t){return new Ex(e,t)},lazy:function(e){return new rT(e)},reach:(e,t,n,r)=>xx(e,t,n,r).schema,isSchema:pS,addMethod:iT,setLocale:function(e){Object.keys(e).forEach((t=>{Object.keys(e[t]).forEach((n=>{$E[t][n]=e[t][n]}))}))},ValidationError:_S,BaseSchema:Mx,MixedSchema:Ox,BooleanSchema:Lx,StringSchema:Px,NumberSchema:Zx,DateSchema:Hx,ObjectSchema:Xw,ArraySchema:nT});const oT=V.default.button`
|
|
179
|
+
Zf((function(e){Object.getOwnPropertyNames(Vp.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatterBuilder.prototype[t]=Vp.prototype[t])})),Object.getOwnPropertyNames(Yp.prototype).forEach((function(t){"constructor"!==t&&(e.DateTimeFormatter.prototype[t]=Yp.prototype[t])})),e.DateTimeFormatter.RFC_1123_DATE_TIME=Yp.RFC_1123_DATE_TIME}));var qp=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Kp=sn,Jp=Rr;var Xp=function(e){return"symbol"==typeof e||Jp(e)&&"[object Symbol]"==Kp(e)},Qp=qp,eh=Hr,th=Xp,nh=qt?qt.prototype:void 0,rh=nh?nh.toString:void 0;var ih=function e(t){if("string"==typeof t)return t;if(eh(t))return Qp(t,e)+"";if(th(t))return rh?rh.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n},ah=ih;var oh=function(e){return null==e?"":ah(e)};var sh=function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a},uh=sh;var ch=function(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:uh(e,t,n)},lh=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var dh=function(e){return lh.test(e)};var fh=function(e){return e.split("")},ph="\\ud800-\\udfff",hh="["+ph+"]",mh="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",gh="\\ud83c[\\udffb-\\udfff]",yh="[^"+ph+"]",_h="(?:\\ud83c[\\udde6-\\uddff]){2}",vh="[\\ud800-\\udbff][\\udc00-\\udfff]",bh="(?:"+mh+"|"+gh+")"+"?",Eh="[\\ufe0e\\ufe0f]?",Sh=Eh+bh+("(?:\\u200d(?:"+[yh,_h,vh].join("|")+")"+Eh+bh+")*"),Ah="(?:"+[yh+mh+"?",mh,_h,vh,hh].join("|")+")",xh=RegExp(gh+"(?="+gh+")|"+Ah+Sh,"g");var wh=function(e){return e.match(xh)||[]},Th=fh,Mh=dh,Oh=wh;var Ch=function(e){return Mh(e)?Oh(e):Th(e)},Nh=ch,Dh=dh,Lh=Ch,Ih=oh;var kh=function(e){return function(t){t=Ih(t);var n=Dh(t)?Lh(t):void 0,r=n?n[0]:t.charAt(0),i=n?Nh(n,1).join(""):t.slice(1);return r[e]()+i}},$h=kh("toUpperCase"),Rh=oh,Fh=$h;var zh=function(e){return Fh(Rh(e).toLowerCase())};function Ph(e){return new DataView(e.buffer,e.byteOffset)}const jh={len:1,get:(e,t)=>Ph(e).getUint8(t),put:(e,t,n)=>(Ph(e).setUint8(t,n),t+1)},Zh={len:2,get:(e,t)=>Ph(e).getUint16(t,!0),put:(e,t,n)=>(Ph(e).setUint16(t,n,!0),t+2)},Uh={len:2,get:(e,t)=>Ph(e).getUint16(t),put:(e,t,n)=>(Ph(e).setUint16(t,n),t+2)},Bh={len:4,get:(e,t)=>Ph(e).getUint32(t,!0),put:(e,t,n)=>(Ph(e).setUint32(t,n,!0),t+4)},Vh={len:4,get:(e,t)=>Ph(e).getUint32(t),put:(e,t,n)=>(Ph(e).setUint32(t,n),t+4)},Hh={len:4,get:(e,t)=>Ph(e).getInt32(t),put:(e,t,n)=>(Ph(e).setInt32(t,n),t+4)},Gh={len:8,get:(e,t)=>Ph(e).getBigUint64(t,!0),put:(e,t,n)=>(Ph(e).setBigUint64(t,n,!0),t+8)};class Yh{constructor(e,t){this.len=e,this.encoding=t,this.textDecoder=new TextDecoder(t)}get(e,t){return this.textDecoder.decode(e.subarray(t,t+this.len))}}class Wh extends Error{constructor(){super("End-Of-Stream")}}class qh{constructor(){this.maxStreamReadSize=1048576,this.endOfStream=!1,this.peekQueue=[]}async peek(e,t,n){const r=await this.read(e,t,n);return this.peekQueue.push(e.subarray(t,t+r)),r}async read(e,t,n){if(0===n)return 0;let r=this.readFromPeekBuffer(e,t,n);if(r+=await this.readRemainderFromStream(e,t+r,n-r),0===r)throw new Wh;return r}readFromPeekBuffer(e,t,n){let r=n,i=0;for(;this.peekQueue.length>0&&r>0;){const n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");const a=Math.min(n.length,r);e.set(n.subarray(0,a),t+i),i+=a,r-=a,a<n.length&&this.peekQueue.push(n.subarray(a))}return i}async readRemainderFromStream(e,t,n){let r=n,i=0;for(;r>0&&!this.endOfStream;){const n=Math.min(r,this.maxStreamReadSize),a=await this.readFromStream(e,t+i,n);if(0===a)break;i+=a,r-=a}return i}}class Kh extends qh{constructor(e){super(),this.reader=e.getReader({mode:"byob"})}async readFromStream(e,t,n){if(this.endOfStream)throw new Wh;const r=await this.reader.read(new Uint8Array(n));return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value,t),r.value.byteLength):0}abort(){return this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}class Jh{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e?.onClose,e?.abortSignal&&e.abortSignal.addEventListener("abort",(()=>{this.abort()}))}async readToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.readBuffer(n,{position:t})<e.len)throw new Wh;return e.get(n,0)}async peekToken(e,t=this.position){const n=new Uint8Array(e.len);if(await this.peekBuffer(n,{position:t})<e.len)throw new Wh;return e.get(n,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new Wh;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new Wh;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){await this.abort(),await(this.onClose?.())}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}abort(){return Promise.resolve()}}class Xh extends Jh{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=t?.fileInfo??{}}async readBuffer(e,t){const n=this.normalizeOptions(e,t),r=n.position-this.position;if(r>0)return await this.ignore(r),this.readBuffer(e,t);if(r<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===n.length)return 0;const i=await this.streamReader.read(e,n.offset,n.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<n.length)throw new Wh;return i}async peekBuffer(e,t){const n=this.normalizeOptions(e,t);let r=0;if(n.position){const t=n.position-this.position;if(t>0){const i=new Uint8Array(n.length+t);return r=await this.peekBuffer(i,{mayBeLess:n.mayBeLess}),e.set(i.subarray(t),n.offset),r-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(n.length>0){try{r=await this.streamReader.peek(e,n.offset,n.length)}catch(e){if(t?.mayBeLess&&e instanceof Wh)return 0;throw e}if(!n.mayBeLess&&r<n.length)throw new Wh}return r}async ignore(e){const t=Math.min(256e3,e),n=new Uint8Array(t);let r=0;for(;r<e;){const i=e-r,a=await this.readBuffer(n,{length:Math.min(t,i)});if(a<0)return a;r+=a}return r}abort(){return this.streamReader.abort()}supportsRandomAccess(){return!1}}class Qh extends Jh{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...t?.fileInfo??{},size:e.length}}async readBuffer(e,t){if(t?.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const n=await this.peekBuffer(e,t);return this.position+=n,n}async peekBuffer(e,t){const n=this.normalizeOptions(e,t),r=Math.min(this.uint8Array.length-n.position,n.length);if(!n.mayBeLess&&r<n.length)throw new Wh;return e.set(this.uint8Array.subarray(n.position,n.position+r),n.offset),r}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function em(e){const{byteLength:t}=e;return 6===t?e.getUint16(0)*2**32+e.getUint32(2):5===t?e.getUint8(0)*2**32+e.getUint32(1):4===t?e.getUint32(0):3===t?65536*e.getUint8(0)+e.getUint16(1):2===t?e.getUint16(0):1===t?e.getUint8(0):void 0}function tm(e,t){const n=e.length,r=t.length;if(0===r)return-1;if(r>n)return-1;const i=n-r;for(let n=0;n<=i;n++){let i=!0;for(let a=0;a<r;a++)if(e[n+a]!==t[a]){i=!1;break}if(i)return n}return-1}new globalThis.TextDecoder("utf8"),new globalThis.TextEncoder,Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const nm={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4},rm=4100;function im(e,t,n){n={offset:0,...n};for(const[r,i]of t.entries())if(n.mask){if(i!==(n.mask[r]&e[r+n.offset]))return!1}else if(i!==e[r+n.offset])return!1;return!0}class am{constructor(e){this.detectors=e?.customDetectors,this.tokenizerOptions={abortSignal:e?.signal},this.fromTokenizer=this.fromTokenizer.bind(this),this.fromBuffer=this.fromBuffer.bind(this),this.parse=this.parse.bind(this)}async fromTokenizer(e){const t=e.position;for(const n of this.detectors||[]){const r=await n(e);if(r)return r;if(t!==e.position)return}return this.parse(e)}async fromBuffer(e){if(!(e instanceof Uint8Array||e instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``);const t=e instanceof Uint8Array?e:new Uint8Array(e);var n,r;if(t?.length>1)return this.fromTokenizer((n=t,r=this.tokenizerOptions,new Qh(n,r)))}async fromBlob(e){return this.fromStream(e.stream())}async fromStream(e){const t=await(n=e,r=this.tokenizerOptions,new Xh(new Kh(n),r));var n,r;try{return await this.fromTokenizer(t)}finally{await t.close()}}async toDetectionStream(e,t){const{sampleSize:n=rm}=t;let r,i;const a=e.getReader({mode:"byob"});try{const{value:e,done:t}=await a.read(new Uint8Array(n));if(i=e,!t&&e)try{r=await this.fromBuffer(e.slice(0,n))}catch(e){if(!(e instanceof Wh))throw e;r=void 0}i=e}finally{a.releaseLock()}const o=new TransformStream({async start(e){e.enqueue(i)},transform(e,t){t.enqueue(e)}}),s=e.pipeThrough(o);return s.fileType=r,s}check(e,t){return im(this.buffer,e,t)}checkString(e,t){return this.check(function(e){return[...e].map((e=>e.charCodeAt(0)))}(e),t)}async parse(e){if(this.buffer=new Uint8Array(rm),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.parse(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(nm);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const n=new DataView(this.buffer.buffer),r={compressedSize:n.getUint32(18,!0),uncompressedSize:n.getUint32(22,!0),filenameLength:n.getUint16(26,!0),extraFieldLength:n.getUint16(28,!0)};if(r.filename=await e.readToken(new Yh(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),/classes\d*\.dex/.test(r.filename))return{ext:"apk",mime:"application/vnd.android.package-archive"};if("META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};case"visio":return{ext:"vsdx",mime:"application/vnd.visio"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){let i=await e.readToken(new Yh(r.compressedSize,"utf-8"));switch(i=i.trim(),i){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let a=-1;for(;a<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),a=tm(this.buffer,new Uint8Array([80,75,3,4])),await e.ignore(a>=0?a:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(o){if(!(o instanceof Wh))throw o}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const s=new Uint8Array(8);return await e.readBuffer(s),im(s,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:im(s,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:im(s,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:im(s,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:im(s,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:im(s,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const u=new Yh(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(u){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return u.startsWith("3g")?u.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/x-flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){try{await e.ignore(1350);const c=10485760,l=new Uint8Array(Math.min(c,e.fileInfo.size));if(await e.readBuffer(l,{mayBeLess:!0}),function(e,t){return-1!==tm(e,t)}(l,(new TextEncoder).encode("AIPrivateData")))return{ext:"ai",mime:"application/postscript"}}catch(d){if(!(d instanceof Wh))throw d}return{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const f=await this.readTiffHeader(!1);if(f)return f}if(this.check([77,77])){const p=await this.readTiffHeader(!0);if(p)return p}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function h(){const t=await e.peekNumber(jh);let n=128,r=0;for(;!(t&n)&&0!==n;)++r,n>>=1;const i=new Uint8Array(r+1);return await e.readBuffer(i),i}async function m(){const e=await h(),t=await h();t[0]^=128>>t.length-1;const n=Math.min(6,t.length),r=new DataView(e.buffer),i=new DataView(t.buffer,t.length-n,n);return{id:em(r),len:em(i)}}async function g(t){for(;t>0;){const n=await m();if(17026===n.id){return(await e.readToken(new Yh(n.len))).replaceAll(/\00.*$/g,"")}await e.ignore(n.len),--t}}const y=await m();switch(await g(y.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1"))return{ext:"parquet",mime:"application/x-parquet"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const _=new Yh(4,"latin1").get(this.buffer,2);if(_.match("^d*")&&_>=1e3&&_<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new Yh(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.checkString("WEBVTT")&&["\n","\r","\t"," ","\0"].some((e=>this.checkString(e,{offset:6}))))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){async function v(){return{length:await e.readToken(Hh),type:await e.readToken(new Yh(4,"latin1"))}}await e.ignore(8);do{const b=await v();if(b.length<0)return;switch(b.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(b.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function E(){const t=new Uint8Array(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(Gh))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const S=await E();let A=S.size-24;if(im(S.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const x=new Uint8Array(16);if(A-=await e.readBuffer(x),im(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(im(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(A)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new Yh(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const w=new DataView(this.buffer.buffer).getUint32(12,!0);if(w>12&&this.buffer.length>=w+16)try{const T=(new TextDecoder).decode(this.buffer.slice(16,w+16));if(JSON.parse(T).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const n=Number.parseInt(new Yh(6).get(e,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(n))return!1;let r=256;for(let n=t;n<t+148;n++)r+=e[n];for(let n=t+156;n<t+512;n++)r+=e[n];return n===r}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}async readTiffTag(e){const t=await this.tokenizer.readToken(e?Uh:Zh);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}async readTiffIFD(e){const t=await this.tokenizer.readToken(e?Uh:Zh);for(let n=0;n<t;++n){const t=await this.readTiffTag(e);if(t)return t}}async readTiffHeader(e){const t=(e?Uh:Zh).get(this.buffer,2),n=(e?Vh:Bh).get(this.buffer,4);if(42===t){if(n>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(n>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}await this.tokenizer.ignore(n);return await this.readTiffIFD(e)??{ext:"tif",mime:"image/tiff"}}if(43===t)return{ext:"tif",mime:"image/tiff"}}}new Set(["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","ai","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk"]),new Set(["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/x-apache-arrow","video/mp4","audio/midi","video/x-matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/x-flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/x-parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive"]),exports.FileHelper=void 0,function(e){e.truncateFileName=(e,n)=>{let r,i=e,a=0;if(n&&n.current&&(r=t(n.current),a=n.current.getBoundingClientRect().width),r&&r.measureText(e).width>a){const t="...";let n="",o="",s=0,u=e.length-1,c=t,l=c;for(;s<u;){if(n+=e.charAt(s),c=n+t+o,r.measureText(c).width>a){i=l;break}if(l=c,o=e.charAt(u)+o,c=n+t+o,r.measureText(c).width>a){i=l;break}l=c,s++,u--}}return i};const t=e=>{const t=document.createDocumentFragment(),n=document.createElement("canvas");t.appendChild(n);const r=n.getContext("2d"),i=window.getComputedStyle(e);return r.font=i.font?i.font:`${i.fontSize}" "${i.fontFamily}`,r};e.fileToDataUrl=async e=>{if(window&&window.FileReader)return new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=e=>n(e)}))},e.dataUrlToBlob=async e=>(await fetch(e)).blob(),e.getFilesizeFromBase64=e=>{const t=e.length;return.75*t-(e.substring(t-2,2).match(/=/g)?.length||0)},e.extensionsToSentence=(e,t)=>{let r=e.map((e=>`.${e.toUpperCase()}`));return t?.setBothJpegAndJpgIfEitherExists&&(r=n(r)),new Intl.ListFormat("en-GB",{style:"long",type:"disjunction"}).format(new Set(r))};const n=e=>{const t=[...e],n=e.includes(".JPG"),r=e.includes(".JPEG");if(n&&r||!n&&!r)return t;const{index:i,toAdd:a}=t.indexOf(".JPG")>-1?{index:t.indexOf(".JPG"),toAdd:".JPEG"}:{index:t.indexOf(".JPEG"),toAdd:".JPG"};return t.splice(i+1,0,a),t};e.fileExtensionToMimeType=e=>{switch(e.toLowerCase()){case"jpg":case"jpeg":return"image/jpeg";case"png":return"image/png";case"gif":return"image/gif";case"heic":return"image/heic";case"heif":return"image/heif";case"webp":return"image/webp"}},e.getType=async e=>{const t=await e.arrayBuffer(),n=await async function(e){return(new am).fromBuffer(e)}(t);if(!n&&e.type.startsWith("text")){const t=e.name||".txt";return{mime:e.type,ext:t.substring(t.lastIndexOf(".")+1,t.length)}}return n},e.deduplicateFileName=(t,n,r,i=r,a=1)=>{if(t.filter(((e,t)=>t!==n)).includes(r)){const o=i.split("."),s=o.pop();return s?(r=o.join(".").concat(` (${a}).`).concat(s),e.deduplicateFileName(t,n,r,i,++a)):r}return r},e.sanitizeFileName=e=>{const t=e.split(".");let n,r;2===t.length&&""===t[0]?r=e:t.length>1?(n=t.pop(),r=t.join(".")):r=t.join(".");let i=r.replace(/[^\u0020-\u007E]*/g,"");return i||(i="file"),n?`${i}.${n}`:`${i}`},e.blobToFile=(e,t)=>{const{name:n,lastModified:r}=t;return new File([e],n,{type:e.type,lastModified:r})}}(exports.FileHelper||(exports.FileHelper={}));const om={COMMON:{FIELD_REQUIRED:"This field is required.",REQUIRED_OPTION:"An option is required.",REQUIRED_OPTIONS:"Both options are required."},CONTACT:{INVALID_SINGAPORE_NUMBER:"Invalid Singapore number.",INVALID_INTERNATIONAL_NUMBER:"Invalid international number."},DATE:{MUST_BE_FUTURE:"Date must be in the future.",MUST_BE_PAST:"Date must be in the past.",CANNOT_BE_FUTURE:"Date cannot be in the future.",CANNOT_BE_PAST:"Date cannot be in the past.",MIN_DATE:e=>`Date cannot be earlier than ${e}.`,MAX_DATE:e=>`Date cannot be later than ${e}.`,DISABLED_DATES:"Date is not allowed.",INVALID:"Invalid date.",WITHIN_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be within ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`},BEYOND_DAYS:e=>{const{numberOfDays:t,fromDate:n}=e,r=Math.abs(t);return`Date must be beyond ${r} ${1!==r?"days":"day"} ${t>0?"from":"prior to"} ${n?` ${n}`:" today"}.`}},DATE_RANGE:{MUST_BE_FUTURE:"Dates must be in the future.",MUST_BE_PAST:"Dates must be in the past.",CANNOT_BE_FUTURE:"Dates cannot be in the future.",CANNOT_BE_PAST:"Dates cannot be in the past.",MIN_DATE:e=>`Dates cannot be earlier than ${e}.`,MAX_DATE:e=>`Dates cannot be later than ${e}.`,DISABLED_DATES:"Date range should not include disabled dates.",INVALID:"Invalid dates",REQUIRED:"Both dates are required",MUST_HAVE_NUMBER_OF_DAYS:e=>`Selection should have ${e} days.`},EMAIL:{INVALID:"Invalid email address."},ESIGNATURE:{UPLOAD:"Signature not uploaded."},GENERIC:{INVALID:"Invalid input",UNSUPPORTED:"This component is not supported by the engine."},OTP_VERIFICATION:{EMAIL_VERIFICATION_REQUIRED:"Please verify your email.",PHONE_VERIFICATION_REQUIRED:"Please verify your contact number.",OTP_REQUIRED:"OTP is required.",INVALID_EMAIL:"Enter a valid email address.",INVALID_PHONE:"Enter a valid contact number.",INVALID_OTP:"Wrong OTP. Please try again.",SEND_OTP_FAILED:"Failed to send OTP. Please try again.",OTP_VERIFICATION_FAILED:"Something went wrong. Please request another OTP."},UPLOAD:(t="file",n=`${t}s`)=>({REQUIRED:`Upload at least 1 ${t}.`,MAX_FILES:e=>`Upload failed. You can only upload a maximum of ${e} ${1!==e?n:t}.`,MAX_FILES_WITH_REMAINING:e=>`Upload failed. You can only upload ${e} more ${1===e?t:n}. To upload more ${n}, you may wish to delete your previously uploaded ${n}.`,MAX_FILE_SIZE:e=>`Upload failed. ${zh(t)} exceeds the maximum size of ${e} KB.`,GENERIC:"Upload failed. Please try again.",FILE_TYPE:e=>`Upload failed. Only ${exports.FileHelper.extensionsToSentence(e,{setBothJpegAndJpgIfEitherExists:!0})} files are accepted.`,FILE_EXTENSION:e=>`Upload failed. Only files with the following file extensions are accepted: ${exports.FileHelper.extensionsToSentence(e)}.`,UPLOADING:`Please wait for all ${n} to finish uploading.`,MODAL:{FILE_TYPE:{TITLE:`Unsupported ${t} format`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," could not be uploaded. Try again with a"," ",exports.FileHelper.extensionsToSentence(n)," file."]})},GENERIC_ERROR:{TITLE:`${zh(t)} not uploaded`,DESCRIPTION:t=>e.jsxs(e.Fragment,{children:["There was a problem uploading ",t,". Please try again."]}),INVALID_FILE_NAME:`Invalid ${t} name`},MAX_FILE_SIZE:{TITLE:`${zh(t)} exceeds maximum size`,DESCRIPTION:(t,n)=>e.jsxs(e.Fragment,{children:[t," exceeds the maximum size of ",n," KB."]})}}}),SLIDER:{MUST_BE_INCREMENTAL:"Input must be incremental."},UNIT_NUMBER:{INVALID:"Invalid unit number."},LOCATION:{MUST_HAVE_POSTAL_CODE:"Selected location must have postal code."},ARRAY_FIELD:{INVALID:"One or more of the sections is incomplete",REQUIRED:"At least one section must be filled in",MIN:e=>`At least ${e} ${1===e?"entry":"entries"} must be provided`,MAX:e=>`No more than ${e} ${1===e?"entry":"entries"} can be provided`,LENGTH:e=>`Exactly ${e} ${1===e?"entry":"entries"} must be provided`,UNIQUE:"One or more fields are not unique"}};var sm;!function(e){function t(e,t,n){if(e)try{const r=ef.ofPattern(t).withResolverStyle(Ql.STRICT).withLocale(Hp.ENGLISH);switch(n){case"date":return bf.parse(e,r);case"time":return Af.parse(e,r);case"datetime":return Sf.parse(e,r);default:return}}catch(e){return}}function n(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||bf.now();return n>=0?{startDate:a,endDate:a.plusDays(n)}:{startDate:a.plusDays(n),endDate:a}}e.formatDateTime=(e,t,n,r)=>{if(e)try{const i=ef.ofPattern(t).withResolverStyle(Ql.STRICT).withLocale(Hp.ENGLISH);switch(n){case"date":return bf.parse(e).format(i);case"time":return Af.parse(e).format(i);case"datetime":return Sf.parse(e).format(i);default:return r||om.GENERIC.INVALID}}catch(e){return r||om.GENERIC.INVALID}},e.toLocalDateOrTime=t,e.calculateWithinDaysRange=n,e.calculateDisabledWithinDaysRange=function(e){const{numberOfDays:t,inclusive:r}=e,{startDate:i,endDate:a}=n(e);return t>=0?{startDate:r?i:i.plusDays(1),endDate:a}:{startDate:i,endDate:r?a:a.minusDays(1)}},e.calculateDisabledBeyondDaysRange=function(e){const{numberOfDays:n,fromDate:r,dateFormat:i="uuuu-MM-dd"}=e,a=r&&t(r,i,"date")||bf.now(),o={startDate:void 0,endDate:void 0};return n>=0?o.startDate=a.plusDays(n+1):o.endDate=a.plusDays(n-1),o},e.checkWithinDays=function(e,r){if(!e)return!0;const{dateFormat:i="uuuu-MM-dd"}=r,a=t(e,i,"date");if(!a)return!1;const{startDate:o,endDate:s}=n(r),{numberOfDays:u,inclusive:c}=r;if(u>=0){const e=c?o.minusDays(1):o,t=s.plusDays(1);return a.isAfter(e)&&a.isBefore(t)}{const e=o.minusDays(1),t=c?s.plusDays(1):s;return a.isAfter(e)&&a.isBefore(t)}},e.checkBeyondDays=function(e,n){if(!e)return!0;const{dateFormat:r="uuuu-MM-dd"}=n,i=t(e,r,"date");if(!i)return!1;const{numberOfDays:a,fromDate:o}=n,s=o&&t(o,r,"date")||bf.now();return a>=0?i.isAfter(s.plusDays(a)):i.isBefore(s.plusDays(a))}}(sm||(sm={})),exports.GeoLocationHelper=void 0,function(e){const t=async(e,t)=>new Promise(((n,r)=>{"geolocation"in navigator?navigator.geolocation.getCurrentPosition((({coords:e})=>n({lat:e.latitude,lng:e.longitude})),(e=>r(e)),{enableHighAccuracy:!0,timeout:e,maximumAge:t}):r(new Error("geolocation not supported in this browser"))}));e.getCurrentLocation=async(e={})=>{const{maxAttempts:n=3,timeout:r=2e3,maximumAge:i=2e3}=e;let a=0;do{a++;try{return await t(r,i)}catch(e){if(a>=n||!e||e.code!==e.TIMEOUT)throw e}}while(a<n);throw"Failed to get current location"}}(exports.GeoLocationHelper||(exports.GeoLocationHelper={}));const um=()=>Array(5).fill(0).map((()=>Math.random().toString(36).slice(2))).join("");class cm{constructor(e){if(function(e){return"object"!=typeof e||void 0===e.length||void 0===e.readUInt8||void 0===e.readUInt16LE||void 0===e.readUInt16BE||void 0===e.readUInt32LE||void 0===e.readUInt32BE||void 0===e.readInt32LE||void 0===e.readInt32BE}(e))throw new Error("DataView: Passed buffer type is unsupported.");this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}}function lm(e,t,n){try{return new DataView(e,t,n)}catch(r){return new cm(e,t,n)}}function dm(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return mm(r)}function fm(e,t){const n=[];let r=0;for(;t+r<e.byteLength;){const i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return mm(n)}function pm(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),mm(r)}function hm(e,t){const n=e.getUint8(t);return[n,dm(e,t+1,n)]}function mm(e){return e.map((e=>String.fromCharCode(e))).join("")}function gm(){for(let e=1;e<arguments.length;e++)for(const t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function ym(e,t,n){let r=!1;Object.defineProperty(e,t,{get:()=>(r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]),configurable:!0,enumerable:!0})}function _m(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),((e,t)=>e+String.fromCharCode(t)),"")):"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function vm(e,t){return new Array(t+1).join(e)}const bm=void 0;function Em(e,t,n,r="string"){if(0===t&&"function"==typeof DecompressionStream){const t=new DecompressionStream("deflate"),i=new Blob([e]).stream().pipeThrough(t);return"dataview"===r?new Response(i).arrayBuffer().then((e=>new DataView(e))):new Response(i).arrayBuffer().then((e=>new TextDecoder(n).decode(e)))}return void 0!==t?Promise.reject(`Unknown compression method ${t}.`):e}var Sm=!0,Am=!0;function xm(e){return e.map((e=>String.fromCharCode(e))).join("")}function wm(e){if(e.length>=8){const t=xm(e.slice(0,8));if("ASCII\0\0\0"===t)return xm(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t)return"[Undefined encoding]"}return"Undefined"}function Tm(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}const Mm=18761,Om=19789;var Cm={BIG_ENDIAN:Om,LITTLE_ENDIAN:Mm,getByteOrder:function(e,t){if(e.getUint16(t)===Mm)return Mm;if(e.getUint16(t)===Om)return Om;throw new Error("Illegal byte order value. Faulty image.")}};var Nm={isTiffFile:function(e){return!!e&&e.byteLength>=4&&function(e){const t=42,n=2,r=e.getUint16(0)===Cm.LITTLE_ENDIAN;return e.getUint16(n,r)===t}(e)},findTiffOffsets:function(){return{hasAppMarkers:!0,tiffHeaderOffset:0}}};var Dm={isJpegFile:function(e){return!!e&&e.byteLength>=Lm&&e.getUint16(0)===Im},findJpegOffsets:function(e){let t,n,r,i,a,o,s,u,c,l=km;for(;l+$m+5<=e.byteLength;){if(fg(e,l))t=e.getUint16(l+Rm),n=l+Rm;else if(pg(e,l))t=e.getUint16(l+Rm),r=l+Rm;else if(gg(e,l))t=e.getUint16(l+Rm),i=l+Fm;else if(yg(e,l))t=e.getUint16(l+Rm),a=l+zm;else if(_g(e,l))s||(s=[]),t=e.getUint16(l+Rm),s.push(bg(l,t));else if(vg(e,l))s||(s=[]),t=e.getUint16(l+Rm),s.push(Eg(l,t));else if(Sg(e,l))t=e.getUint16(l+Rm),o=l+Pm;else if(hg(e,l)){t=e.getUint16(l+Rm);const n=l+Um,r=t-(Um-Rm),i=e.getUint8(l+Hm),a=e.getUint8(l+Gm);u||(u=[]),u.push({offset:n,length:r,chunkNumber:i,chunksTotal:a})}else if(mg(e,l))t=e.getUint16(l+Rm),c=l+Bm;else{if(!Ag(e,l)){if(xg(e,l)){l++;continue}break}t=e.getUint16(l+Rm)}l+=Rm+t}return{hasAppMarkers:l>km,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:a,iptcDataOffset:o,xmpChunks:s,iccChunks:u,mpfDataOffset:c}}};const Lm=2,Im=65496,km=2,$m=4,Rm=2,Fm=2,zm=10,Pm=18,jm=33,Zm=79,Um=18,Bm=8,Vm="ICC_PROFILE\0",Hm=$m+Vm.length,Gm=Hm+1,Ym="MPF\0",Wm=65472,qm=65474,Km=65476,Jm=65499,Xm=65501,Qm=65498,eg=65504,tg=65505,ng=65506,rg=65517,ig=65519,ag=65534,og=65535,sg="JFIF",ug="Exif",cg="http://ns.adobe.com/xap/1.0/\0",lg="http://ns.adobe.com/xmp/extension/\0",dg="Photoshop 3.0";function fg(e,t){return e.getUint16(t)===Wm}function pg(e,t){return e.getUint16(t)===qm}function hg(e,t){const n=Vm.length;return e.getUint16(t)===ng&&dm(e,t+$m,n)===Vm}function mg(e,t){const n=Ym.length;return e.getUint16(t)===ng&&dm(e,t+$m,n)===Ym}function gg(e,t){const n=sg.length;return e.getUint16(t)===eg&&dm(e,t+$m,n)===sg&&0===e.getUint8(t+$m+n)}function yg(e,t){const n=ug.length;return e.getUint16(t)===tg&&dm(e,t+$m,n)===ug&&0===e.getUint8(t+$m+n)}function _g(e,t){return e.getUint16(t)===tg&&function(e,t){const n=cg.length;return dm(e,t+$m,n)===cg}(e,t)}function vg(e,t){return e.getUint16(t)===tg&&function(e,t){const n=lg.length;return dm(e,t+$m,n)===lg}(e,t)}function bg(e,t){return{dataOffset:e+jm,length:t-(jm-Rm)}}function Eg(e,t){return{dataOffset:e+Zm,length:t-(Zm-Rm)}}function Sg(e,t){const n=dg.length;return e.getUint16(t)===rg&&dm(e,t+$m,n)===dg&&0===e.getUint8(t+$m+n)}function Ag(e,t){const n=e.getUint16(t);return n>=eg&&n<=ig||n===ag||n===Wm||n===qm||n===Km||n===Jm||n===Xm||n===Qm}function xg(e,t){return e.getUint16(t)===og}var wg={isPngFile:function(e){return!!e&&dm(e,0,Tg.length)===Tg},findPngOffsets:function(e,t){const n={hasAppMarkers:!1};let r=Tg.length;for(;r+Mg+Og<=e.byteLength;){if(jg(e,r))n.hasAppMarkers=!0,n.pngHeaderOffset=r+Dg;else if(Zg(e,r)){const t=Gg(e,r);void 0!==t&&(n.hasAppMarkers=!0,n.xmpChunks=[{dataOffset:t,length:e.getUint32(r+Cg)-(t-(r+Dg))}])}else if(Ug(e,r,t)){n.hasAppMarkers=!0;const t=dm(e,r+Ng,Og);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+Cg),type:t,offset:r+Dg})}else if(Bg(e,r))n.hasAppMarkers=!0,n.tiffHeaderOffset=r+Dg;else if(t&&Vg(e,r)){n.hasAppMarkers=!0;const t=e.getUint32(r+Cg),i=r+Dg,{profileName:a,compressionMethod:o,compressedProfileOffset:s}=Yg(e,i);n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:s,length:t-(s-i),chunkNumber:1,chunksTotal:1,profileName:a,compressionMethod:o})}else Hg(e,r)&&(n.hasAppMarkers=!0,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+Cg));r+=e.getUint32(r+Cg)+Mg+Og+4}return n}};const Tg="PNG\r\n\n",Mg=4,Og=4,Cg=0,Ng=Mg,Dg=Mg+Og,Lg="XML:com.adobe.xmp\0",Ig="tEXt",kg="iTXt",$g="zTXt",Rg="pHYs",Fg="tIME",zg="eXIf",Pg="iCCP";function jg(e,t){return"IHDR"===dm(e,t+Ng,Og)}function Zg(e,t){return dm(e,t+Ng,Og)===kg&&dm(e,t+Dg,Lg.length)===Lg}function Ug(e,t,n){const r=dm(e,t+Ng,Og);return r===Ig||r===kg||r===$g&&n}function Bg(e,t){return dm(e,t+Ng,Og)===zg}function Vg(e,t){return dm(e,t+Ng,Og)===Pg}function Hg(e,t){const n=[Rg,Fg],r=dm(e,t+Ng,Og);return n.includes(r)}function Gg(e,t){t+=Dg+Lg.length+1+1;let n=0;for(;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function Yg(e,t){const n=fm(e,t);t+=n.length+1;return{profileName:n,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}function Wg(e,t,n,r){const{offsets:i,sizes:a}=function(e,t){const n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4);n.item.constructionMethod=1===e||2===e?2:0;const r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),o=e.getUint8(i.offsetSize)>>4;a.item.extent.extentOffset=o;const s=15&e.getUint8(i.lengthSize);a.item.extent.extentLength=s;const u=e.getUint8(i.baseOffsetSize)>>4;a.item.baseOffset=u;const c=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t);return}(e,i.indexSize,t);a.item.extent.extentIndex=void 0!==c?c:0;const l=function(e,t,n){if(n<2)return e.getUint16(t);if(2===n)return e.getUint32(t);return}(e,i.itemCount,t);return{type:"iloc",items:qg(e,t,i,a,o,s,c,l),length:r}}function qg(e,t,n,r,i,a,o,s){if(void 0===s)return[];const u=[];let c=n.items;for(let n=0;n<s;n++){const n={extents:[]};n.itemId=Kg(e,c,t),c+=r.item.itemId,n.constructionMethod=1===t||2===t?15&e.getUint16(c):void 0,c+=r.item.constructionMethod,n.dataReferenceIndex=e.getUint16(c),c+=r.item.dataReferenceIndex,n.baseOffset=Xg(e,c,r.item.baseOffset),c+=r.item.baseOffset,n.extentCount=e.getUint16(c),c+=r.item.extentCount;for(let s=0;s<n.extentCount;s++){const s={};s.extentIndex=Jg(e,t,c,o),c+=r.item.extent.extentIndex,s.extentOffset=Xg(e,c,i),c+=r.item.extent.extentOffset,s.extentLength=Xg(e,c,a),c+=r.item.extent.extentLength,n.extents.push(s)}u.push(n)}return u}function Kg(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function Jg(e,t,n,r){if((1===t||2===t)&&r>0)return Xg(e,n,r)}function Xg(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}const Qg=1165519206,ey=1835625829,ty=1970432288;function ny(e,t){const{length:n,contentOffset:r}=function(e,t){const n=4,r=4,i=8,a=12,o=e.getUint32(t);if(function(e){return 0===e}(o))return{length:e.byteLength-t,contentOffset:t+n+r};if(function(e){return 1===e}(o)&&function(e,t){const n=8;return 0===e.getUint32(t+n)}(e,t))return{length:e.getUint32(t+a),contentOffset:t+n+r+i};return{length:o,contentOffset:t+n+r}}(e,t);if(n<8)return;const i=e.getUint32(t+4);if(1718909296===i)return function(e,t,n){const r=dm(e,t,4);return{type:"ftyp",majorBrand:r,length:n}}(e,r,n);if(1768977008===i)return function(e,t,n,r){return{type:"iprp",subBoxes:oy(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1768973167===i)return function(e,t,n,r){return{type:"ipco",properties:oy(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1668246642===i)return function(e,t,n){return{type:"colr",icc:ay(e,t),length:n}}(e,r,n);const a=e.getUint8(r);return 1835365473===i?function(e,t,n,r){const i=3;return{type:"meta",subBoxes:oy(e,n+i,r-(n+i-t)),length:r}}(e,t,r+1,n):1768714083===i?Wg(e,a,r+1,n):1768517222===i?function(e,t,n,r,i){const{offsets:a}=function(e,t){const n={entryCount:t+3},r={};r.entryCount=0===e?2:4;return n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r);return{type:"iinf",itemInfos:oy(e,a.itemInfos,i-(a.itemInfos-t)),length:i}}(e,t,a,r+1,n):1768842853===i?function(e,t,n,r,i){r+=3;const a={type:"infe",length:i};0!==n&&1!==n||(a.itemId=e.getUint16(r),r+=2,a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemName=fm(e,r),r+=a.itemName.length+1);n>=2&&(2===n?(a.itemId=e.getUint16(r),r+=2):3===n&&(a.itemId=e.getUint32(r),r+=4),a.itemProtectionIndex=e.getUint16(r),r+=2,a.itemType=e.getUint32(r),r+=4,a.itemName=fm(e,r),r+=a.itemName.length+1,a.itemType===ey?(a.contentType=fm(e,r),t+i>(r+=a.contentType.length+1)&&(a.contentEncoding=fm(e,r),r+=a.contentEncoding.length+1)):a.itemType===ty&&(a.itemUri=fm(e,r),r+=a.itemUri.length+1));return a}(e,t,a,r+1,n):{type:void 0,length:n}}function ry(e){{const t={},n=function(e){const t=4,n=4;let r=0;for(;r+t+n<=e.byteLength;){const t=ny(e,r);if(void 0===t)break;if("meta"===t.type)return t;r+=t.length}return}(e);return n?(t.tiffHeaderOffset=function(e,t){try{const n=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===Qg))}(t).itemId,r=iy(t,n);return function(e,t){return t+4+e.getUint32(t)}(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n),t.xmpChunks=function(e){try{const t=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===ey&&"application/rdf+xml"===e.contentType))}(e).itemId,n=iy(e,t),r=iy(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n),t.iccChunks=function(e){try{const t=e.subBoxes.find((e=>"iprp"===e.type)).subBoxes.find((e=>"ipco"===e.type)).properties.find((e=>"colr"===e.type)).icc;if(t)return[t]}catch(e){}return}(n),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:!1}}}function iy(e,t){return e.subBoxes.find((e=>"iloc"===e.type)).items.find((e=>e.itemId===t))}function ay(e,t){const n=dm(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function oy(e,t,n){const r=[Qg,ey],i=[];let a=t;for(;a<t+n;){const t=ny(e,a);if(void 0===t)break;void 0===t.type||void 0!==t.itemType&&-1===r.indexOf(t.itemType)||i.push(t),a+=t.length}return i}var sy={isHeicFile:function(e){if(!e)return!1;const t=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const n=ny(e,0);return n&&-1!==t.indexOf(n.majorBrand)}catch(e){return!1}},findHeicOffsets:function(e){return ry(e)}};var uy={isAvifFile:function(e){if(!e)return!1;try{const t=ny(e,0);return t&&"avif"===t.majorBrand}catch(e){return!1}},findAvifOffsets:function(e){return ry(e)}};var cy={isWebpFile:function(e){const t="RIFF",n="WEBP";return!!e&&dm(e,0,4)===t&&dm(e,8,4)===n},findOffsets:function(e){const t="Exif\0\0";let n,r,i,a,o=12,s=!1;for(;o+8<e.byteLength;){const u=dm(e,o,4),c=e.getUint32(o+4,!0);"EXIF"===u?(s=!0,n=dm(e,o+8,6)===t?o+8+6:o+8):"XMP "===u?(s=!0,r=[{dataOffset:o+8,length:c}]):"ICCP"===u?(s=!0,i=[{offset:o+8,length:c,chunkNumber:1,chunksTotal:1}]):"VP8X"===u&&(s=!0,a=o+8),o+=8+(c%2==0?c:c+1)}return{hasAppMarkers:s,tiffHeaderOffset:n,xmpChunks:r,iccChunks:i,vp8xChunkOffset:a}}};var ly={isGifFile:function(e){return!!e&&fy.includes(dm(e,0,dy))},findOffsets:function(){return{gifHeaderOffset:0}}};const dy=6,fy=["GIF87a","GIF89a"];var py={isXMLFile:function(e){return!!e&&dm(e,hy,my.length)===my},findOffsets:function(e){const t=[];return t.push({dataOffset:hy,length:e.byteLength}),{xmpChunks:t}}};const hy=0,my="<?xpacket begin";var gy={parseAppMarkers:function(e,t){if(Nm.isTiffFile(e))return yy(Nm.findTiffOffsets(),"tiff","TIFF");if(Dm.isJpegFile(e))return yy(Dm.findJpegOffsets(e),"jpeg","JPEG");if(wg.isPngFile(e))return yy(wg.findPngOffsets(e,t),"png","PNG");if(sy.isHeicFile(e))return yy(sy.findHeicOffsets(e),"heic","HEIC");if(uy.isAvifFile(e))return yy(uy.findAvifOffsets(e),"avif","AVIF");if(cy.isWebpFile(e))return yy(cy.findOffsets(e),"webp","WebP");if(ly.isGifFile(e))return yy(ly.findOffsets(e),"gif","GIF");if(py.isXMLFile(e))return yy(py.findOffsets(e),"xml","XML");throw new Error("Invalid image format")}};function yy(e,t,n){return gm({},e,{fileType:{value:t,description:n}})}var _y={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace:e=>1===e?"sRGB":65535===e?"Uncalibrated":"Unknown",ComponentsConfiguration:e=>e.map((e=>49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0)).join(""),Contrast:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",CustomRendered:e=>0===e?"Normal process":1===e?"Custom process":"Unknown",ExposureMode:e=>0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown",ExposureProgram:e=>0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown",ExposureTime(e){if(e[0]/e[1]>.25){const t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[0]?`1/${Math.round(e[1]/e[0])}`:`0/${e[1]}`},FNumber:e=>"f/"+e[0]/e[1],FocalLength:e=>e[0]/e[1]+" mm",FocalPlaneResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",LightSource:e=>1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown",MeteringMode:e=>1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown",ResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",Saturation:e=>0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown",SceneCaptureType:e=>0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown",Sharpness:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",ShutterSpeedValue(e){const t=Math.pow(2,e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance:e=>0===e?"Auto white balance":1===e?"Manual white balance":"Unknown",XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},vy={11:"ProcessingSoftware",254:{name:"SubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"}[e]||"Unknown")},255:{name:"OldSubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"}[e]||"Unknown")},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:e=>({1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"}[e]||"Unknown")},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:e=>({1:"Normal",2:"Reversed"}[e]||"Unknown")},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:e=>1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:_y.XResolution},283:{name:"YResolution",description:_y.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:e=>""+Math.round(e[0]/e[1])},287:{name:"YPosition",description:e=>""+Math.round(e[0]/e[1])},290:{name:"GrayResponseUnit",description:e=>({1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"}[e]||"Unknown")},296:{name:"ResolutionUnit",description:_y.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:e=>({1:"CMYK",2:"Not CMYK"}[e]||"Unknown")},337:"TargetPrinter",338:{name:"ExtraSamples",description:e=>({0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"}[e]||"Unknown")},339:{name:"SampleFormat",description:e=>{const t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((e=>t[e]||"Unknown")).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map((e=>""+e[0]/e[1])).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>1===e?"centered":2===e?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map((e=>""+e[0]/e[1])).join(", ")},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:e=>e.join("; ")},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:by},40092:{name:"XPComment",description:by},40093:{name:"XPAuthor",description:by},40094:{name:"XPKeywords",description:by},40095:{name:"XPSubject",description:by},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:e=>({0:"Unsafe",1:"Safe"}[e]||"Unknown")},50778:{name:"CalibrationIlluminant1",description:_y.LightSource},50779:{name:"CalibrationIlluminant2",description:_y.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50885:"SRawType",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:{name:"ProfileEmbedPolicy",description:e=>({0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"}[e]||"Unknown")},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:e=>({1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"}[e]||"Unknown")},50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:{name:"ProfileHueSatMapEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51108:{name:"ProfileLookTableEncoding",description:e=>({0:"Linear",1:"sRGB"}[e]||"Unknown")},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:e=>({0:"Auto",1:"None"}[e]||"Unknown")},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function by(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}var Ey={33434:{name:"ExposureTime",description:_y.ExposureTime},33437:{name:"FNumber",description:_y.FNumber},34850:{name:"ExposureProgram",description:_y.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:e=>({1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"}[e]||"Unknown")},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:e=>xm(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:_y.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:_y.ShutterSpeedValue},37378:{name:"ApertureValue",description:_y.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},37382:{name:"SubjectDistance",description:e=>e[0]/e[1]+" m"},37383:{name:"MeteringMode",description:_y.MeteringMode},37384:{name:"LightSource",description:_y.LightSource},37385:{name:"Flash",description:e=>0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:_y.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:e=>({C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"}[e]||"Unknown")},37395:"ImageHistory",37396:{name:"SubjectArea",description:e=>2===e.length?`Location; X: ${e[0]}, Y: ${e[1]}`:3===e.length?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:4===e.length?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:wm},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:e=>e[0]/e[1]+" °C"},37889:{name:"Humidity",description:e=>e[0]/e[1]+" %"},37890:{name:"Pressure",description:e=>e[0]/e[1]+" hPa"},37891:{name:"WaterDepth",description:e=>e[0]/e[1]+" m"},37892:{name:"Acceleration",description:e=>e[0]/e[1]+" mGal"},37893:{name:"CameraElevationAngle",description:e=>e[0]/e[1]+" °"},40960:{name:"FlashpixVersion",description:e=>e.map((e=>String.fromCharCode(e))).join("")},40961:{name:"ColorSpace",description:_y.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:_y.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,t])=>`X: ${e}, Y: ${t}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>3===e?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>1===e?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:_y.CustomRendered},41986:{name:"ExposureMode",description:_y.ExposureMode},41987:{name:"WhiteBalance",description:_y.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>0===e[0]?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:e=>0===e?"Unknown":e},41990:{name:"SceneCaptureType",description:_y.SceneCaptureType},41991:{name:"GainControl",description:e=>0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"},41992:{name:"Contrast",description:_y.Contrast},41993:{name:"Saturation",description:_y.Saturation},41994:{name:"Sharpness",description:_y.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;if(0===e[3][1])return`${t} f/?`;const n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${t} f/${parseFloat(n.toFixed(5))}`}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:e=>({1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"}[e]||"Unknown")},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",42240:"Gamma",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},Sy={0:{name:"GPSVersionID",description:e=>2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:Tm},3:{name:"GPSLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:Tm},5:{name:"GPSAltitudeRef",description:e=>0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map((([e,t])=>{const n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n})).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:"GPSDestLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:"GPSDestBearingRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:wm},28:{name:"GPSAreaInformation",description:wm},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},Ay={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>xm(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},xy={45056:{name:"MPFVersion",description:e=>xm(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};const wy=gm({},vy,Ey),Ty="0th",My="1st",Oy="exif",Cy="gps",Ny="interoperability",Dy="mpf",Ly="canon";var Iy={[Ty]:wy,[My]:vy,[Oy]:wy,[Cy]:Sy,[Ny]:Ay,[Dy]:xy,[Ly]:{4:{name:"ShotInfo",description:e=>e}}};const ky={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},$y={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13};var Ry={getAsciiValue:function(e){return e.map((e=>String.fromCharCode(e)))},getByteAt:Fy,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===Cm.LITTLE_ENDIAN)},getLongAt:zy,getRationalAt:function(e,t,n){return[zy(e,t,n),zy(e,t+4,n)]},getUndefinedAt:function(e,t){return Fy(e,t)},getSlongAt:Py,getSrationalAt:function(e,t,n){return[Py(e,t,n),Py(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return zy(e,t,n)},typeSizes:ky,tagTypes:$y,getTypeSize:function(e){if(void 0===$y[e])throw new Error("No such type found.");return ky[$y[e]]}};function Fy(e,t){return e.getUint8(t)}function zy(e,t,n){return e.getUint32(t,n===Cm.LITTLE_ENDIAN)}function Py(e,t,n){return e.getInt32(t,n===Cm.LITTLE_ENDIAN)}const jy={1:Ry.getByteAt,2:Ry.getAsciiAt,3:Ry.getShortAt,4:Ry.getLongAt,5:Ry.getRationalAt,7:Ry.getUndefinedAt,9:Ry.getSlongAt,10:Ry.getSrationalAt,13:Ry.getIfdPointerAt};function Zy(e,t,n){return t+Ry.getLongAt(e,t+4,n)}function Uy(e,t,n,r,i,a){const o=Ry.getTypeSize("SHORT"),s={},u=function(e,t,n){if(t+Ry.getTypeSize("SHORT")<=e.byteLength)return Ry.getShortAt(e,t,n);return 0}(e,r,i);r+=o;for(let o=0;o<u&&!(r+12>e.byteLength);o++){const o=By(e,t,n,r,i,a);void 0!==o&&(s[o.name]={id:o.id,value:o.value,description:o.description},"MakerNote"===o.name&&(s[o.name].__offset=o.__offset)),r+=12}if(r<e.byteLength-Ry.getTypeSize("LONG")){const o=Ry.getLongAt(e,r,i);0!==o&&t===Ty&&(s.Thumbnail=Uy(e,"1st",n,n+o,i,a))}return s}function By(e,t,n,r,i,a){const o=Ry.getTypeSize("SHORT"),s=o+Ry.getTypeSize("SHORT"),u=s+Ry.getTypeSize("LONG"),c=Ry.getShortAt(e,r,i),l=Ry.getShortAt(e,r+o,i),d=Ry.getLongAt(e,r+s,i);let f,p;if(void 0===Ry.typeSizes[l]||!a&&void 0===Iy[t][c])return;if(function(e,t){return Ry.typeSizes[e]*t<=Ry.getTypeSize("LONG")}(l,d))p=r+u,f=Vy(e,p,l,d,i);else if(p=Ry.getLongAt(e,r+u,i),function(e,t,n,r,i){return t+n+Ry.typeSizes[r]*i<=e.byteLength}(e,n,p,l,d)){f=Vy(e,n+p,l,d,i,33723===c)}else f="<faulty value>";l===Ry.tagTypes.ASCII&&(f=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(f),f=function(e){try{return e.map((e=>decodeURIComponent(escape(e))))}catch(t){return e}}(f));let h=`undefined-${c}`,m=f;if(void 0!==Iy[t][c])if(void 0!==Iy[t][c].name&&void 0!==Iy[t][c].description){h=Iy[t][c].name;try{m=Iy[t][c].description(f)}catch(e){m=Hy(f)}}else l===Ry.tagTypes.RATIONAL||l===Ry.tagTypes.SRATIONAL?(h=Iy[t][c],m=""+f[0]/f[1]):(h=Iy[t][c],m=Hy(f));return{id:c,name:h,value:f,description:m,__offset:p}}function Vy(e,t,n,r,i,a=!1){let o=[];a&&(r*=Ry.typeSizes[n],n=Ry.tagTypes.BYTE);for(let a=0;a<r;a++)o.push(jy[n](e,t,i)),t+=Ry.typeSizes[n];return n===Ry.tagTypes.ASCII?o=Ry.getAsciiValue(o):1===o.length&&(o=o[0]),o}function Hy(e){return e instanceof Array?e.join(", "):e}const Gy="Exif IFD Pointer",Yy="GPS Info IFD Pointer",Wy="Interoperability IFD Pointer";var qy={read:function(e,t,n){const r=Cm.getByteOrder(e,t);let i=function(e,t,n,r){return Uy(e,Ty,t,Zy(e,t,n),n,r)}(e,t,r,n);return i=Ky(i,e,t,r,n),i=Jy(i,e,t,r,n),i=Xy(i,e,t,r,n),{tags:i,byteOrder:r}}};function Ky(e,t,n,r,i){return void 0!==e[Gy]?gm(e,Uy(t,Oy,n,n+e[Gy].value,r,i)):e}function Jy(e,t,n,r,i){return void 0!==e[Yy]?gm(e,Uy(t,"gps",n,n+e[Yy].value,r,i)):e}function Xy(e,t,n,r,i){return void 0!==e[Wy]?gm(e,Uy(t,Ny,n,n+e[Wy].value,r,i)):e}var Qy={read:function(e,t,n){const r=Cm.getByteOrder(e,t),i=Uy(e,"mpf",t,Zy(e,t,r),r,n);return function(e,t,n,r){if(!n.MPEntry)return n;const i=[];for(let a=0;a<Math.ceil(n.MPEntry.value.length/e_);a++){i[a]={};const o=t_(n.MPEntry.value,a*e_,Ry.getTypeSize("LONG"),r);i[a].ImageFlags=n_(o),i[a].ImageFormat=r_(o),i[a].ImageType=i_(o);const s=t_(n.MPEntry.value,a*e_+4,Ry.getTypeSize("LONG"),r);i[a].ImageSize={value:s,description:""+s};const u=a_(a,n.MPEntry,r,t);i[a].ImageOffset={value:u,description:""+u};const c=t_(n.MPEntry.value,a*e_+12,Ry.getTypeSize("SHORT"),r);i[a].DependentImage1EntryNumber={value:c,description:""+c};const l=t_(n.MPEntry.value,a*e_+14,Ry.getTypeSize("SHORT"),r);i[a].DependentImage2EntryNumber={value:l,description:""+l},i[a].image=e.buffer.slice(u,u+s),ym(i[a],"base64",(function(){return _m(this.image)}))}return n.Images=i,n}(e,t,i,r)}};const e_=16;function t_(e,t,n,r){if(r===Cm.LITTLE_ENDIAN){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function n_(e){const t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function r_(e){const t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function i_(e){const t=16777215&e;return{value:t,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[t]||"Unknown"}}function a_(e,t,n,r){return function(e){return 0===e}(e)?0:t_(t.value,e*e_+8,Ry.getTypeSize("LONG"),n)+r}var o_={read:function(e,t){const n=function(e,t){return Ry.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=7;if(r+1>n)return;const i=Ry.getByteAt(e,t+r);return{value:i,description:""+i}}(e,t,n);return{"Bits Per Sample":s_(e,t,n),"Image Height":u_(e,t,n),"Image Width":c_(e,t,n),"Color Components":r,Subsampling:r&&l_(e,t,r.value,n)}}};function s_(e,t,n){if(3>n)return;const r=Ry.getByteAt(e,t+2);return{value:r,description:""+r}}function u_(e,t,n){if(5>n)return;const r=Ry.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function c_(e,t,n){if(7>n)return;const r=Ry.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function l_(e,t,n,r){if(8+3*n>r)return;const i=[];for(let r=0;r<n;r++){const n=t+8+3*r;i.push([Ry.getByteAt(e,n),Ry.getByteAt(e,n+1),Ry.getByteAt(e,n+2)])}return{value:i,description:i.length>1?d_(i)+f_(i):""}}function d_(e){const t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((e=>t[e[0]])).join("")}function f_(e){const t={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var p_={read:function(e,t){const n=function(e,t){return Ry.getShortAt(e,t)}(e,t),r=function(e,t,n){const r=14;if(r+1>n)return;const i=Ry.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),i=function(e,t,n){const r=15;if(r+1>n)return;const i=Ry.getByteAt(e,t+r);return{value:i,description:`${i}px`}}(e,t,n),a={"JFIF Version":h_(e,t,n),"Resolution Unit":m_(e,t,n),XResolution:y_(e,t,n),YResolution:__(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){const o=function(e,t,n,r){const i=16;if(0===n||i+n>r)return;const a=e.buffer.slice(t+i,t+i+n);return{value:a,description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);o&&(a["JFIF Thumbnail"]=o)}for(const e in a)void 0===a[e]&&delete a[e];return a}};function h_(e,t,n){if(9>n)return;const r=Ry.getByteAt(e,t+7),i=Ry.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}function m_(e,t,n){if(10>n)return;const r=Ry.getByteAt(e,t+9);return{value:r,description:g_(r)}}function g_(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function y_(e,t,n){if(12>n)return;const r=Ry.getShortAt(e,t+10);return{value:r,description:""+r}}function __(e,t,n){if(14>n)return;const r=Ry.getShortAt(e,t+12);return{value:r,description:""+r}}var v_={iptc:{256:{name:"Model Version",description:e=>((e[0]<<8)+e[1]).toString()},261:{name:"Destination",repeatable:!0},276:{name:"File Format",description:e=>((e[0]<<8)+e[1]).toString()},278:{name:"File Format Version",description:e=>((e[0]<<8)+e[1]).toString()},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:b_},336:{name:"Time Sent",description:E_},346:{name:"Coded Character Set",description:S_,encoding_name:S_},356:"UNO",376:{name:"ARM Identifier",description:e=>((e[0]<<8)+e[1]).toString()},378:{name:"ARM Version",description:e=>((e[0]<<8)+e[1]).toString()},512:{name:"Record Version",description:e=>((e[0]<<8)+e[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:e=>"01"===xm(e)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const t=xm(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:e=>{const t=xm(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:b_},572:{name:"Time Created",description:E_},574:{name:"Digital Creation Date",description:b_},575:{name:"Digital Creation Time",description:E_},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const t=xm(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:e=>e},642:"Image Type",643:{name:"Image Orientation",description:e=>{const t=xm(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const t=xm(e),n=t.charAt(0),r=t.charAt(1);let i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:e=>parseInt(xm(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const t=parseInt(xm(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const t=xm(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>2===e.length?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(2===e.length){const t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":`Unknown format ${t}`}return xm(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,t)=>{const n={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},r=xm(e);if(t["ObjectData Preview File Format"]){const e=xm(t["ObjectData Preview File Format"].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function b_(e){const t=xm(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function E_(e){const t=xm(e);let n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function S_(e){const t=xm(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var A_={get:function(){if("undefined"!=typeof TextDecoder)return TextDecoder;return}};var x_={decode:function(e,t){const n=A_.get();if(void 0!==n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t.map((e=>String.fromCharCode(e))).join(""))},TAG_HEADER_SIZE:5};var w_={read:function(e,t,n){try{if(Array.isArray(e))return C_(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n);const{naaBlock:r,dataOffset:i}=function(e,t){for(;t+12<=e.byteLength;){const n=T_(e,t);if(M_(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+O_(n)}throw new Error("No IPTC NAA resource block.")}(e,t);return C_(e,r,i,n)}catch(e){return{}}}};function T_(e,t){if(943868237!==e.getUint32(t,!1))throw new Error("Not an IPTC resource block.");const n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function M_(e){return 1028===e.type}function O_(e){return e.size%2!=0?1:0}function C_(e,t,n,r){const i={};let a;const o=n+t.size;for(;n<o&&n<e.byteLength;){const{tag:t,tagSize:o}=N_(e,n,i,a,r);if(null===t)break;t&&("encoding"in t&&(a=t.encoding),void 0===i[t.name]||void 0===t.repeatable?i[t.name]={id:t.id,value:t.value,description:t.description}:(i[t.name]instanceof Array||(i[t.name]=[{id:i[t.name].id,value:i[t.name].value,description:i[t.name].description}]),i[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=5+o}return i}function N_(e,t,n,r,i){if(function(e,t){const n=28;return e.getUint8(t)!==n}(e,t))return{tag:null,tagSize:0};const a=e.getUint16(t+1),o=e.getUint16(t+3);if(!i&&!v_.iptc[a])return{tag:void 0,tagSize:o};const s=function(e,t,n){const r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,o),u={id:a,name:D_(v_.iptc[a],a,s),value:s,description:L_(v_.iptc[a],s,n,r)};return function(e){return v_.iptc[e]&&v_.iptc[e].repeatable}(a)&&(u.repeatable=!0),function(e){return v_.iptc[e]&&void 0!==v_.iptc[e].encoding_name}(a)&&(u.encoding=v_.iptc[a].encoding_name(s)),{tag:u,tagSize:o}}function D_(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:`undefined-${t}`}function L_(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?x_.decode(r,t):t}var I_={"tiff:Orientation":e=>"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e,"tiff:ResolutionUnit":e=>_y.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>k_(_y.XResolution,e),"tiff:YResolution":e=>k_(_y.YResolution,e),"exif:ApertureValue":e=>k_(_y.ApertureValue,e),"exif:GPSLatitude":R_,"exif:GPSLongitude":R_,"exif:FNumber":e=>k_(_y.FNumber,e),"exif:FocalLength":e=>k_(_y.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>_y.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>_y.ColorSpace(function(e){if("0x"===e.substring(0,2))return parseInt(e.substring(2),16);return parseInt(e,10)}(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){const e=t.split(", ").map((e=>e.charCodeAt(0)));return _y.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>_y.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>_y.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>_y.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>_y.ExposureProgram(parseInt(e,10)),"exif:ExposureTime":e=>$_(e)?_y.ExposureTime(e.split("/").map((e=>parseInt(e,10)))):e,"exif:MeteringMode":e=>_y.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>_y.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>_y.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>_y.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>k_(_y.ShutterSpeedValue,e),"exif:WhiteBalance":e=>_y.WhiteBalance(parseInt(e,10))};function k_(e,t){return $_(t)?e(t.split("/")):t}function $_(e){return/^-?\d+\/-?\d+$/.test(e)}function R_(e){const[t,n]=e.split(",");if(void 0!==t&&void 0!==n){const e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return""+(e+r/60)+i}return e}var F_={get:function(e){if(e)return e;if("undefined"!=typeof DOMParser)return new DOMParser;try{const{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new e({onError:t})}catch(e){return}}};function z_(e){const t=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!t)return e;const n=t[1],r=function(e){const t=[],n=/xmlns:([\w-]+)=["'][^"']+["']/g;let r;for(;null!==(r=n.exec(e));)-1===t.indexOf(r[1])&&t.push(r[1]);return t}(e),i=function(e){const t=[],n=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let r;for(;null!==(r=n.exec(e));){const e=r[1];"xmlns"!==e&&"xml"!==e&&(-1===t.indexOf(e)&&t.push(e))}return t}(e),a=i.filter((e=>-1===r.indexOf(e)));if(0===a.length)return e;const o=function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],i=P_[r]||"http://fallback.namespace/"+r;t.push(" xmlns:"+r+'="'+i+'"')}return t.join("")}(a);return function(e,t,n){const r=new RegExp("<"+t+"([^>]*)>");return e.replace(r,"<"+t+"$1"+n+">")}(e,n,o)}const P_={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};var j_={read:function(e,t,n){const r={};if("string"==typeof e)return B_(r,e,n),r;const[i,a]=function(e,t){if(0===t.length)return[];const n=[U_(e,t.slice(0,1))];t.length>1&&n.push(U_(e,t.slice(1)));return n}(e,t),o=B_(r,i,n);if(a){const i=B_(r,a,n);o||i||(delete r._raw,B_(r,U_(e,t),n))}return r}};class Z_ extends Error{constructor(e){super(e),this.name="ParseError"}}function U_(e,t){const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;for(let n=0;n<t.length;n++){const a=t[n],o=e.buffer.slice(a.dataOffset,a.dataOffset+a.length);r.set(new Uint8Array(o),i),i+=a.length}return new DataView(r.buffer)}function B_(e,t,n){try{const{doc:r,raw:i}=function(e,t){const n=F_.get(t);if(!n)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const r="string"==typeof e?e:dm(e,0,e.byteLength),i=V_(n,(a=r,a.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")));var a;return{doc:i,raw:r}}(t,n);e._raw=(e._raw||"")+i;return gm(e,W_(G_(H_(r),!0))),!0}catch(e){return!1}}function V_(e,t,n=!1){try{const n=e.parseFromString(t,"application/xml"),r=n.getElementsByTagName("parsererror");if(r.length>0)throw new Z_(r[0].textContent);return n}catch(r){if("ParseError"===r.name&&function(e){const t=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/];for(let n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}(r)&&!n)return V_(e,z_(t),!0);throw r}}function H_(e){for(let t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return H_(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw new Error}function G_(e,t=!1){const n=function(e){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(r=n).length&&"#text"===r[0].nodeName?t?{}:function(e){return e.nodeValue}(n[0]):function(e){const t={};return e.forEach((e=>{if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){const n=function(e){return{attributes:Y_(e),value:G_(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(n);var r}function Y_(e){const t={};for(let n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function W_(e){const t={};if("string"==typeof e)return e;for(const n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach((e=>{gm(t,q_(e.attributes)),"object"==typeof e.value&&gm(t,tv(e.value))}))}return t}function q_(e){const t={};for(const n in e)try{K_(n)&&(t[X_(n)]={value:e[n],attributes:{},description:Q_(e[n],n)})}catch(e){}return t}function K_(e){return"rdf:parseType"!==e&&!J_(e)}function J_(e){return"xmlns"===e.split(":")[0]}function X_(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function Q_(e,t=void 0){if(Array.isArray(e)){const n=function(e){return e.map((e=>void 0!==e.value?Q_(e.value):Q_(e))).join(", ")}(e);return t&&"function"==typeof I_[t]?I_[t](e,n):n}if("object"==typeof e)return function(e){const t=[];for(const n in e)t.push(`${ev(n)}: ${Q_(e[n].value)}`);return t.join("; ")}(e);try{return t&&"function"==typeof I_[t]?I_[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function ev(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function tv(e){const t={};for(const n in e)try{J_(n)||(t[X_(n)]=nv(e[n],n))}catch(e){}return t}function nv(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return dv(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:rv(e)?iv(e,t):ov(e)?sv(e,t):uv(e)?cv(e,t):function(e){return void 0!==lv(e.value)}(e)?function(e,t){let n=lv(e.value).value["rdf:li"];const r=av(e),i=[];void 0===n?n=[]:Array.isArray(n)||(n=[n]);return n.forEach((e=>{i.push(function(e){if(rv(e))return iv(e);if(ov(e))return sv(e).value;if(uv(e))return cv(e).value;return dv(e)}(e))})),{value:i,attributes:r,description:Q_(i,t)}}(e,t):dv(e,t)}function rv(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function iv(e,t){const n=av(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),gm(n,av(e),function(e){const t={};for(const n in e.value)"rdf:value"===n||J_(n)||(t[X_(n)]=e.value[n].value);return t}(e));const r=function(e){return fv(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:Q_(r,t)}}function av(e){const t={};for(const n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||J_(n)||(t[X_(n)]=e.attributes[n]);return t}function ov(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function sv(e,t){const n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(gm(n.value,q_(e.value["rdf:Description"].attributes)),gm(n.attributes,av(e)),e=e.value["rdf:Description"]),gm(n.value,tv(e.value)),n.description=Q_(n.value,t),n}function uv(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function cv(e,t){const n=q_(e.attributes);return{value:n,attributes:{},description:Q_(n,t)}}function lv(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function dv(e,t){const n=fv(e)||W_(e.value);return{value:n,attributes:av(e),description:Q_(n,t)}}function fv(e){return e.attributes&&e.attributes["rdf:resource"]}const pv=0,hv=1,mv=2,gv=3,yv=4,_v=5,vv=6,bv=7,Ev=8;var Sv={2e3:{name:"PathInformation",description:function(e){const t={},n=[];for(let r=0;r<e.byteLength;r+=26){const i=Ry.getShortAt(e,r);Av[i]&&(t[i]||(t[i]=Av[i].description),n.push({type:i,path:Av[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description(e){const[,t]=hm(e,0);return t}}};const Av={[pv]:{description:"Closed subpath length",path:(e,t)=>[Ry.getShortAt(e,t)]},[hv]:{description:"Closed subpath Bezier knot, linked",path:xv},[mv]:{description:"Closed subpath Bezier knot, unlinked",path:xv},[gv]:{description:"Open subpath length",path:(e,t)=>[Ry.getShortAt(e,t)]},[yv]:{description:"Open subpath Bezier knot, linked",path:xv},[_v]:{description:"Open subpath Bezier knot, unlinked",path:xv},[vv]:{description:"Path fill rule",path:()=>[]},[Ev]:{description:"Initial fill rule",path:(e,t)=>[Ry.getShortAt(e,t)]},[bv]:{description:"Clipboard",path:function(e,t){return[[Tv(e,t,8),Tv(e,t+4,8),Tv(e,t+8,8),Tv(e,t+12,8)],Tv(e,t+16,8)]}}};function xv(e,t){const n=[];for(let r=0;r<24;r+=8)n.push(wv(e,t+r));return n}function wv(e,t){const n=Tv(e,t,8);return[Tv(e,t+4,8),n]}function Tv(e,t,n){const r=Ry.getLongAt(e,t),i=r>>>31==0?1:-1,a=(2130706432&r)>>>32-n,o=r&parseInt(vm("1",32-n),2);return i*function(e,t){return parseInt(e.replace(".",""),t)/Math.pow(t,(e.split(".")[1]||"").length)}(a.toString(2)+"."+function(e,t,n){return vm(n,t-e.length)+e}(o.toString(2),32-n,"0"),2)}var Mv={read:function(e,t){const n=lm(new Uint8Array(e).buffer),r={};let i=0;for(;i<e.length;){const e=dm(n,i,Dv);i+=Dv;const a=Ry.getShortAt(n,i);i+=Cv;const{tagName:o,tagNameSize:s}=Lv(n,i);i+=s;const u=Ry.getLongAt(n,i);if(i+=Nv,e===Ov){const e=lm(n.buffer,i,u),s={id:a,value:dm(e,0,u)};if(Sv[a]){try{s.description=Sv[a].description(e)}catch(e){s.description="<no description formatter>"}r[o||Sv[a].name]=s}else t&&(r[`undefined-${a}`]=s)}i+=u+u%2}return r}};const Ov="8BIM",Cv=2,Nv=4,Dv=Ov.length;function Lv(e,t){const[n,r]=hm(e,t);return{tagName:r,tagNameSize:1+n+(n%2==0?1:0)}}const Iv={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},kv={4:{name:"Preferred CMM type",value:(e,t)=>dm(e,t,4),description:e=>null!==e?$v(e):""},8:{name:"Profile Version",value:(e,t)=>e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,t)=>dm(e,t,4),description:e=>{switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:(e,t)=>dm(e,t,4)},20:{name:"Connection Space",value:(e,t)=>dm(e,t,4)},24:{name:"ICC Profile Date",value:(e,t)=>function(e,t){const n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),a=e.getUint16(t+6),o=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,a,o,s))}(e,t).toISOString()},36:{name:"ICC Signature",value:(e,t)=>{return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:(e,t)=>dm(e,t,4),description:e=>$v(e)},48:{name:"Device Manufacturer",value:(e,t)=>dm(e,t,4),description:e=>$v(e)},52:{name:"Device Model Number",value:(e,t)=>dm(e,t,4)},64:{name:"Rendering Intent",value:(e,t)=>e.getUint32(t),description:e=>{switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:(e,t)=>dm(e,t,4)}};function $v(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}var Rv={read:function(e,t,n){if(n&&t[0].compressionMethod!==bm)return function(e,t){if(n=t[0].compressionMethod,0!==n)return{};var n;const r=new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length));return Em(r,t[0].compressionMethod,"utf-8","dataview").then(Gv).catch((()=>({})))}(e,t);return function(e,t){try{const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;const a=function(e){if(Array.isArray(e))return new DataView(Uint8Array.from(e).buffer).buffer;return e.buffer}(e);for(let e=1;e<=t.length;e++){const n=t.find((t=>t.chunkNumber===e));if(!n)throw new Error(`ICC chunk ${e} not found`);const o=a.slice(n.offset,n.offset+n.length),s=new Uint8Array(o);r.set(s,i),i+=s.length}return Gv(new DataView(r.buffer))}catch(e){return{}}}(e,t)}};const Fv=84,zv=128,Pv="acsp",jv="desc",Zv="mluc",Uv="text",Bv="sig ",Vv=12;function Hv(e,t){return e.length<t+Vv}function Gv(e){const t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw new Error("ICC profile length not matching");if(e.length<Fv)throw new Error("ICC profile too short");const r={},i=Object.keys(kv);for(let t=0;t<i.length;t++){const n=i[t],a=kv[n],o=a.value(e,parseInt(n,10));let s=o;a.description&&(s=a.description(o)),r[a.name]={value:o,description:s}}if(Yv(t.slice(36,40))!==Pv)throw new Error("ICC profile: missing signature");if(function(e){return e.length<zv+4}(t))return r;const a=e.getUint32(128);let o=132;for(let n=0;n<a;n++){if(Hv(t,o))return r;const n=dm(e,o,4),i=e.getUint32(o+4),a=e.getUint32(o+8);if(i>t.length)return r;const s=dm(e,i,4);if(s===jv){const o=e.getUint32(i+8);if(o>a)return r;Wv(r,n,Yv(t.slice(i+12,i+o+11)))}else if(s===Zv){const t=e.getUint32(i+8),a=e.getUint32(i+12);let o=i+16;const s=[];for(let n=0;n<t;n++){const t=dm(e,o+0,2),n=dm(e,o+2,2),r=e.getUint32(o+4),u=e.getUint32(o+8),c=pm(e,i+u,r);s.push({languageCode:t,countryCode:n,text:c}),o+=a}if(1===t)Wv(r,n,s[0].text);else{const e={};for(let t=0;t<s.length;t++)e[`${s[t].languageCode}-${s[t].countryCode}`]=s[t].text;Wv(r,n,e)}}else if(s===Uv){Wv(r,n,Yv(t.slice(i+8,i+a-7)))}else if(s===Bv){Wv(r,n,Yv(t.slice(i+8,i+12)))}o+=12}return r}function Yv(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Wv(e,t,n){Iv[t]?e[Iv[t].name]={value:n,description:n}:e[t]={value:n,description:n}}const qv=27;var Kv={read:function(e,t,n,r,i){let a=Uy(e,Ly,t,t+n,r,i);a.ShotInfo&&(a=gm({},a,function(e){const t={};void 0!==e[27]&&(t.AutoRotate={value:e[27],description:Jv(e[27])});return t}(a.ShotInfo.value)),delete a.ShotInfo);return a},SHOT_INFO_AUTO_ROTATE:qv};function Jv(e){return 0===e?"None":1===e?"Rotate 90 CW":2===e?"Rotate 180":3===e?"Rotate 270 CW":"Unknown"}var Xv={read:function(e,t){return{"Image Width":Qv(e,t),"Image Height":eb(e,t),"Bit Depth":tb(e,t),"Color Type":nb(e,t),Compression:rb(e,t),Filter:ib(e,t),Interlace:ab(e,t)}}};function Qv(e,t){if(t+0+4>e.byteLength)return;const n=Ry.getLongAt(e,t);return{value:n,description:`${n}px`}}function eb(e,t){if(t+4+4>e.byteLength)return;const n=Ry.getLongAt(e,t+4);return{value:n,description:`${n}px`}}function tb(e,t){if(t+8+1>e.byteLength)return;const n=Ry.getByteAt(e,t+8);return{value:n,description:`${n}`}}function nb(e,t){if(t+9+1>e.byteLength)return;const n=Ry.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}function rb(e,t){if(t+10+1>e.byteLength)return;const n=Ry.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}function ib(e,t){if(t+11+1>e.byteLength)return;const n=Ry.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}function ab(e,t){if(t+12+1>e.byteLength)return;const n=Ry.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}var ob={read:function(e,t,n,r){const i={},a=[];for(let o=0;o<t.length;o++){const{offset:s,length:u,type:c}=t[o],l=mb(e,s,u,c,n);if(l instanceof Promise)a.push(l.then((({name:e,value:t,description:n})=>{try{if(Sm&&Eb(e,t))return{__exif:qy.read(Ab(t),hb,r).tags};if(Am&&Sb(e,t))return{__iptc:w_.read(Ab(t),0,r)};if(e&&!Eb(e,t)&&!Sb(e,t))return{[e]:{value:t,description:n}}}catch(e){}return{}})));else{const{name:e,value:t,description:n}=l;e&&(i[e]={value:t,description:n})}}return{readTags:i,readTagsPromise:a.length>0?Promise.all(a):void 0}}};const sb="STATE_KEYWORD",ub="STATE_COMPRESSION",cb="STATE_LANG",lb="STATE_TRANSLATED_KEYWORD",db="STATE_TEXT",fb=1,pb=1,hb=6;function mb(e,t,n,r,i){const a=[],o=[];let s,u=sb,c=bm;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===ub){c=gb({type:r,dataView:e,offset:t+i}),r===kg&&(i+=fb),u=yb(r,u);continue}if(u===db){s=new DataView(e.buffer.slice(t+i,t+n));break}const l=e.getUint8(t+i);0===l?u=yb(r,u):u===sb?a.push(l):u===cb&&o.push(l)}if(c!==bm&&!i)return{};const l=Em(s,c,function(e){if(e===Ig||e===$g)return"latin1";return"utf-8"}(r));return l instanceof Promise?l.then((e=>_b(e,r,o,a))).catch((()=>_b("<text using unknown compression>".split(""),r,o,a))):_b(l,r,o,a)}function gb({type:e,dataView:t,offset:n}){if(e===kg){if(t.getUint8(n)===pb)return t.getUint8(n+1)}else if(e===$g)return t.getUint8(n);return bm}function yb(e,t){return t===sb&&[kg,$g].includes(e)?ub:t===ub?e===kg?cb:db:t===cb?lb:db}function _b(e,t,n,r){const i=function(e){if(e instanceof DataView)return dm(e,0,e.byteLength);return e}(e);return{name:vb(t,n,r),value:i,description:t===kg?bb(e):i}}function vb(e,t,n){const r=mm(n);if(e===Ig||0===t.length)return r;return`${r} (${mm(t)})`}function bb(e){return x_.decode("UTF-8",e)}function Eb(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function Sb(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function Ab(e){return function(e){const t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var xb={read:function(e,t){const n={};for(let r=0;r<t.length;r++){const i=Ry.getLongAt(e,t[r]+Cg),a=dm(e,t[r]+Ng,Og);a===Rg?(n["Pixels Per Unit X"]=wb(e,t[r],i),n["Pixels Per Unit Y"]=Tb(e,t[r],i),n["Pixel Units"]=Mb(e,t[r],i)):a===Fg&&(n["Modify Date"]=Ob(e,t[r],i))}return n}};function wb(e,t,n){if(!Cb(e,t,n,0,4))return;const r=Ry.getLongAt(e,t+Dg+0);return{value:r,description:""+r}}function Tb(e,t,n){if(!Cb(e,t,n,4,4))return;const r=Ry.getLongAt(e,t+Dg+4);return{value:r,description:""+r}}function Mb(e,t,n){if(!Cb(e,t,n,8,1))return;const r=Ry.getByteAt(e,t+Dg+8);return{value:r,description:1===r?"meters":"Unknown"}}function Ob(e,t,n){if(!Cb(e,t,n,0,7))return;const r=Ry.getShortAt(e,t+Dg),i=Ry.getByteAt(e,t+Dg+2),a=Ry.getByteAt(e,t+Dg+3),o=Ry.getByteAt(e,t+Dg+4),s=Ry.getByteAt(e,t+Dg+5),u=Ry.getByteAt(e,t+Dg+6);return{value:[r,i,a,o,s,u],description:`${Nb(r,4)}-${Nb(i,2)}-${Nb(a,2)} ${Nb(o,2)}:${Nb(s,2)}:${Nb(u,2)}`}}function Cb(e,t,n,r,i){return r+i<=n&&t+Dg+r+i<=e.byteLength}function Nb(e,t){return`${"0".repeat(t-(""+e).length)}${e}`}var Db={read:function(e,t){const n={},r=Ry.getByteAt(e,t);return n.Alpha=kb(r),n.Animation=$b(r),n.ImageWidth=Rb(e,t+Lb),n.ImageHeight=Rb(e,t+Ib),n}};const Lb=4,Ib=7;function kb(e){const t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}function $b(e){const t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}function Rb(e,t){const n=Ry.getByteAt(e,t)+256*Ry.getByteAt(e,t+1)+65536*Ry.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var Fb={read:function(e){return{"GIF Version":zb(e),"Image Width":Pb(e),"Image Height":jb(e),"Global Color Map":Zb(e),"Bits Per Pixel":Bb(e),"Color Resolution Depth":Ub(e)}}};function zb(e){if(6>e.byteLength)return;const t=dm(e,3,3);return{value:t,description:t}}function Pb(e){if(8>e.byteLength)return;const t=e.getUint16(6,!0);return{value:t,description:`${t}px`}}function jb(e){if(10>e.byteLength)return;const t=e.getUint16(8,!0);return{value:t,description:`${t}px`}}function Zb(e){if(11>e.byteLength)return;const t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}function Ub(e){if(11>e.byteLength)return;const t=1+((112&e.getUint8(10))>>>4);return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}function Bb(e){if(11>e.byteLength)return;const t=1+(7&e.getUint8(10));return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}const Vb=[6,7,99];var Hb={get:function(e,t,n){if(r=t,r&&(void 0===r.Compression||Vb.includes(r.Compression.value))&&r.JPEGInterchangeFormat&&r.JPEGInterchangeFormat.value&&r.JPEGInterchangeFormatLength&&r.JPEGInterchangeFormatLength.value){t.type="image/jpeg";const r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),ym(t,"base64",(function(){return _m(this.image)}))}var r;return t}};function Gb(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=(new Error).stack}Gb.prototype=new Error;var Yb,Wb,qb={MetadataMissingError:Gb},Kb={load:function(e,t={}){if(function(e){return"string"==typeof e}(e))return t.async=!0,function(e,t){if(/^\w+:\/\//.test(e))return"undefined"!=typeof fetch?function(e,{length:t}={}){const n={method:"GET"};Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-"+(t-1)});return fetch(e,n).then((e=>e.arrayBuffer()))}(e,t):function(e,{length:t}={}){return new Promise(((n,r)=>{const i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-"+(t-1)});const a=function(e){if(/^https:\/\//.test(e))return __non_webpack_require__("https").get;return __non_webpack_require__("http").get}(e);a(e,i,(e=>{if(e.statusCode>=200&&e.statusCode<=299){const t=[];e.on("data",(e=>t.push(Buffer.from(e)))),e.on("error",(e=>r(e))),e.on("end",(()=>n(Buffer.concat(t))))}else r(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`),e.resume()})).on("error",(e=>r(e)))}))}(e,t);if(function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e))return Promise.resolve(function(e){const t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer;if("undefined"==typeof Buffer)return;return void 0!==Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}const n=decodeURIComponent(t);return"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(e=>e.charCodeAt(0))).buffer}(e));return function(e,{length:t}={}){return new Promise(((n,r)=>{const i=function(){try{return __non_webpack_require__("fs")}catch(e){return}}();i.open(e,((a,o)=>{a?r(a):i.stat(e,((a,s)=>{if(a)r(a);else{const a=Math.min(s.size,void 0!==t?t:s.size),u=Buffer.alloc(a),c={buffer:u,length:a};i.read(o,c,(t=>{t?r(t):i.close(o,(t=>{t&&console.warn(`Could not close file ${e}:`,t),n(u)}))}))}}))}))}))}(e,t)}(e,t).then((e=>Jb(e,t)));if(function(e){return"undefined"!=typeof File&&e instanceof File}(e))return t.async=!0,(n=e,new Promise(((e,t)=>{const r=new FileReader;r.onload=t=>e(t.target.result),r.onerror=()=>t(r.error),r.readAsArrayBuffer(n)}))).then((e=>Jb(e,t)));var n;return Jb(e,t)},loadView:Xb,errors:qb};function Jb(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return!1}}(e)&&(e=new Uint8Array(e).buffer),Xb(function(e){try{return new DataView(e)}catch(t){return new cm(e)}}(e),t)}function Xb(e,{expanded:t=!1,async:n=!1,includeUnknown:r=!1,domParser:i}={expanded:!1,async:!1,includeUnknown:!1,domParser:void 0}){let a=!1,o={};const s=[],{fileType:u,fileDataOffset:c,jfifDataOffset:l,tiffHeaderOffset:d,iptcDataOffset:f,xmpChunks:p,iccChunks:h,mpfDataOffset:m,pngHeaderOffset:g,pngTextChunks:y,pngChunkOffsets:_,vp8xChunkOffset:v,gifHeaderOffset:b}=gy.parseAppMarkers(e,n);if(function(e){return void 0!==e}(c)){a=!0;const n=o_.read(e,c);t?o.file=n:o=gm({},o,n)}if(function(e){return void 0!==e}(l)){a=!0;const n=p_.read(e,l);t?o.jfif=n:o=gm({},o,n)}if(function(e){return void 0!==e}(d)){a=!0;const{tags:n,byteOrder:s}=qy.read(e,d,r);if(n.Thumbnail&&(o.Thumbnail=n.Thumbnail,delete n.Thumbnail),t?(o.exif=n,function(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=Tm(e.exif.GPSLatitude.value),"S"===e.exif.GPSLatitudeRef.value.join("")&&(e.gps.Latitude=-e.gps.Latitude)}catch(e){}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=Tm(e.exif.GPSLongitude.value),"W"===e.exif.GPSLongitudeRef.value.join("")&&(e.gps.Longitude=-e.gps.Longitude)}catch(e){}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],1===e.exif.GPSAltitudeRef.value&&(e.gps.Altitude=-e.gps.Altitude)}catch(e){}}}(o)):o=gm({},o,n),n["IPTC-NAA"]&&!Qb(f)){const e=w_.read(n["IPTC-NAA"].value,0,r);t?o.iptc=e:o=gm({},o,e)}if(n.ApplicationNotes&&!eE(p)){const e=j_.read(mm(n.ApplicationNotes.value),void 0,i);t?o.xmp=e:(delete e._raw,o=gm({},o,e))}if(n.ImageSourceData){const e=Mv.read(n.PhotoshopSettings.value,r);t?o.photoshop=e:o=gm({},o,e)}if(n.ICC_Profile&&!tE(h)){const e=Rv.read(n.ICC_Profile.value,[{offset:0,length:n.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);t?o.icc=e:o=gm({},o,e)}if(function(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&"Canon"===e.Make.value[0]&&e.MakerNote&&e.MakerNote.__offset}(n)){const i=Kv.read(e,d,n.MakerNote.__offset,s,r);t?o.makerNotes=i:o=gm({},o,i)}n.MakerNote&&delete n.MakerNote.__offset}if(Qb(f)){a=!0;const n=w_.read(e,f,r);t?o.iptc=n:o=gm({},o,n)}if(eE(p)){a=!0;const n=j_.read(e,p,i);t?o.xmp=n:(delete n._raw,o=gm({},o,n))}if(tE(h)){a=!0;const t=Rv.read(e,h,n);t instanceof Promise?s.push(t.then(S)):S(t)}if(function(e){return void 0!==e}(m)){a=!0;const n=Qy.read(e,m,r);t?o.mpf=n:o=gm({},o,n)}if(void 0!==g){a=!0;const n=Xv.read(e,g);t?(o.png=o.png?gm({},o.png,n):n,o.pngFile=n):o=gm({},o,n)}if(function(e){return void 0!==e}(y)){a=!0;const{readTags:t,readTagsPromise:i}=ob.read(e,y,n,r);A(t),i&&s.push(i.then((e=>e.forEach(A))))}if(function(e){return void 0!==e}(_)){a=!0;const n=xb.read(e,_);t?o.png=o.png?gm({},o.png,n):n:o=gm({},o,n)}if(function(e){return void 0!==e}(v)){a=!0;const n=Db.read(e,v);t?o.riff=o.riff?gm({},o.riff,n):n:o=gm({},o,n)}if(function(e){return void 0!==e}(b)){a=!0;const n=Fb.read(e,b);t?o.gif=o.gif?gm({},o.gif,n):n:o=gm({},o,n)}const E=Hb.get(e,o.Thumbnail,d);if(E?(a=!0,o.Thumbnail=E):delete o.Thumbnail,u&&(t?(o.file||(o.file={}),o.file.FileType=u):o.FileType=u,a=!0),!a)throw new qb.MetadataMissingError;return n?Promise.all(s).then((()=>o)):o;function S(e){t?o.icc=e:o=gm({},o,e)}function A(e){if(t){for(const t of["exif","iptc"]){const n=`__${t}`;e[n]&&(o[t]=o[t]?gm({},o.exif,e[n]):e[n],delete e[n])}o.png=o.png?gm({},o.png,e):e,o.pngText=o.pngText?gm({},o.png,e):e}else o=gm({},o,e.__exif?e.__exif:{},e.__iptc?e.__iptc:{},e),delete o.__exif,delete o.__iptc}}function Qb(e){return void 0!==e}function eE(e){return Array.isArray(e)&&e.length>0}function tE(e){return Array.isArray(e)&&e.length>0}exports.ImageHelper=void 0,(Yb=exports.ImageHelper||(exports.ImageHelper={})).convertBlob=async(e,t="image/jpeg")=>{const n=(await exports.FileHelper.getType(e)).mime;if("image/heic"===n||"image/heif"===n){const{heicTo:n}=await Promise.resolve().then((function(){return require("./heic-to.cfb16ea4.js")}));e=await n({blob:e,type:t})}const r=await Yb.blobToImage(e),i=document.createElement("canvas");return i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(r,0,0),i.toDataURL(t)},Yb.dataUrlToImage=async e=>new Promise(((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error("dataURLtoImage(): dataURL is illegal")),r.src=e})),Yb.blobToImage=async e=>{const t=URL.createObjectURL(e);return new Promise(((e,n)=>{const r=new Image;r.onload=()=>{URL.revokeObjectURL(t),e(r)},r.onerror=()=>n(new Error("blobToImage(): blob is illegal")),r.src=t}))},Yb.resampleImage=async(e,t)=>{const{crop:n,scale:r,width:i,height:a,quality:o=1,type:s="image/jpeg"}=t,u=document.createElement("canvas"),c=u.getContext("2d");if(r)u.width=e.width*r,u.height=e.height*r,c.drawImage(e,0,0,u.width,u.height);else if(i&&a){u.width=i,u.height=a;let t=e.height/a*i,r=e.height,o=(e.width-t)/2,s=0;(n&&e.height>e.width||!n&&e.height<e.width)&&(t=e.width,r=e.width/i*a,o=0,s=(e.height-r)/2),c.drawImage(e,o,s,t,r,0,0,i,a)}return new Promise((e=>u.toBlob((t=>e(t)),s,o)))},Yb.compressImage=async(e,t)=>{const{quality:n=1,fileSize:r,attempts:i=0,maxAttempts:a}=t,o=await Yb.blobToImage(e);if(e.size<=1024*r||n<0)return e;const s=await Yb.resampleImage(o,{scale:1,quality:n});return s.size>1024*r&&(i<a||!a)?Yb.compressImage(e,{...t,quality:n-.1,attempts:i+1}):s},Yb.getMetadata=async e=>{try{const t=await Kb.load(e),n=t.DateTimeOriginal?.description,r=Number(t.GPSLongitude?.description),i=Number(t.GPSLatitude?.description),a=isNaN(r)?void 0:Number(r);return{dateTimeOriginal:n,lat:isNaN(i)?void 0:Number(i),lng:a}}catch{}},function(e){e.degreesToRadians=e=>Math.PI*e/180,e.radiansToDegrees=e=>180*e/Math.PI,e.nauticalMilesToMetres=e=>1852*e}(Wb||(Wb={}));var nE=xi,rE=qa,iE=Vr,aE=Hr,oE=Mi,sE=Gr.exports,uE=_i,cE=ui,lE=Object.prototype.hasOwnProperty;var dE=function(e){if(null==e)return!0;if(oE(e)&&(aE(e)||"string"==typeof e||"function"==typeof e.splice||sE(e)||cE(e)||iE(e)))return!e.length;var t=rE(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(uE(e))return!nE(e).length;for(var n in e)if(lE.call(e,n))return!1;return!0};var fE,pE,hE=function(e){return null==e};!function(e){e.upsert=(e,t,n)=>{const r={...e};return r[t]=t in r?{...r[t],...n}:n,r},e.getNestedValueByKey=(t,n,r={})=>{const{skipRoot:i,searchIn:a}=r;if(!i&&n in t)return{[n]:t[n]};for(const[i,o]of Object.entries(t))if(o&&"object"==typeof o&&!Array.isArray(o)&&(!a||a.includes(i))){const t=e.getNestedValueByKey(o,n,{...r,skipRoot:!1});if(!dE(t))return t}},e.removeNil=t=>{if(null!==t){if(Array.isArray(t)){const n=t.map((t=>e.removeNil(t))).filter((e=>e));return n.length?n:void 0}if("object"==typeof t){const n={...t};return Object.entries(n).forEach((([t,r])=>{const i=e.removeNil(r);hE(i)?delete n[t]:n[t]=i})),dE(n)?void 0:n}return t}}}(fE||(fE={})),exports.TestHelper=void 0,(pE=exports.TestHelper||(exports.TestHelper={})).generateId=(e,t,n)=>{let r=e;return t&&(r+=`__${t}`),n&&(r+=`--${n}`),r},pE.getError=e=>{try{return e()}catch(e){return e}};const mE=t.createContext({formValidationConfig:null,setFormValidationConfig:()=>null,warnings:null,setWarnings:()=>null,yupId:null}),gE=({children:n})=>{const[r,i]=t.useState(),[a,o]=t.useState(),[s]=t.useState(um()),u=t.useMemo((()=>({formValidationConfig:r,setFormValidationConfig:i,warnings:a,setWarnings:o,yupId:s})),[r,a,s]);return e.jsx(mE.Provider,{value:u,children:n})};var yE,_E;try{yE=Map}catch(Pf){}try{_E=Set}catch(Pf){}function vE(e,t,n){if(!e||"object"!=typeof e||"function"==typeof e)return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(bE);if(yE&&e instanceof yE)return new Map(Array.from(e.entries()));if(_E&&e instanceof _E)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);for(var i in n.push(r),e){var a=t.findIndex((function(t){return t===e[i]}));r[i]=a>-1?n[a]:vE(e[i],t,n)}return r}return e}function bE(e){return vE(e,[],[])}const EE=Object.prototype.toString,SE=Error.prototype.toString,AE=RegExp.prototype.toString,xE="undefined"!=typeof Symbol?Symbol.prototype.toString:()=>"",wE=/^Symbol\((.*)\)(.*)$/;function TE(e,t=!1){if(null==e||!0===e||!1===e)return""+e;const n=typeof e;if("number"===n)return function(e){return e!=+e?"NaN":0===e&&1/e<0?"-0":""+e}(e);if("string"===n)return t?`"${e}"`:e;if("function"===n)return"[Function "+(e.name||"anonymous")+"]";if("symbol"===n)return xE.call(e).replace(wE,"Symbol($1)");const r=EE.call(e).slice(8,-1);return"Date"===r?isNaN(e.getTime())?""+e:e.toISOString(e):"Error"===r||e instanceof Error?"["+SE.call(e)+"]":"RegExp"===r?AE.call(e):null}function ME(e,t){let n=TE(e,t);return null!==n?n:JSON.stringify(e,(function(e,n){let r=TE(this[e],t);return null!==r?r:n}),2)}let OE={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=null!=r&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${ME(n,!0)}\``+(i?` (cast from the value \`${ME(r,!0)}\`).`:".");return null===n&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},CE={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},NE={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},DE={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},LE={isValue:"${path} field must be ${value}"},IE={noUnknown:"${path} field has unspecified keys: ${unknown}"},kE={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};var $E=Object.assign(Object.create(null),{mixed:OE,string:CE,number:NE,date:DE,object:IE,array:kE,boolean:LE}),RE=Object.prototype.hasOwnProperty;var FE=function(e,t){return null!=e&&RE.call(e,t)},zE=Hr,PE=Xp,jE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ZE=/^\w*$/;var UE=function(e,t){if(zE(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!PE(e))||(ZE.test(e)||!jE.test(e)||null!=t&&e in Object(t))},BE=dr;function VE(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(VE.Cache||BE),n}VE.Cache=BE;var HE=VE;var GE=function(e){var t=HE(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t},YE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,WE=/\\(\\)?/g,qE=GE((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(YE,(function(e,n,r,i){t.push(r?i.replace(WE,"$1"):n||e)})),t})),KE=Hr,JE=UE,XE=qE,QE=oh;var eS=function(e,t){return KE(e)?e:JE(e,t)?[e]:XE(QE(e))},tS=Xp;var nS=function(e){if("string"==typeof e||tS(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t},rS=eS,iS=Vr,aS=Hr,oS=qr,sS=Kr,uS=nS;var cS=function(e,t,n){for(var r=-1,i=(t=rS(t,e)).length,a=!1;++r<i;){var o=uS(t[r]);if(!(a=null!=e&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=null==e?0:e.length)&&sS(i)&&oS(o,i)&&(aS(e)||iS(e))},lS=FE,dS=cS;var fS=function(e,t){return null!=e&&dS(e,t,lS)};const pS=e=>e&&e.__isYupSchema__;class hS{constructor(e,t){if(this.fn=void 0,this.refs=e,this.refs=e,"function"==typeof t)return void(this.fn=t);if(!fS(t,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:n,then:r,otherwise:i}=t,a="function"==typeof n?n:(...e)=>e.every((e=>e===n));this.fn=function(...e){let t=e.pop(),n=e.pop(),o=a(...e)?r:i;if(o)return"function"==typeof o?o(n):n.concat(o.resolve(t))}}resolve(e,t){let n=this.refs.map((e=>e.getValue(null==t?void 0:t.value,null==t?void 0:t.parent,null==t?void 0:t.context))),r=this.fn.apply(e,n.concat(e,t));if(void 0===r||r===e)return e;if(!pS(r))throw new TypeError("conditions must return a schema object");return r.resolve(t)}}function mS(e){return null==e?[]:[].concat(e)}function gS(){return gS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gS.apply(this,arguments)}let yS=/\$\{\s*(\w+)\s*\}/g;class _S extends Error{static formatError(e,t){const n=t.label||t.path||"this";return n!==t.path&&(t=gS({},t,{path:n})),"string"==typeof e?e.replace(yS,((e,n)=>ME(t[n]))):"function"==typeof e?e(t):e}static isError(e){return e&&"ValidationError"===e.name}constructor(e,t,n,r){super(),this.value=void 0,this.path=void 0,this.type=void 0,this.errors=void 0,this.params=void 0,this.inner=void 0,this.name="ValidationError",this.value=t,this.path=n,this.type=r,this.errors=[],this.inner=[],mS(e).forEach((e=>{_S.isError(e)?(this.errors.push(...e.errors),this.inner=this.inner.concat(e.inner.length?e.inner:e)):this.errors.push(e)})),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,_S)}}function vS(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=(e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}})(t),l=r.length;const d=[];if(o=o||[],!l)return o.length?c(new _S(o,a,u)):c(null,a);for(let e=0;e<r.length;e++){(0,r[e])(i,(function(e){if(e){if(!_S.isError(e))return c(e,a);if(n)return e.value=a,c(e,a);d.push(e)}if(--l<=0){if(d.length&&(s&&d.sort(s),o.length&&d.push(...o),o=d),o.length)return void c(new _S(o,a,u),a);c(null,a)}}))}}var bS=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===n(a[u],u,a))break}return t}},ES=bS(),SS=ES,AS=Di;var xS=function(e,t){return e&&SS(e,t,AS)};var wS=dr,TS=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},MS=function(e){return this.__data__.has(e)};function OS(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new wS;++t<n;)this.add(e[t])}OS.prototype.add=OS.prototype.push=TS,OS.prototype.has=MS;var CS=OS;var NS=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var DS=function(e,t){return e.has(t)},LS=CS,IS=NS,kS=DS;var $S=function(e,t,n,r,i,a){var o=1&n,s=e.length,u=t.length;if(s!=u&&!(o&&u>s))return!1;var c=a.get(e),l=a.get(t);if(c&&l)return c==t&&l==e;var d=-1,f=!0,p=2&n?new LS:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var g=o?r(m,h,d,t,e,a):r(h,m,d,e,t,a);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!IS(t,(function(e,t){if(!kS(p,t)&&(h===e||i(h,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(h!==m&&!i(h,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f};var RS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};var FS=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},zS=Xa,PS=wt,jS=$S,ZS=RS,US=FS,BS=qt?qt.prototype:void 0,VS=BS?BS.valueOf:void 0;var HS=function(e,t,n,r,i,a,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new zS(e),new zS(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return PS(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=ZS;case"[object Set]":var u=1&r;if(s||(s=US),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;r|=2,o.set(e,t);var l=jS(s(e),s(t),r,i,a,o);return o.delete(e),l;case"[object Symbol]":if(VS)return VS.call(e)==VS.call(t)}return!1},GS=Aa,YS=Object.prototype.hasOwnProperty;var WS=function(e,t,n,r,i,a){var o=1&n,s=GS(e),u=s.length;if(u!=GS(t).length&&!o)return!1;for(var c=u;c--;){var l=s[c];if(!(o?l in t:YS.call(t,l)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var h=o;++c<u;){var m=e[l=s[c]],g=t[l];if(r)var y=o?r(g,m,l,t,e,a):r(m,g,l,e,t,a);if(!(void 0===y?m===g||i(m,g,n,r,a):y)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var _=e.constructor,v=t.constructor;_==v||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof v&&v instanceof v||(p=!1)}return a.delete(e),a.delete(t),p},qS=Sr,KS=$S,JS=HS,XS=WS,QS=qa,eA=Hr,tA=Gr.exports,nA=ui,rA="[object Arguments]",iA="[object Array]",aA="[object Object]",oA=Object.prototype.hasOwnProperty;var sA=function(e,t,n,r,i,a){var o=eA(e),s=eA(t),u=o?iA:QS(e),c=s?iA:QS(t),l=(u=u==rA?aA:u)==aA,d=(c=c==rA?aA:c)==aA,f=u==c;if(f&&tA(e)){if(!tA(t))return!1;o=!0,l=!1}if(f&&!l)return a||(a=new qS),o||nA(e)?KS(e,t,n,r,i,a):JS(e,t,u,n,r,i,a);if(!(1&n)){var p=l&&oA.call(e,"__wrapped__"),h=d&&oA.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,g=h?t.value():t;return a||(a=new qS),i(m,g,n,r,a)}}return!!f&&(a||(a=new qS),XS(e,t,n,r,i,a))},uA=sA,cA=Rr;var lA=function e(t,n,r,i,a){return t===n||(null==t||null==n||!cA(t)&&!cA(n)?t!=t&&n!=n:uA(t,n,r,i,e,a))},dA=Sr,fA=lA;var pA=function(e,t,n,r){var i=n.length,a=i,o=!r;if(null==e)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var u=(s=n[i])[0],c=e[u],l=s[1];if(o&&s[2]){if(void 0===c&&!(u in e))return!1}else{var d=new dA;if(r)var f=r(c,l,u,e,t,d);if(!(void 0===f?fA(l,c,3,r,d):f))return!1}}return!0},hA=un;var mA=function(e){return e==e&&!hA(e)},gA=mA,yA=Di;var _A=function(e){for(var t=yA(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,gA(i)]}return t};var vA=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},bA=pA,EA=_A,SA=vA;var AA=function(e){var t=EA(e);return 1==t.length&&t[0][2]?SA(t[0][0],t[0][1]):function(n){return n===e||bA(n,e,t)}},xA=eS,wA=nS;var TA=function(e,t){for(var n=0,r=(t=xA(t,e)).length;null!=e&&n<r;)e=e[wA(t[n++])];return n&&n==r?e:void 0},MA=TA;var OA=function(e,t,n){var r=null==e?void 0:MA(e,t);return void 0===r?n:r};var CA=function(e,t){return null!=e&&t in Object(e)},NA=CA,DA=cS;var LA=function(e,t){return null!=e&&DA(e,t,NA)},IA=lA,kA=OA,$A=LA,RA=UE,FA=mA,zA=vA,PA=nS;var jA=function(e,t){return RA(e)&&FA(t)?zA(PA(e),t):function(n){var r=kA(n,e);return void 0===r&&r===t?$A(n,e):IA(t,r,3)}};var ZA=function(e){return e};var UA=function(e){return function(t){return null==t?void 0:t[e]}},BA=TA;var VA=function(e){return function(t){return BA(t,e)}},HA=UA,GA=VA,YA=UE,WA=nS;var qA=AA,KA=jA,JA=ZA,XA=Hr,QA=function(e){return YA(e)?HA(WA(e)):GA(e)};var ex=function(e){return"function"==typeof e?e:null==e?JA:"object"==typeof e?XA(e)?KA(e[0],e[1]):qA(e):QA(e)},tx=Mr,nx=xS,rx=ex;var ix=function(e,t){var n={};return t=rx(t),nx(e,(function(e,r,i){tx(n,r,t(e,r,i))})),n};function ax(e){this._maxSize=e,this.clear()}ax.prototype.clear=function(){this._size=0,this._values=Object.create(null)},ax.prototype.get=function(e){return this._values[e]},ax.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var ox=/[^.^\]^[]+|(?=\[\]|\.\.)/g,sx=/^\d+$/,ux=/^\d/,cx=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,lx=/^\s*(['"]?)(.*?)(\1)\s*$/,dx=new ax(512),fx=new ax(512),px=new ax(512),hx={Cache:ax,split:gx,normalizePath:mx,setter:function(e){var t=mx(e);return fx.get(e)||fx.set(e,(function(e,n){for(var r=0,i=t.length,a=e;r<i-1;){var o=t[r];if("__proto__"===o||"constructor"===o||"prototype"===o)return e;a=a[t[r++]]}a[t[r]]=n}))},getter:function(e,t){var n=mx(e);return px.get(e)||px.set(e,(function(e){for(var r=0,i=n.length;r<i;){if(null==e&&t)return;e=e[n[r++]]}return e}))},join:function(e){return e.reduce((function(e,t){return e+(yx(t)||sx.test(t)?"["+t+"]":(e?".":"")+t)}),"")},forEach:function(e,t,n){!function(e,t,n){var r,i,a,o,s=e.length;for(i=0;i<s;i++)(r=e[i])&&(_x(r)&&(r='"'+r+'"'),a=!(o=yx(r))&&/^\d+$/.test(r),t.call(n,r,o,a,i,e))}(Array.isArray(e)?e:gx(e),t,n)}};function mx(e){return dx.get(e)||dx.set(e,gx(e).map((function(e){return e.replace(lx,"$2")})))}function gx(e){return e.match(ox)||[""]}function yx(e){return"string"==typeof e&&e&&-1!==["'",'"'].indexOf(e.charAt(0))}function _x(e){return!yx(e)&&(function(e){return e.match(ux)&&!e.match(sx)}(e)||function(e){return cx.test(e)}(e))}const vx="$",bx=".";class Ex{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,"string"!=typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===vx,this.isValue=this.key[0]===bx,this.isSibling=!this.isContext&&!this.isValue;let n=this.isContext?vx:this.isValue?bx:"";this.path=this.key.slice(n.length),this.getter=this.path&&hx.getter(this.path,!0),this.map=t.map}getValue(e,t,n){let r=this.isContext?n:this.isValue?e:t;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}cast(e,t){return this.getValue(e,null==t?void 0:t.parent,null==t?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}function Sx(){return Sx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sx.apply(this,arguments)}function Ax(e){function t(t,n){let{value:r,path:i="",label:a,options:o,originalValue:s,sync:u}=t,c=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,["value","path","label","options","originalValue","sync"]);const{name:l,test:d,params:f,message:p}=e;let{parent:h,context:m}=o;function g(e){return Ex.isRef(e)?e.getValue(r,h,m):e}function y(e={}){const t=ix(Sx({value:r,originalValue:s,label:a,path:e.path||i},f,e.params),g),n=new _S(_S.formatError(e.message||p,t),r,t.path,e.type||l);return n.params=t,n}let _,v=Sx({path:i,parent:h,type:l,createError:y,resolve:g,options:o,originalValue:s},c);if(u){try{var b;if(_=d.call(v,r,v),"function"==typeof(null==(b=_)?void 0:b.then))throw new Error(`Validation test of type: "${v.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(e){return void n(e)}_S.isError(_)?n(_):_?n(null,_):n(y())}else try{Promise.resolve(d.call(v,r,v)).then((e=>{_S.isError(e)?n(e):e?n(null,e):n(y())})).catch(n)}catch(e){n(e)}}return t.OPTIONS=e,t}Ex.prototype.__isYupRef=!0;function xx(e,t,n,r=n){let i,a,o;return t?(hx.forEach(t,((s,u,c)=>{let l=u?(e=>e.substr(0,e.length-1).substr(1))(s):s;if((e=e.resolve({context:r,parent:i,value:n})).innerType){let r=c?parseInt(l,10):0;if(n&&r>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[r],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s})),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class wx{constructor(){this.list=void 0,this.refs=void 0,this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const e=[];for(const t of this.list)e.push(t);for(const[,t]of this.refs)e.push(t.describe());return e}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}resolveAll(e){return this.toArray().reduce(((t,n)=>t.concat(Ex.isRef(n)?e(n):n)),[])}add(e){Ex.isRef(e)?this.refs.set(e.key,e):this.list.add(e)}delete(e){Ex.isRef(e)?this.refs.delete(e.key):this.list.delete(e)}clone(){const e=new wx;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}merge(e,t){const n=this.clone();return e.list.forEach((e=>n.add(e))),e.refs.forEach((e=>n.add(e))),t.list.forEach((e=>n.delete(e))),t.refs.forEach((e=>n.delete(e))),n}}function Tx(){return Tx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tx.apply(this,arguments)}class Mx{constructor(e){this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this._typeError=void 0,this._whitelist=new wx,this._blacklist=new wx,this.exclusiveTests=Object.create(null),this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation((()=>{this.typeError(OE.notType)})),this.type=(null==e?void 0:e.type)||"mixed",this.spec=Tx({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},null==e?void 0:e.spec)}get _type(){return this.type}_typeCheck(e){return!0}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeError=this._typeError,t._whitelistError=this._whitelistError,t._blacklistError=this._blacklistError,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.exclusiveTests=Tx({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=bE(Tx({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(0===e.length)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let n=e(this);return this._mutate=t,n}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&"mixed"!==this.type)throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,n=e.clone();const r=Tx({},t.spec,n.spec);return n.spec=r,n._typeError||(n._typeError=t._typeError),n._whitelistError||(n._whitelistError=t._whitelistError),n._blacklistError||(n._blacklistError=t._blacklistError),n._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),n._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),n.tests=t.tests,n.exclusiveTests=t.exclusiveTests,n.withMutation((t=>{e.tests.forEach((e=>{t.test(e.OPTIONS)}))})),n.transforms=[...t.transforms,...n.transforms],n}isType(e){return!(!this.spec.nullable||null!==e)||this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let n=t.conditions;t=t.clone(),t.conditions=[],t=n.reduce(((t,n)=>n.resolve(t,e)),t),t=t.resolve(e)}return t}cast(e,t={}){let n=this.resolve(Tx({value:e},t)),r=n._cast(e,t);if(void 0!==e&&!1!==t.assert&&!0!==n.isType(r)){let i=ME(e),a=ME(r);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${n._type}". \n\nattempted value: ${i} \n`+(a!==i?`result of cast: ${a}`:""))}return r}_cast(e,t){let n=void 0===e?e:this.transforms.reduce(((t,n)=>n.call(this,t,e,this)),e);return void 0===n&&(n=this.getDefault()),n}_validate(e,t={},n){let{sync:r,path:i,from:a=[],originalValue:o=e,strict:s=this.spec.strict,abortEarly:u=this.spec.abortEarly}=t,c=e;s||(c=this._cast(c,Tx({assert:!1},t)));let l={value:c,path:i,options:t,originalValue:o,schema:this,label:this.spec.label,sync:r,from:a},d=[];this._typeError&&d.push(this._typeError);let f=[];this._whitelistError&&f.push(this._whitelistError),this._blacklistError&&f.push(this._blacklistError),vS({args:l,value:c,path:i,sync:r,tests:d,endEarly:u},(e=>{e?n(e,c):vS({tests:this.tests.concat(f),args:l,path:i,sync:r,value:c,endEarly:u},n)}))}validate(e,t,n){let r=this.resolve(Tx({},t,{value:e}));return"function"==typeof n?r._validate(e,t,n):new Promise(((n,i)=>r._validate(e,t,((e,t)=>{e?i(e):n(t)}))))}validateSync(e,t){let n;return this.resolve(Tx({},t,{value:e}))._validate(e,Tx({},t,{sync:!0}),((e,t)=>{if(e)throw e;n=t})),n}isValid(e,t){return this.validate(e,t).then((()=>!0),(e=>{if(_S.isError(e))return!1;throw e}))}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(e){if(_S.isError(e))return!1;throw e}}_getDefault(){let e=this.spec.default;return null==e?e:"function"==typeof e?e.call(this):bE(e)}getDefault(e){return this.resolve(e||{})._getDefault()}default(e){if(0===arguments.length)return this._getDefault();return this.clone({default:e})}strict(e=!0){let t=this.clone();return t.spec.strict=e,t}_isPresent(e){return null!=e}defined(e=OE.defined){return this.test({message:e,name:"defined",exclusive:!0,test:e=>void 0!==e})}required(e=OE.required){return this.clone({presence:"required"}).withMutation((t=>t.test({message:e,name:"required",exclusive:!0,test(e){return this.schema._isPresent(e)}})))}notRequired(){let e=this.clone({presence:"optional"});return e.tests=e.tests.filter((e=>"required"!==e.OPTIONS.name)),e}nullable(e=!0){return this.clone({nullable:!1!==e})}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(t=1===e.length?"function"==typeof e[0]?{test:e[0]}:e[0]:2===e.length?{name:e[0],test:e[1]}:{name:e[0],message:e[1],test:e[2]},void 0===t.message&&(t.message=OE.default),"function"!=typeof t.test)throw new TypeError("`test` is a required parameters");let n=this.clone(),r=Ax(t),i=t.exclusive||t.name&&!0===n.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(n.exclusiveTests[t.name]=!!t.exclusive),n.tests=n.tests.filter((e=>{if(e.OPTIONS.name===t.name){if(i)return!1;if(e.OPTIONS.test===r.OPTIONS.test)return!1}return!0})),n.tests.push(r),n}when(e,t){Array.isArray(e)||"string"==typeof e||(t=e,e=".");let n=this.clone(),r=mS(e).map((e=>new Ex(e)));return r.forEach((e=>{e.isSibling&&n.deps.push(e.key)})),n.conditions.push(new hS(r,t)),n}typeError(e){let t=this.clone();return t._typeError=Ax({message:e,name:"typeError",test(e){return!(void 0!==e&&!this.schema.isType(e))||this.createError({params:{type:this.schema._type}})}}),t}oneOf(e,t=OE.oneOf){let n=this.clone();return e.forEach((e=>{n._whitelist.add(e),n._blacklist.delete(e)})),n._whitelistError=Ax({message:t,name:"oneOf",test(e){if(void 0===e)return!0;let t=this.schema._whitelist,n=t.resolveAll(this.resolve);return!!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}notOneOf(e,t=OE.notOneOf){let n=this.clone();return e.forEach((e=>{n._blacklist.add(e),n._whitelist.delete(e)})),n._blacklistError=Ax({message:t,name:"notOneOf",test(e){let t=this.schema._blacklist,n=t.resolveAll(this.resolve);return!n.includes(e)||this.createError({params:{values:t.toArray().join(", "),resolved:n}})}}),n}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(){const e=this.clone(),{label:t,meta:n}=e.spec,r={meta:n,label:t,type:e.type,oneOf:e._whitelist.describe(),notOneOf:e._blacklist.describe(),tests:e.tests.map((e=>({name:e.OPTIONS.name,params:e.OPTIONS.params}))).filter(((e,t,n)=>n.findIndex((t=>t.name===e.name))===t))};return r}}Mx.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Mx.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=xx(this,t,n,r.context);return o[e](i&&i[a],Tx({},r,{parent:i,path:t}))};for(const e of["equals","is"])Mx.prototype[e]=Mx.prototype.oneOf;for(const e of["not","nope"])Mx.prototype[e]=Mx.prototype.notOneOf;Mx.prototype.optional=Mx.prototype.notRequired;const Ox=Mx;function Cx(){return new Ox}Cx.prototype=Ox.prototype;const Nx=e=>null==e;function Dx(){return new Lx}class Lx extends Mx{constructor(){super({type:"boolean"}),this.withMutation((()=>{this.transform((function(e){if(!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e}))}))}_typeCheck(e){return e instanceof Boolean&&(e=e.valueOf()),"boolean"==typeof e}isTrue(e=LE.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test:e=>Nx(e)||!0===e})}isFalse(e=LE.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test:e=>Nx(e)||!1===e})}}Dx.prototype=Lx.prototype;let Ix=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,kx=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,$x=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Rx=e=>Nx(e)||e===e.trim(),Fx={}.toString();function zx(){return new Px}class Px extends Mx{constructor(){super({type:"string"}),this.withMutation((()=>{this.transform((function(e){if(this.isType(e))return e;if(Array.isArray(e))return e;const t=null!=e&&e.toString?e.toString():e;return t===Fx?e:t}))}))}_typeCheck(e){return e instanceof String&&(e=e.valueOf()),"string"==typeof e}_isPresent(e){return super._isPresent(e)&&!!e.length}length(e,t=CE.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return Nx(t)||t.length===this.resolve(e)}})}min(e,t=CE.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return Nx(t)||t.length>=this.resolve(e)}})}max(e,t=CE.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},test(t){return Nx(t)||t.length<=this.resolve(e)}})}matches(e,t){let n,r,i=!1;return t&&("object"==typeof t?({excludeEmptyString:i=!1,message:n,name:r}=t):n=t),this.test({name:r||"matches",message:n||CE.matches,params:{regex:e},test:t=>Nx(t)||""===t&&i||-1!==t.search(e)})}email(e=CE.email){return this.matches(Ix,{name:"email",message:e,excludeEmptyString:!0})}url(e=CE.url){return this.matches(kx,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=CE.uuid){return this.matches($x,{name:"uuid",message:e,excludeEmptyString:!1})}ensure(){return this.default("").transform((e=>null===e?"":e))}trim(e=CE.trim){return this.transform((e=>null!=e?e.trim():e)).test({message:e,name:"trim",test:Rx})}lowercase(e=CE.lowercase){return this.transform((e=>Nx(e)?e:e.toLowerCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>Nx(e)||e===e.toLowerCase()})}uppercase(e=CE.uppercase){return this.transform((e=>Nx(e)?e:e.toUpperCase())).test({message:e,name:"string_case",exclusive:!0,test:e=>Nx(e)||e===e.toUpperCase()})}}zx.prototype=Px.prototype;function jx(){return new Zx}class Zx extends Mx{constructor(){super({type:"number"}),this.withMutation((()=>{this.transform((function(e){let t=e;if("string"==typeof t){if(t=t.replace(/\s/g,""),""===t)return NaN;t=+t}return this.isType(t)?t:parseFloat(t)}))}))}_typeCheck(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&!(e=>e!=+e)(e)}min(e,t=NE.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return Nx(t)||t>=this.resolve(e)}})}max(e,t=NE.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return Nx(t)||t<=this.resolve(e)}})}lessThan(e,t=NE.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},test(t){return Nx(t)||t<this.resolve(e)}})}moreThan(e,t=NE.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},test(t){return Nx(t)||t>this.resolve(e)}})}positive(e=NE.positive){return this.moreThan(0,e)}negative(e=NE.negative){return this.lessThan(0,e)}integer(e=NE.integer){return this.test({name:"integer",message:e,test:e=>Nx(e)||Number.isInteger(e)})}truncate(){return this.transform((e=>Nx(e)?e:0|e))}round(e){var t;let n=["ceil","floor","round","trunc"];if("trunc"===(e=(null==(t=e)?void 0:t.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(e.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform((t=>Nx(t)?t:Math[e](t)))}}jx.prototype=Zx.prototype;var Ux=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;let Bx=new Date("");function Vx(){return new Hx}class Hx extends Mx{constructor(){super({type:"date"}),this.withMutation((()=>{this.transform((function(e){return this.isType(e)?e:(e=function(e){var t,n,r=[1,4,5,6,7,10,11],i=0;if(n=Ux.exec(e)){for(var a,o=0;a=r[o];++o)n[a]=+n[a]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,void 0!==n[8]&&""!==n[8]||void 0!==n[9]&&""!==n[9]?("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),t=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7])):t=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7])}else t=Date.parse?Date.parse(e):NaN;return t}(e),isNaN(e)?Bx:new Date(e))}))}))}_typeCheck(e){return t=e,"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(e.getTime());var t}prepareParam(e,t){let n;if(Ex.isRef(e))n=e;else{let r=this.cast(e);if(!this._typeCheck(r))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);n=r}return n}min(e,t=DE.min){let n=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(e){return Nx(e)||e>=this.resolve(n)}})}max(e,t=DE.max){let n=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(e){return Nx(e)||e<=this.resolve(n)}})}}Hx.INVALID_DATE=Bx,Vx.prototype=Hx.prototype,Vx.INVALID_DATE=Bx;var Gx=function(e,t,n,r){var i=-1,a=null==e?0:e.length;for(r&&a&&(n=e[++i]);++i<a;)n=t(n,e[i],i,e);return n};var Yx=function(e){return function(t){return null==e?void 0:e[t]}},Wx=Yx({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),qx=oh,Kx=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Jx=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g");var Xx=function(e){return(e=qx(e))&&e.replace(Kx,Wx).replace(Jx,"")},Qx=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var ew=function(e){return e.match(Qx)||[]},tw=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var nw=function(e){return tw.test(e)},rw="\\ud800-\\udfff",iw="\\u2700-\\u27bf",aw="a-z\\xdf-\\xf6\\xf8-\\xff",ow="A-Z\\xc0-\\xd6\\xd8-\\xde",sw="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",uw="["+sw+"]",cw="\\d+",lw="["+iw+"]",dw="["+aw+"]",fw="[^"+rw+sw+cw+iw+aw+ow+"]",pw="(?:\\ud83c[\\udde6-\\uddff]){2}",hw="[\\ud800-\\udbff][\\udc00-\\udfff]",mw="["+ow+"]",gw="(?:"+dw+"|"+fw+")",yw="(?:"+mw+"|"+fw+")",_w="(?:['’](?:d|ll|m|re|s|t|ve))?",vw="(?:['’](?:D|LL|M|RE|S|T|VE))?",bw="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",Ew="[\\ufe0e\\ufe0f]?",Sw=Ew+bw+("(?:\\u200d(?:"+["[^"+rw+"]",pw,hw].join("|")+")"+Ew+bw+")*"),Aw="(?:"+[lw,pw,hw].join("|")+")"+Sw,xw=RegExp([mw+"?"+dw+"+"+_w+"(?="+[uw,mw,"$"].join("|")+")",yw+"+"+vw+"(?="+[uw,mw+gw,"$"].join("|")+")",mw+"?"+gw+"+"+_w,mw+"+"+vw,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cw,Aw].join("|"),"g");var ww=function(e){return e.match(xw)||[]},Tw=ew,Mw=nw,Ow=oh,Cw=ww;var Nw=function(e,t,n){return e=Ow(e),void 0===(t=n?void 0:t)?Mw(e)?Cw(e):Tw(e):e.match(t)||[]},Dw=Gx,Lw=Xx,Iw=Nw,kw=RegExp("['’]","g");var $w=function(e){return function(t){return Dw(Iw(Lw(t).replace(kw,"")),e,"")}},Rw=$w((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Fw=Rw,zw=zh,Pw=$w((function(e,t,n){return t=t.toLowerCase(),e+(n?zw(t):t)})),jw=Pw,Zw=Mr,Uw=xS,Bw=ex;var Vw=function(e,t){var n={};return t=Bw(t),Uw(e,(function(e,r,i){Zw(n,t(e,r,i),e)})),n},Hw={exports:{}};function Gw(e,t){var n=e.length,r=new Array(n),i={},a=n,o=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!s.has(e[0])||!s.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));a--;)i[a]||u(e[a],a,new Set);return r;function u(e,t,a){if(a.has(e)){var c;try{c=", node was:"+JSON.stringify(e)}catch(e){c=""}throw new Error("Cyclic dependency"+c)}if(!s.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var l=o.get(e)||new Set;if(t=(l=Array.from(l)).length){a.add(e);do{var d=l[--t];u(d,s.get(d),a)}while(t);a.delete(e)}r[--n]=e}}}function Yw(e,t){let n=1/0;return e.some(((e,r)=>{var i;if(-1!==(null==(i=t.path)?void 0:i.indexOf(e)))return n=r,!0})),n}function Ww(e){return(t,n)=>Yw(e,t)-Yw(e,n)}function qw(){return qw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qw.apply(this,arguments)}Hw.exports=function(e){return Gw(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(e),e)},Hw.exports.array=Gw;let Kw=e=>"[object Object]"===Object.prototype.toString.call(e);const Jw=Ww([]);class Xw extends Mx{constructor(e){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=Jw,this._nodes=[],this._excludedEdges=[],this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null})),e&&this.shape(e)}))}_typeCheck(e){return Kw(e)||"function"==typeof e}_cast(e,t={}){var n;let r=super._cast(e,t);if(void 0===r)return this.getDefault();if(!this._typeCheck(r))return r;let i=this.fields,a=null!=(n=t.stripUnknown)?n:this.spec.noUnknown,o=this._nodes.concat(Object.keys(r).filter((e=>-1===this._nodes.indexOf(e)))),s={},u=qw({},t,{parent:s,__validating:t.__validating||!1}),c=!1;for(const e of o){let n=i[e],o=fS(r,e);if(n){let i,a=r[e];u.path=(t.path?`${t.path}.`:"")+e,n=n.resolve({value:a,context:t.context,parent:s});let o="spec"in n?n.spec:void 0,l=null==o?void 0:o.strict;if(null==o?void 0:o.strip){c=c||e in r;continue}i=t.__validating&&l?r[e]:n.cast(r[e],u),void 0!==i&&(s[e]=i)}else o&&!a&&(s[e]=r[e]);s[e]!==r[e]&&(c=!0)}return c?s:r}_validate(e,t={},n){let r=[],{sync:i,from:a=[],originalValue:o=e,abortEarly:s=this.spec.abortEarly,recursive:u=this.spec.recursive}=t;a=[{schema:this,value:o},...a],t.__validating=!0,t.originalValue=o,t.from=a,super._validate(e,t,((e,c)=>{if(e){if(!_S.isError(e)||s)return void n(e,c);r.push(e)}if(!u||!Kw(c))return void n(r[0]||null,c);o=o||c;let l=this._nodes.map((e=>(n,r)=>{let i=-1===e.indexOf(".")?(t.path?`${t.path}.`:"")+e:`${t.path||""}["${e}"]`,s=this.fields[e];s&&"validate"in s?s.validate(c[e],qw({},t,{path:i,from:a,strict:!0,parent:c,originalValue:o[e]}),r):r(null)}));vS({sync:i,tests:l,value:c,errors:r,endEarly:s,sort:this._sortErrors,path:t.path},n)}))}clone(e){const t=super.clone(e);return t.fields=qw({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),n=t.fields;for(let[e,t]of Object.entries(this.fields)){const r=n[e];void 0===r?n[e]=t:r instanceof Mx&&t instanceof Mx&&(n[e]=t.concat(r))}return t.withMutation((()=>t.shape(n,this._excludedEdges)))}getDefaultFromShape(){let e={};return this._nodes.forEach((t=>{const n=this.fields[t];e[t]="default"in n?n.getDefault():void 0})),e}_getDefault(){return"default"in this.spec?super._getDefault():this._nodes.length?this.getDefaultFromShape():void 0}shape(e,t=[]){let n=this.clone(),r=Object.assign(n.fields,e);return n.fields=r,n._sortErrors=Ww(Object.keys(r)),t.length&&(Array.isArray(t[0])||(t=[t]),n._excludedEdges=[...n._excludedEdges,...t]),n._nodes=function(e,t=[]){let n=[],r=new Set,i=new Set(t.map((([e,t])=>`${e}-${t}`)));function a(e,t){let a=hx.split(e)[0];r.add(a),i.has(`${t}-${a}`)||n.push([t,a])}for(const t in e)if(fS(e,t)){let n=e[t];r.add(t),Ex.isRef(n)&&n.isSibling?a(n.path,t):pS(n)&&"deps"in n&&n.deps.forEach((e=>a(e,t)))}return Hw.exports.array(Array.from(r),n).reverse()}(r,n._excludedEdges),n}pick(e){const t={};for(const n of e)this.fields[n]&&(t[n]=this.fields[n]);return this.clone().withMutation((e=>(e.fields={},e.shape(t))))}omit(e){const t=this.clone(),n=t.fields;t.fields={};for(const t of e)delete n[t];return t.withMutation((()=>t.shape(n)))}from(e,t,n){let r=hx.getter(e,!0);return this.transform((i=>{if(null==i)return i;let a=i;return fS(i,e)&&(a=qw({},i),n||delete a[e],a[t]=r(i)),a}))}noUnknown(e=!0,t=IE.noUnknown){"string"==typeof e&&(t=e,e=!0);let n=this.test({name:"noUnknown",exclusive:!0,message:t,test(t){if(null==t)return!0;const n=function(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter((e=>-1===n.indexOf(e)))}(this.schema,t);return!e||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=e,n}unknown(e=!0,t=IE.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform((t=>t&&Vw(t,((t,n)=>e(n)))))}camelCase(){return this.transformKeys(jw)}snakeCase(){return this.transformKeys(Fw)}constantCase(){return this.transformKeys((e=>Fw(e).toUpperCase()))}describe(){let e=super.describe();return e.fields=ix(this.fields,(e=>e.describe())),e}}function Qw(e){return new Xw(e)}function eT(){return eT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},eT.apply(this,arguments)}function tT(e){return new nT(e)}Qw.prototype=Xw.prototype;class nT extends Mx{constructor(e){super({type:"array"}),this.innerType=void 0,this.innerType=e,this.withMutation((()=>{this.transform((function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e=null}return this.isType(e)?e:null}))}))}_typeCheck(e){return Array.isArray(e)}get _subType(){return this.innerType}_cast(e,t){const n=super._cast(e,t);if(!this._typeCheck(n)||!this.innerType)return n;let r=!1;const i=n.map(((e,n)=>{const i=this.innerType.cast(e,eT({},t,{path:`${t.path||""}[${n}]`}));return i!==e&&(r=!0),i}));return r?i:n}_validate(e,t={},n){var r,i;let a=[],o=t.sync,s=t.path,u=this.innerType,c=null!=(r=t.abortEarly)?r:this.spec.abortEarly,l=null!=(i=t.recursive)?i:this.spec.recursive,d=null!=t.originalValue?t.originalValue:e;super._validate(e,t,((e,r)=>{if(e){if(!_S.isError(e)||c)return void n(e,r);a.push(e)}if(!l||!u||!this._typeCheck(r))return void n(a[0]||null,r);d=d||r;let i=new Array(r.length);for(let e=0;e<r.length;e++){let n=r[e],a=`${t.path||""}[${e}]`,o=eT({},t,{path:a,strict:!0,parent:r,index:e,originalValue:d[e]});i[e]=(e,t)=>u.validate(n,o,t)}vS({sync:o,path:s,value:r,errors:a,endEarly:c,tests:i},n)}))}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!pS(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ME(e));return t.innerType=e,t}length(e,t=kE.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},test(t){return Nx(t)||t.length===this.resolve(e)}})}min(e,t){return t=t||kE.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},test(t){return Nx(t)||t.length>=this.resolve(e)}})}max(e,t){return t=t||kE.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},test(t){return Nx(t)||t.length<=this.resolve(e)}})}ensure(){return this.default((()=>[])).transform(((e,t)=>this._typeCheck(e)?e:null==t?[]:[].concat(t)))}compact(e){let t=e?(t,n,r)=>!e(t,n,r):e=>!!e;return this.transform((e=>null!=e?e.filter(t):e))}describe(){let e=super.describe();return this.innerType&&(e.innerType=this.innerType.describe()),e}nullable(e=!0){return super.nullable(e)}defined(){return super.defined()}required(e){return super.required(e)}}tT.prototype=nT.prototype;class rT{constructor(e){this.type="lazy",this.__isYupSchema__=!0,this.__inputType=void 0,this.__outputType=void 0,this._resolve=(e,t={})=>{let n=this.builder(e,t);if(!pS(n))throw new TypeError("lazy() functions must return a valid schema");return n.resolve(t)},this.builder=e}resolve(e){return this._resolve(e.value,e)}cast(e,t){return this._resolve(e,t).cast(e,t)}validate(e,t,n){return this._resolve(e,t).validate(e,t,n)}validateSync(e,t){return this._resolve(e,t).validateSync(e,t)}validateAt(e,t,n){return this._resolve(t,n).validateAt(e,t,n)}validateSyncAt(e,t,n){return this._resolve(t,n).validateSyncAt(e,t,n)}describe(){return null}isValid(e,t){return this._resolve(e,t).isValid(e,t)}isValidSync(e,t){return this._resolve(e,t).isValidSync(e,t)}}function iT(e,t,n){if(!e||!pS(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if("string"!=typeof t)throw new TypeError("A Method name must be provided");if("function"!=typeof n)throw new TypeError("Method function must be provided");e.prototype[t]=n}var aT=Object.freeze({__proto__:null,mixed:Cx,bool:Dx,boolean:Dx,string:zx,number:jx,date:Vx,object:Qw,array:tT,ref:function(e,t){return new Ex(e,t)},lazy:function(e){return new rT(e)},reach:(e,t,n,r)=>xx(e,t,n,r).schema,isSchema:pS,addMethod:iT,setLocale:function(e){Object.keys(e).forEach((t=>{Object.keys(e[t]).forEach((n=>{$E[t][n]=e[t][n]}))}))},ValidationError:_S,BaseSchema:Mx,MixedSchema:Ox,BooleanSchema:Lx,StringSchema:Px,NumberSchema:Zx,DateSchema:Hx,ObjectSchema:Xw,ArraySchema:nT});const oT=V.default.button`
|
|
180
180
|
background-color: ${n.Colour.bg};
|
|
181
181
|
border: ${n.Border["width-010"]} ${n.Border.solid} ${n.Colour.border};
|
|
182
182
|
border-radius: 1rem;
|
|
@@ -335,7 +335,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
335
335
|
}
|
|
336
336
|
`,jk={D1:"heading-xxl",D2:"heading-xl",D3:"heading-md",D4:"heading-sm",DBody:"heading-sm",H1:"heading-lg",H2:"heading-md",H3:"heading-sm",H4:"heading-xs",H5:"body-md",H6:"body-sm",Body:"body-baseline",BodySmall:"body-md",XSmall:"body-xs"},Zk={"TEXT-D1":{type:r.Typography.HeadingXXL,weight:"bold"},"TEXT-D2":{type:r.Typography.HeadingXL,weight:"bold"},"TEXT-D3":{type:r.Typography.HeadingMD,weight:"bold"},"TEXT-D4":{type:r.Typography.HeadingSM,weight:"bold"},"TEXT-DBODY":{type:r.Typography.HeadingSM,weight:"light"},"TEXT-H1":{type:r.Typography.HeadingLG,weight:"bold"},"TEXT-H2":{type:r.Typography.HeadingMD,weight:"bold"},"TEXT-H3":{type:r.Typography.HeadingSM,weight:"bold"},"TEXT-H4":{type:r.Typography.HeadingXS,weight:"bold"},"TEXT-H5":{type:r.Typography.BodyMD,weight:"bold"},"TEXT-H6":{type:r.Typography.BodySM,weight:"bold"},"TEXT-BODY":{type:r.Typography.BodyBL,weight:"regular"},"TEXT-BODYSMALL":{type:r.Typography.BodyMD,weight:"regular"},"TEXT-XSMALL":{type:r.Typography.BodyXS,weight:"regular"}},Uk={"HEADING-XXL":r.Typography.HeadingXXL,"HEADING-XL":r.Typography.HeadingXL,"HEADING-MD":r.Typography.HeadingMD,"HEADING-SM":r.Typography.HeadingSM,"HEADING-LG":r.Typography.HeadingLG,"HEADING-XS":r.Typography.HeadingXS,"BODY-MD":r.Typography.BodyMD,"BODY-SM":r.Typography.BodySM,"BODY-BL":r.Typography.BodyBL,"BODY-XS":r.Typography.BodyXS},Bk={300:"light",400:"regular",500:"medium",700:"bold",900:"bold"},Vk={"text-d1":"h1","text-d2":"h1","text-dbody":"h1","text-h1":"h1","text-h2":"h2","text-h3":"h3","text-h4":"h4","text-h5":"h5","text-h6":"h6","text-body":"p","text-bodysmall":"p","text-xsmall":"p"},Hk=V.default(a.Button.Small)`
|
|
337
337
|
padding: 0;
|
|
338
|
-
`;var Gk;exports.EElementType=void 0,(Gk=exports.EElementType||(exports.EElementType={})).ALERT="Alert",Gk["TEXT-D1"]="Text",Gk["TEXT-D2"]="Text",Gk["TEXT-DBODY"]="Text",Gk["TEXT-H1"]="Text",Gk["TEXT-H2"]="Text",Gk["TEXT-H3"]="Text",Gk["TEXT-H4"]="Text",Gk["TEXT-H5"]="Text",Gk["TEXT-H6"]="Text",Gk["TEXT-BODY"]="Text",Gk["TEXT-BODYSMALL"]="Text",Gk["TEXT-XSMALL"]="Text",Gk["HEADING-XXL"]="Text",Gk["HEADING-XL"]="Text",Gk["HEADING-MD"]="Text",Gk["HEADING-SM"]="Text",Gk["HEADING-LG"]="Text",Gk["HEADING-XS"]="Text",Gk["BODY-MD"]="Text",Gk["BODY-SM"]="Text",Gk["BODY-BL"]="Text",Gk["BODY-XS"]="Text",Gk.DIV="Wrapper",Gk.DIVIDER="Divider",Gk.SPAN="Wrapper",Gk.HEADER="Wrapper",Gk.FOOTER="Wrapper",Gk.H1="Wrapper",Gk.H2="Wrapper",Gk.H3="Wrapper",Gk.H4="Wrapper",Gk.H5="Wrapper",Gk.H6="Wrapper",Gk.P="Wrapper",Gk.GRID="Grid",Gk.TAB="Tab",Gk["TAB-ITEM"]="TabItem",Gk["LIST-ITEM"]="ListItem",Gk["ORDERED-LIST"]="List",Gk["UNORDERED-LIST"]="List",Gk.ACCORDION="Accordion",Gk.POPOVER="Popover";var Yk=Object.freeze({__proto__:null,Accordion:t=>{const{schema:n,id:r}=t,{children:i,button:o,title:s,disableContentInset:u,...c}=n,{dispatchFieldEvent:l}=gI();return e.jsx(d.BoxContainer,{id:r,title:"string"==typeof s?s:e.jsx(
|
|
338
|
+
`;var Gk;exports.EElementType=void 0,(Gk=exports.EElementType||(exports.EElementType={})).ALERT="Alert",Gk["TEXT-D1"]="Text",Gk["TEXT-D2"]="Text",Gk["TEXT-DBODY"]="Text",Gk["TEXT-H1"]="Text",Gk["TEXT-H2"]="Text",Gk["TEXT-H3"]="Text",Gk["TEXT-H4"]="Text",Gk["TEXT-H5"]="Text",Gk["TEXT-H6"]="Text",Gk["TEXT-BODY"]="Text",Gk["TEXT-BODYSMALL"]="Text",Gk["TEXT-XSMALL"]="Text",Gk["HEADING-XXL"]="Text",Gk["HEADING-XL"]="Text",Gk["HEADING-MD"]="Text",Gk["HEADING-SM"]="Text",Gk["HEADING-LG"]="Text",Gk["HEADING-XS"]="Text",Gk["BODY-MD"]="Text",Gk["BODY-SM"]="Text",Gk["BODY-BL"]="Text",Gk["BODY-XS"]="Text",Gk.DIV="Wrapper",Gk.DIVIDER="Divider",Gk.SPAN="Wrapper",Gk.HEADER="Wrapper",Gk.FOOTER="Wrapper",Gk.H1="Wrapper",Gk.H2="Wrapper",Gk.H3="Wrapper",Gk.H4="Wrapper",Gk.H5="Wrapper",Gk.H6="Wrapper",Gk.P="Wrapper",Gk.GRID="Grid",Gk.TAB="Tab",Gk["TAB-ITEM"]="TabItem",Gk["LIST-ITEM"]="ListItem",Gk["ORDERED-LIST"]="List",Gk["UNORDERED-LIST"]="List",Gk.ACCORDION="Accordion",Gk.POPOVER="Popover";var Yk=Object.freeze({__proto__:null,Accordion:t=>{const{schema:n,id:r}=t,{children:i,button:o,title:s,disableContentInset:u,...c}=n,{dispatchFieldEvent:l}=gI();return e.jsx(d.BoxContainer,{id:r,title:"string"==typeof s?s:e.jsx(iU,{children:s}),...c,callToActionComponent:o?e.jsx(a.Button.Default,{styleType:"light",type:"button",onClick:()=>l("accordion","edit",r),children:"object"==typeof o?o.label:"Edit"}):void 0,children:u?e.jsx(iU,{id:r,children:i}):e.jsx(Rk,{children:e.jsx(iU,{id:r,children:i})})})},Alert:t=>{const{id:n,schema:{children:r,...i}}=t;return e.jsx(c.Alert,{id:n,"data-testid":exports.TestHelper.generateId(n,"alert"),...i,children:"string"==typeof r?e.jsx(RL,{id:n,children:r}):U.default.isValidElement(r)||Array.isArray(r)||"number"==typeof r||"boolean"==typeof r||null==typeof r?r:e.jsx(iU,{children:r})})},Divider:t=>{const{id:n,schema:{verticalMargin:r,...i}}=t;return e.jsx(Fk,{id:n,"data-testid":exports.TestHelper.generateId(n,"divider"),$verticalMargin:r,...i})},Grid:t=>{const{id:n,schema:{children:r,customOptions:i={gridType:"v2"},uiType:a,...o}}=t,s="v3"===i.gridType?zk:Pk,u="v3"===i.gridType?"grid":"flex";return e.jsx(s,{type:u,"data-testid":exports.TestHelper.generateId(n,"grid"),...o,children:e.jsx(iU,{children:r})})},List:t=>{const{id:n,schema:{children:r,uiType:i,size:a,...o}}=t,s="ordered-list"===i?h.TextList.Ol:h.TextList.Ul;return e.jsx(s,{id:n,"data-testid":exports.TestHelper.generateId(n,i),size:(e=>e in jk)(a)?jk[a]:a,...o,children:r.map(((t,n)=>"string"==typeof t?e.jsx("li",{children:e.jsx(RL,{inline:!0,children:t})},n):e.jsx(iU,{children:t},n)))})},ListItem:t=>{const{id:n,schema:{children:r,uiType:i,showIf:a,columns:o,...s}}=t;return e.jsx("li",{id:n,...s,children:"string"==typeof r?e.jsx(RL,{inline:!0,children:r}):e.jsx(iU,{children:r})})},Popover:t=>{const{id:n,schema:{children:r,className:i,icon:a,hint:{content:o,...s},...u}}=t;return e.jsx(m.PopoverInline,{id:n,"data-testid":exports.TestHelper.generateId(n,"popover"),className:i,icon:(()=>{if(!a)return null;const t=H[a];return e.jsx(t,{})})(),content:r&&e.jsx(RL,{inline:!0,children:r}),popoverContent:(()=>{const t={allowedTags:$L.defaults.allowedTags.concat(["img"]),allowedAttributes:!1};return"string"==typeof o?e.jsx(RL,{inline:!0,sanitizeOptions:t,children:o}):e.jsx(iU,{children:o})})(),...s,...u})},Tab:n=>{const{id:r,schema:{currentActiveTabId:i,children:a,...o}}=n,[s,u]=t.useState(p()),{removeFieldValidationConfig:c}=Nk(),{unregister:l}=xe(),{dispatchFieldEvent:d}=gI(),f=Object.keys(a);t.useEffect((()=>{u(p())}),[i]),_s((()=>{Object.values(a).forEach(((e,t)=>{if(t===s)return;h(e).forEach((e=>{c(e),l(e)}))}))}),[s,a]);function p(){const e=Object.keys(a).findIndex((e=>e===i));return e<0?0:e}const h=e=>{const t=e.children,n=[];return dE(t)||!un(t)||Object.entries(t).forEach((([e,t])=>{n.push(e),"chips"===t.uiType&&n.push(e+"-textarea"),t.children&&n.push(...h(t))})),n};return e.jsx(y.Tab,{...o,id:r,"data-testid":exports.TestHelper.generateId(r,"tab"),currentActive:s,onTabClick:(e,t)=>{t!==s&&(u(t),d("change",r,{previousTabId:f[s],currentTabId:f[t]}))},children:Object.entries(a).map((([n,r])=>{const{title:i,children:a,...o}=r;return t.createElement(y.Tab.Item,{...o,key:n,id:n,"data-testid":exports.TestHelper.generateId(n,"tab-item"),title:i},e.jsx(iU,{children:a}))}))})},Text:n=>{const{id:r,schema:{children:i,uiType:a,maxLines:o,weight:s,...u}}=n,c=t.useRef(null),[l,d]=t.useState(!1),[f,p]=t.useState(!1),h=Zk[a.toUpperCase()]?.type||Uk[a.toUpperCase()]||void 0,m=Vk[a]||void 0;t.useEffect((()=>{if(d(!o),p(o>0),!o||!c.current)return;const e=c.current.clientHeight,t=c.current.scrollHeight;p(t-e>1)}),[i,o]);const g=e=>exports.TestHelper.generateId(e,"text"),y=()=>{const e=Hr(i)&&i.length>1,t=un(i)&&Object.keys(i).length>1;return e||t},_={allowedTags:$L.defaults.allowedTags.concat(["img"]),allowedAttributes:!1};return e.jsxs(e.Fragment,{children:[e.jsx(h,{id:r,ref:c,maxLines:l?void 0:o,"data-testid":g(r),weight:s?aI(s)?Bk[s]:s:a.toUpperCase()in Zk?Zk[a.toUpperCase()].weight:void 0,...u,...m&&!y()&&{as:m},...y()&&{as:"div"},children:Hr(i)?i.map(((t,n)=>{const i=`${r}-${n}`;return e.jsx(h,{id:i,"data-testid":g(i),children:e.jsx(RL,{id:i,inline:!0,sanitizeOptions:_,children:t})},n)})):"object"==typeof i?e.jsx(iU,{children:i}):e.jsx(RL,{inline:!0,sanitizeOptions:_,children:i})}),f&&e.jsx(Hk,{styleType:"link",onClick:()=>d(!l),children:l?"View less":"View more"})]})},get EElementType(){return exports.EElementType}});const Wk=t.forwardRef((({onChange:n,formValues:r,schema:i,error:a},o)=>{const s=t.useRef(null),u=t.useRef(void 0),c=t.useRef(null),{customComponents:l}=hI(),[d,f]=t.useState({}),[p,h]=t.useState(),{isSubmitting:m,isDirty:g}=Le(),{formSchema:{restoreMode:y,revalidationMode:_,validationMode:v,stripUnknown:b}}=Ok(),E=Ik(g);t.useImperativeHandle(o,(()=>s.current)),t.useEffect((()=>{g||void 0===E||E===g||s.current?.reset()}),[g]),t.useEffect((()=>{g?tI(r,d)||r&&Object.entries(r).forEach((([e,t])=>{s.current?.setValue(e,t)})):h(r)}),[r]),t.useEffect((()=>{m&&s.current?.validate()}),[m]),t.useEffect((()=>{u.current=a,a?s.current?.setErrors(a):s.current?.clearErrors()}),[a]);const S=t.useCallback((()=>{u.current&&setTimeout((()=>{u.current&&s.current?.setErrors(u.current)}),0)}),[]);return e.jsx("div",{ref:c,onBlurCapture:S,children:e.jsx(dU,{ref:s,data:{sections:{section:{uiType:"section",children:i}},defaultValues:p,restoreMode:y,revalidationMode:_,validationMode:v,stripUnknown:b},onValueChange:(e,t=!1)=>{(g||void 0===E||E===g)&&(f(e),n(e,t))},wrapInForm:!1,components:l})})})),qk=V.default.div`
|
|
339
339
|
${({$inset:e})=>e&&`\n\tpadding-left: ${e};\n\tpadding-right: ${e};\n\t`}
|
|
340
340
|
|
|
341
341
|
&:not(:last-child) {
|
|
@@ -376,7 +376,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
376
376
|
margin: 0;
|
|
377
377
|
`,t$=V.default(b.ErrorDisplay)`
|
|
378
378
|
margin-bottom: ${n.Spacing["spacing-32"]};
|
|
379
|
-
`;var n$=sn,r$=Hr,i$=Rr;var a$=function(e){return"string"==typeof e||!r$(e)&&i$(e)&&"[object String]"==n$(e)};var o$;!function(t){t.constructFormattedLabel=(t,n)=>{if("string"==typeof t)return{title:t};if(t&&"object"==typeof t&&t.mainLabel){const r="string"==typeof t.hint.content?e.jsx(s$,{className:"label-hint",children:t.hint.content}):e.jsx(
|
|
379
|
+
`;var n$=sn,r$=Hr,i$=Rr;var a$=function(e){return"string"==typeof e||!r$(e)&&i$(e)&&"[object String]"==n$(e)};var o$;!function(t){t.constructFormattedLabel=(t,n)=>{if("string"==typeof t)return{title:t};if(t&&"object"==typeof t&&t.mainLabel){const r="string"==typeof t.hint.content?e.jsx(s$,{className:"label-hint",children:t.hint.content}):e.jsx(iU,{children:t.hint.content});return{title:t.mainLabel,addon:t.hint?.content?{type:"popover",content:r,zIndex:t.hint?.zIndex,"data-testid":n+"-popover"}:void 0}}}}(o$||(o$={}));const s$=V.default(RL)`
|
|
380
380
|
&.label-hint {
|
|
381
381
|
color: ${n.Colour.text};
|
|
382
382
|
}
|
|
@@ -389,7 +389,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
389
389
|
${n.MediaQuery.MaxWidth.sm} {
|
|
390
390
|
padding: ${n.Spacing["spacing-20"]};
|
|
391
391
|
}
|
|
392
|
-
`;var d$,f$;!function(e){e.FILTER="Filter",e["FILTER-ITEM"]="FilterItem",e.TIMELINE="Timeline",e.REVIEW="Review"}(d$||(d$={})),function(e){e["ARRAY-FIELD"]="ArrayField",e["FILTER-CHECKBOX"]="FilterCheckbox",e.IFRAME="Iframe"}(f$||(f$={}));var p$=Object.freeze({__proto__:null,ArrayField:n=>{const{error:i,id:o,onChange:s,schema:{addButton:u,fieldSchema:l,initialEntries:d,removeButton:f,removeConfirmationModal:p,sectionInset:h,sectionTitle:m,showDivider:g=!0,validation:y},value:v,warning:b}=n,[E,S]=t.useState([]),[A,x]=t.useState([]),[w,T]=t.useState(!1),[M,O]=t.useState(-1),{setFieldValidationConfig:C}=Nk(),[N,D]=t.useState(void 0),[L,I]=t.useState(void 0),[k,$]=t.useState(void 0),R=t.useRef(!1),{resetField:F,setValue:z}=xe(),P=t.useRef([]),j=t.useRef(E),[Z,U]=t.useState(void 0),[B,V]=t.useState(void 0);t.useEffect((()=>{const e=y?.find((e=>"required"in e)),t=y?.find((e=>"valid"in e)),n=y?.find((e=>"min"in e)),r=y?.find((e=>"max"in e)),i=y?.find((e=>"length"in e)),a=y?.find((e=>"unique"in e)),s=n?.min??void 0,u=r?.max??void 0,c=i?.length??void 0;D(s??c),I(u??c),$(c);const l=tT().test("is-array-valid",t?.errorMessage||om.ARRAY_FIELD.INVALID,(()=>j.current.every(((e,t)=>P.current[t].isValid())))).test("is-empty-array",e?.errorMessage||om.ARRAY_FIELD.REQUIRED,(t=>!t||!e?.required||t.length>0&&t.some((e=>!dE(e))))).test("min-length",n?.errorMessage||om.ARRAY_FIELD.MIN(s),(e=>void 0===s||(e?.length??0)>=s)).test("max-length",r?.errorMessage||om.ARRAY_FIELD.MAX(u),(e=>void 0===u||(e?.length??0)<=u)).test("length-exact",i?.errorMessage||om.ARRAY_FIELD.LENGTH(c),(e=>void 0===c||(e?.length??0)===c)).test("unique-items",a?.errorMessage||om.ARRAY_FIELD.UNIQUE,(e=>{if(!e||!a?.unique?.length)return!0;const t=e.map((()=>({})));let n=!1;return a.unique.forEach((({field:r,errorMessage:i})=>{const a=e.map((e=>e?.[r]));a.forEach(((e,o)=>{if(!e)return;a.findIndex((t=>t===e))!==o&&(t[o]={...t[o],[r]:i||om.ARRAY_FIELD.UNIQUE},n=!0)}))})),U(n?t:void 0),!n}));C(o,l,y);const d=setTimeout((()=>C(o,l,y)),0);return()=>clearTimeout(d)}),[y,E.length]),t.useEffect((()=>{if(v){if(v===E)return;const e=void 0!==d?v:q(v,k,(()=>({}))),t=q(A,e.length,um);K(e),x(t),R.current&&(R.current=!1,z(o,e,{shouldDirty:!1,shouldTouch:!1}))}else{R.current=!0;const e=W(d??k??1),t=e.map((()=>um()));K(e),x(t),F(o,{defaultValue:e,keepDirty:!0})}}),[v,k,d,z,o]),t.useEffect((()=>{try{const e=JSON.parse(i?.message);e.fields&&U(e.fields),e.errorMessage&&V(e.errorMessage)}catch(e){V(i?.message)}}),[i]);const G=e=>t=>{const n=[...E];n[e]=t,K(n),s({target:{value:n}})},Y=e=>{const t=E.filter(((t,n)=>n!==e)),n=A.filter(((t,n)=>n!==e));K(t),x(n),s({target:{value:t}})},W=e=>Array(e).fill(null).map((()=>({}))),q=(e,t,n)=>{const r=[...e];for(;r.length<t;)r.push(n());return r},K=e=>{S(e),j.current=e},J=!(N>=0)||E.length>N,X=!(L>=1)||E.length<L,Q=f?.position??"top",ee=f?.alignment??"right",te=!0===p?.skip,ne=t=>{const n=H[t];return e.jsx(n,{})},re=t=>e.jsx(Jk,{className:"array-field-remove-button",type:"button",styleType:f?.styleType??"light",danger:!0,$alignment:ee,onClick:()=>(e=>{p?.skip?Y(e):(O(e),T(!0))})(t),...f?.icon?{icon:ne(f.icon)}:{as:a.Button.Small,icon:void 0},children:f?.label??"Remove"});return e.jsxs(e.Fragment,{children:[E.map(((n,i)=>{const a=i===E.length-1;return e.jsxs(t.Fragment,{children:[e.jsx(qk,{$inset:h,children:e.jsxs("div",{className:"array-field-section-container",children:[e.jsxs(Kk,{children:[m&&e.jsx(r.Typography.BodyBL,{weight:"bold",children:m}),J&&"top"===Q&&re(i)]}),e.jsx(Wk,{ref:e=>P.current[i]=e,formValues:n,schema:l,onChange:G(i),error:Z?.[i]}),J&&"bottom"===Q&&re(i)]})}),g&&!a?e.jsx(Qk,{}):null]},A[i])})),X&&e.jsx(qk,{$inset:h,children:e.jsx(Xk,{className:"array-field-add-button",type:"button",styleType:u?.styleType??"light",icon:u?.icon?ne(u.icon):e.jsx(_.PlusCircleFillIcon,{}),onClick:()=>{const e=[...E,{}],t=[...A,um()];K(e),x(t),s({target:{value:e}})},children:u?.label??"Add"})}),B&&e.jsx(qk,{$inset:h,children:e.jsx(c.Alert,{type:"error",children:B})}),b&&e.jsx(qk,{$inset:h,children:e.jsx(e$,{id:o,message:b})}),e.jsx(_T,{id:`${o}-remove-prompt`,size:"large",image:e.jsx(t$,{type:"warning",title:e.jsx(e.Fragment,{}),description:e.jsx(e.Fragment,{})}),title:te?void 0:p?.title??"Remove entry?",description:"The information you’ve entered will be deleted.",show:w,buttons:[{id:"back",title:"Back",buttonStyle:"secondary",onClick:()=>{T(!1)}},{id:"remove",title:"Remove",onClick:()=>{Y(M),T(!1)}}]})]})},Filter:t=>{const{setValue:n,getValues:r,resetField:i}=xe(),{id:a,schema:{children:o,label:s,toggleFilterButtonLabel:u,toggleFilterButtonStyle:c,clearButtonDisabled:l}}=t;return e.jsx(E.Filter,{"data-testid":exports.TestHelper.generateId(a,"filter"),toggleFilterButtonLabel:u,toggleFilterButtonStyle:c,headerTitle:s,clearButtonDisabled:l,onClear:()=>{const e=(()=>{const e=r(),t={},n={};Object.entries(o).forEach((([e,r])=>{r.clearBehavior&&"clear"!==r.clearBehavior?"revert"===r.clearBehavior&&(n[e]=r):t[e]=r}));const i={};for(const r in e){const a=fE.getNestedValueByKey(t,r),o=fE.getNestedValueByKey(n,r);dE(a)||(i[r]={behavior:"clear",value:e[r]}),dE(o)||(i[r]={behavior:"revert",value:e[r]})}return i})();var t;t=e,Object.entries(t).forEach((([e,{behavior:t,value:r}])=>{"clear"===t?Hr(r)?n(e,[]):(a$(r)||aI(r))&&n(e,""):"revert"===t&&i(e)}))},children:e.jsx(rU,{children:o})})},FilterItem:n=>{const{id:r,schema:{children:i,label:a,collapsible:o=!0,showDivider:s=!0,showMobileDivider:u=!0,expanded:c=!1}}=n,[l,d]=t.useState(c),{title:f,addon:p}=o$.constructFormattedLabel(a,r);return t.useEffect((()=>{d(c)}),[c]),e.jsx(E.Filter.Item,{"data-testid":exports.TestHelper.generateId(r,"filter-item"),title:f,addon:p,collapsible:o,showDivider:s,showMobileDivider:u,expanded:l,onExpandChange:d,children:e.jsx(rU,{children:i})})},FilterCheckbox:n=>{const{schema:{label:r,options:i,expanded:a,validation:o,...s},id:u,value:c,onChange:l}=n,{setValue:d}=xe(),[f,p]=t.useState(),[h,m]=t.useState(a),{setFieldValidationConfig:g}=Nk(),{title:y,addon:_}=o$.constructFormattedLabel(r,u),v=e=>"options"in e&&Array.isArray(e.options),b=e=>v(e)?e.key:e.value,S=e=>e.reduce(((e,t)=>[...e,t,...v(t)?S(t.options):[]]),[]);t.useEffect((()=>{g(u,tT().of(zx()),o)}),[o]),ys((()=>{const e=S(i),t=c?.filter((t=>e.find((e=>b(e)===t)))),n=e.filter((e=>c?.find((t=>b(e)===t))));p(n),d(u,t)}),[i,c]),t.useEffect((()=>{m(a)}),[a]);return e.jsx(E.Filter.Checkbox,{id:u,...s,"data-testid":exports.TestHelper.generateId(u,"filter-checkbox"),title:y,addon:_,selectedOptions:f,options:i,expanded:h,onExpandChange:m,onSelect:e=>{l({target:{value:e.map((e=>b(e)))}})},valueExtractor:e=>v(e)?e.key:e.value,labelExtractor:t=>e.jsx(RL,{inline:!0,sanitizeOptions:{allowedAttributes:!1},children:t.label})})},Iframe:n=>{const{error:r,id:i,schema:{"data-testid":a,src:o,validationTimeout:s=2e3,...u},value:c}=n,l=xe(),d=t.useRef(null),f=t.useRef({}),p=t.useRef(),[h,m]=t.useState({}),{setFieldValidationConfig:g}=Nk(),{dispatchFieldEvent:y}=gI(),_=t.useCallback((()=>{try{const e=new URL(o);return`${e.protocol}//${e.host}`}catch(e){return console.error("Invalid URL:",e),null}}),[o]),v=t.useCallback((e=>{const{type:t,payload:n}=e,r=_();r?d.current.contentWindow.postMessage({type:t,payload:n},r):console.warn(`invalid targetOrigin, iframe ${t} postMessage for ${i} aborted.`)}),[_,i]),b=t.useCallback((()=>{p.current&&clearTimeout(p.current)}),[]),E=t.useCallback((async(e,t)=>{b(),v({type:u$.VALIDATE,payload:{value:e,isSubmit:t}});try{return await new Promise(((e,t)=>{f.current.resolve=e,f.current.reject=t,p.current=setTimeout((()=>{t(!1),console.warn(`validation timeout for iframe component: ${i}. does child iframe have the validation handler? eiher extend validationTimeout value of set to -1 to skip it.`)}),s)}))}catch(e){return!1}}),[b,i,v,s]);return t.useEffect((()=>(g(i,Cx().test("validation",(async(e,t)=>!(s>=0)||await E(e,!1===t.options.abortEarly)))),()=>{b()})),[E,s]),t.useEffect((()=>{y("loading",i)}),[y,i,o]),t.useEffect((()=>{v({type:u$.SYNC,payload:{error:r,id:i,value:c}})}),[r,i,c,v]),Lk(u$.TRIGGER_SYNC,t.useCallback((()=>{v({type:u$.SYNC,payload:{error:r,id:i,value:c}})}),[r,i,c,v])),Lk(u$.RESIZE,t.useCallback((e=>{m({width:e.data.payload?.width,height:e.data.payload?.height})}),[])),Lk(u$.SET_VALUE,t.useCallback((e=>{l.setValue(i,e.data.payload,{shouldDirty:!0})}),[l,i])),Lk(u$.VALIDATION_RESULT,t.useCallback((e=>{e.data.payload?f.current.resolve(e.data.payload):f.current.reject(e.data.payload),b()}),[b])),Lk(u$.LOADED,t.useCallback((()=>{y("loaded",i)}),[y,i])),e.jsx(c$,{...u,ref:d,src:o,id:i,"data-testid":a||i,$width:h.width,$height:h?.height})},get EPostMessageEvent(){return u$},Review:n=>{const{id:r,schema:i}=n,{setFieldValidationConfig:o,removeFieldValidationConfig:s}=Nk(),{dispatchFieldEvent:u}=gI(),[c,l]=t.useState([]);t.useEffect((()=>(u("mount",r),o(r,Cx()),()=>{s(r)})),[]),ys((()=>{const t=i.items.map(((t,n)=>{const{value:r,mask:i,unmask:a,...o}=t,s=`item-${n+1}`,u="string"==typeof r?r:e.jsx(rU,{children:r}),c={formattedItem:{...o,id:s,value:u},unmaskFailureCount:0};return"mask"in t&&"string"==typeof r&&("uinfin"!==i&&"whole"!==i||(c.unmask=a,c.formattedItem={...o,id:s,value:u,maskState:"masked",maskRange:"uinfin"===i?[1,4]:[0,r.length]})),c}));l(t)}),[i.items]);const f=e=>{l((t=>t.map((t=>{const n={...t};return n.formattedItem.id!==e.id||n.unmaskedValue||dE(n.unmask)?n:(m(n.formattedItem.id),{...n,formattedItem:{...n.formattedItem,maskLoadingState:"loading"}})}))))},p=t=>{if(t)return e.jsx(rU,{children:t})},h=()=>c.map((({formattedItem:e,unmaskedValue:t,unmaskFailureCount:n})=>"unmasked"===e.maskState?{...e,value:t||e.value}:n>=3?{...e,alert:{type:"warning",children:"You can still submit form with this error"}}:e)),m=async e=>{const t=c.find((({formattedItem:t})=>t.id===e));try{const n=await new fl("",void 0,void 0,t.unmask.withCredentials).post(t.unmask.url,t.unmask.body,{headers:{"Content-Type":"application/json"}});g(e,n.data.value)}catch(t){y(e)}},g=(e,t)=>{l((n=>n.map((n=>n.formattedItem.id===e?{...n,unmaskFailureCount:0,unmaskedValue:t,formattedItem:{...n.formattedItem,maskState:"unmasked",maskLoadingState:void 0}}:n))))},y=e=>{l((t=>t.map((t=>t.formattedItem.id===e?{...t,unmaskFailureCount:t.unmaskFailureCount+1,formattedItem:{...t.formattedItem,maskLoadingState:"fail"}}:t))))};return"accordion"===i.variant?(t=>{const{button:n,bottomSection:i,expanded:o=!0,label:s,topSection:c,...l}=t;return e.jsx(d.BoxContainer,{title:s,callToActionComponent:!1===n?void 0:e.jsx(a.Button.Default,{styleType:"light",type:"button",onClick:()=>u("edit",r),children:n?.label??"Edit"}),expanded:o,...l,children:e.jsx(l$,{background:!1,id:r,items:h(),topSection:p(c),bottomSection:p(i),onUnmask:f,onTryAgain:f,fullWidth:!0})})})(i):(t=>{const{label:n,description:i,topSection:a,bottomSection:o,...s}=t;return e.jsx(S.UneditableSection,{...s,id:r,title:n,description:i,items:h(),topSection:p(a),bottomSection:p(o),onUnmask:f,onTryAgain:f})})(i)},Timeline:n=>{const{id:i,schema:{items:a,label:o,...s}}=n,{setFieldValidationConfig:u,removeFieldValidationConfig:c}=Nk();t.useEffect((()=>(u(i,zx()),()=>{c(i)})),[]);const l=a.map((({children:t,label:n,statuses:i,...a})=>{let o;return o="string"==typeof t?e.jsx(r.Typography.BodyBL,{children:e.jsx(RL,{inline:!0,children:t})}):e.jsx(rU,{children:t}),{content:o,statuses:i?.map((({icon:t,...n})=>{const r=H[t];return{icon:r?e.jsx(r,{}):void 0,...n}})),title:n,...a}}));return e.jsx(A.Timeline,{...s,items:l,title:o})},get ECustomElementType(){return d$},get ECustomFieldType(){return f$}});const h$=V.default(a.Button.Default)`
|
|
392
|
+
`;var d$,f$;!function(e){e.FILTER="Filter",e["FILTER-ITEM"]="FilterItem",e.TIMELINE="Timeline",e.REVIEW="Review"}(d$||(d$={})),function(e){e["ARRAY-FIELD"]="ArrayField",e["FILTER-CHECKBOX"]="FilterCheckbox",e.IFRAME="Iframe"}(f$||(f$={}));var p$=Object.freeze({__proto__:null,ArrayField:n=>{const{error:i,id:o,onChange:s,schema:{addButton:u,fieldSchema:l,initialEntries:d,removeButton:f,removeConfirmationModal:p,sectionInset:h,sectionTitle:m,showDivider:g=!0,validation:y},value:v,warning:b}=n,[E,S]=t.useState([]),[A,x]=t.useState([]),[w,T]=t.useState(!1),[M,O]=t.useState(-1),{setFieldValidationConfig:C}=Nk(),[N,D]=t.useState(void 0),[L,I]=t.useState(void 0),[k,$]=t.useState(void 0),R=t.useRef(!1),{resetField:F,setValue:z}=xe(),P=t.useRef([]),j=t.useRef(E),[Z,U]=t.useState(void 0),[B,V]=t.useState(void 0);t.useEffect((()=>{const e=y?.find((e=>"required"in e)),t=y?.find((e=>"valid"in e)),n=y?.find((e=>"min"in e)),r=y?.find((e=>"max"in e)),i=y?.find((e=>"length"in e)),a=y?.find((e=>"unique"in e)),s=n?.min??void 0,u=r?.max??void 0,c=i?.length??void 0;D(s??c),I(u??c),$(c);const l=tT().test("is-array-valid",t?.errorMessage||om.ARRAY_FIELD.INVALID,(()=>j.current.every(((e,t)=>P.current[t].isValid())))).test("is-empty-array",e?.errorMessage||om.ARRAY_FIELD.REQUIRED,(t=>!t||!e?.required||t.length>0&&t.some((e=>!dE(e))))).test("min-length",n?.errorMessage||om.ARRAY_FIELD.MIN(s),(e=>void 0===s||(e?.length??0)>=s)).test("max-length",r?.errorMessage||om.ARRAY_FIELD.MAX(u),(e=>void 0===u||(e?.length??0)<=u)).test("length-exact",i?.errorMessage||om.ARRAY_FIELD.LENGTH(c),(e=>void 0===c||(e?.length??0)===c)).test("unique-items",a?.errorMessage||om.ARRAY_FIELD.UNIQUE,(e=>{if(!e||!a?.unique?.length)return!0;const t=e.map((()=>({})));let n=!1;return a.unique.forEach((({field:r,errorMessage:i})=>{const a=e.map((e=>e?.[r]));a.forEach(((e,o)=>{if(!e)return;a.findIndex((t=>t===e))!==o&&(t[o]={...t[o],[r]:i||om.ARRAY_FIELD.UNIQUE},n=!0)}))})),U(n?t:void 0),!n}));C(o,l,y);const d=setTimeout((()=>C(o,l,y)),0);return()=>clearTimeout(d)}),[y,E.length]),t.useEffect((()=>{if(v){if(v===E)return;const e=void 0!==d?v:q(v,k,(()=>({}))),t=q(A,e.length,um);K(e),x(t),R.current&&(R.current=!1,z(o,e,{shouldDirty:!1,shouldTouch:!1}))}else{R.current=!0;const e=W(d??k??1),t=e.map((()=>um()));K(e),x(t),F(o,{defaultValue:e,keepDirty:!0})}}),[v,k,d,z,o]),t.useEffect((()=>{try{const e=JSON.parse(i?.message);e.fields&&U(e.fields),e.errorMessage&&V(e.errorMessage)}catch(e){V(i?.message)}}),[i]);const G=e=>t=>{const n=[...E];n[e]=t,K(n),s({target:{value:n}})},Y=e=>{const t=E.filter(((t,n)=>n!==e)),n=A.filter(((t,n)=>n!==e));K(t),x(n),s({target:{value:t}})},W=e=>Array(e).fill(null).map((()=>({}))),q=(e,t,n)=>{const r=[...e];for(;r.length<t;)r.push(n());return r},K=e=>{S(e),j.current=e},J=!(N>=0)||E.length>N,X=!(L>=1)||E.length<L,Q=f?.position??"top",ee=f?.alignment??"right",te=!0===p?.skip,ne=t=>{const n=H[t];return e.jsx(n,{})},re=t=>e.jsx(Jk,{className:"array-field-remove-button",type:"button",styleType:f?.styleType??"light",danger:!0,$alignment:ee,onClick:()=>(e=>{p?.skip?Y(e):(O(e),T(!0))})(t),...f?.icon?{icon:ne(f.icon)}:{as:a.Button.Small,icon:void 0},children:f?.label??"Remove"});return e.jsxs(e.Fragment,{children:[E.map(((n,i)=>{const a=i===E.length-1;return e.jsxs(t.Fragment,{children:[e.jsx(qk,{$inset:h,children:e.jsxs("div",{className:"array-field-section-container",children:[e.jsxs(Kk,{children:[m&&e.jsx(r.Typography.BodyBL,{weight:"bold",children:m}),J&&"top"===Q&&re(i)]}),e.jsx(Wk,{ref:e=>P.current[i]=e,formValues:n,schema:l,onChange:G(i),error:Z?.[i]}),J&&"bottom"===Q&&re(i)]})}),g&&!a?e.jsx(Qk,{}):null]},A[i])})),X&&e.jsx(qk,{$inset:h,children:e.jsx(Xk,{className:"array-field-add-button",type:"button",styleType:u?.styleType??"light",icon:u?.icon?ne(u.icon):e.jsx(_.PlusCircleFillIcon,{}),onClick:()=>{const e=[...E,{}],t=[...A,um()];K(e),x(t),s({target:{value:e}})},children:u?.label??"Add"})}),B&&e.jsx(qk,{$inset:h,children:e.jsx(c.Alert,{type:"error",children:B})}),b&&e.jsx(qk,{$inset:h,children:e.jsx(e$,{id:o,message:b})}),e.jsx(_T,{id:`${o}-remove-prompt`,size:"large",image:e.jsx(t$,{type:"warning",title:e.jsx(e.Fragment,{}),description:e.jsx(e.Fragment,{})}),title:te?void 0:p?.title??"Remove entry?",description:"The information you’ve entered will be deleted.",show:w,buttons:[{id:"back",title:"Back",buttonStyle:"secondary",onClick:()=>{T(!1)}},{id:"remove",title:"Remove",onClick:()=>{Y(M),T(!1)}}]})]})},Filter:t=>{const{setValue:n,getValues:r,resetField:i}=xe(),{id:a,schema:{children:o,label:s,toggleFilterButtonLabel:u,toggleFilterButtonStyle:c,clearButtonDisabled:l}}=t;return e.jsx(E.Filter,{"data-testid":exports.TestHelper.generateId(a,"filter"),toggleFilterButtonLabel:u,toggleFilterButtonStyle:c,headerTitle:s,clearButtonDisabled:l,onClear:()=>{const e=(()=>{const e=r(),t={},n={};Object.entries(o).forEach((([e,r])=>{r.clearBehavior&&"clear"!==r.clearBehavior?"revert"===r.clearBehavior&&(n[e]=r):t[e]=r}));const i={};for(const r in e){const a=fE.getNestedValueByKey(t,r),o=fE.getNestedValueByKey(n,r);dE(a)||(i[r]={behavior:"clear",value:e[r]}),dE(o)||(i[r]={behavior:"revert",value:e[r]})}return i})();var t;t=e,Object.entries(t).forEach((([e,{behavior:t,value:r}])=>{"clear"===t?Hr(r)?n(e,[]):(a$(r)||aI(r))&&n(e,""):"revert"===t&&i(e)}))},children:e.jsx(iU,{children:o})})},FilterItem:n=>{const{id:r,schema:{children:i,label:a,collapsible:o=!0,showDivider:s=!0,showMobileDivider:u=!0,expanded:c=!1}}=n,[l,d]=t.useState(c),{title:f,addon:p}=o$.constructFormattedLabel(a,r);return t.useEffect((()=>{d(c)}),[c]),e.jsx(E.Filter.Item,{"data-testid":exports.TestHelper.generateId(r,"filter-item"),title:f,addon:p,collapsible:o,showDivider:s,showMobileDivider:u,expanded:l,onExpandChange:d,children:e.jsx(iU,{children:i})})},FilterCheckbox:n=>{const{schema:{label:r,options:i,expanded:a,validation:o,...s},id:u,value:c,onChange:l}=n,{setValue:d}=xe(),[f,p]=t.useState(),[h,m]=t.useState(a),{setFieldValidationConfig:g}=Nk(),{title:y,addon:_}=o$.constructFormattedLabel(r,u),v=e=>"options"in e&&Array.isArray(e.options),b=e=>v(e)?e.key:e.value,S=e=>e.reduce(((e,t)=>[...e,t,...v(t)?S(t.options):[]]),[]);t.useEffect((()=>{g(u,tT().of(zx()),o)}),[o]),ys((()=>{const e=S(i),t=c?.filter((t=>e.find((e=>b(e)===t)))),n=e.filter((e=>c?.find((t=>b(e)===t))));p(n),d(u,t)}),[i,c]),t.useEffect((()=>{m(a)}),[a]);return e.jsx(E.Filter.Checkbox,{id:u,...s,"data-testid":exports.TestHelper.generateId(u,"filter-checkbox"),title:y,addon:_,selectedOptions:f,options:i,expanded:h,onExpandChange:m,onSelect:e=>{l({target:{value:e.map((e=>b(e)))}})},valueExtractor:e=>v(e)?e.key:e.value,labelExtractor:t=>e.jsx(RL,{inline:!0,sanitizeOptions:{allowedAttributes:!1},children:t.label})})},Iframe:n=>{const{error:r,id:i,schema:{"data-testid":a,src:o,validationTimeout:s=2e3,...u},value:c}=n,l=xe(),d=t.useRef(null),f=t.useRef({}),p=t.useRef(),[h,m]=t.useState({}),{setFieldValidationConfig:g}=Nk(),{dispatchFieldEvent:y}=gI(),_=t.useCallback((()=>{try{const e=new URL(o);return`${e.protocol}//${e.host}`}catch(e){return console.error("Invalid URL:",e),null}}),[o]),v=t.useCallback((e=>{const{type:t,payload:n}=e,r=_();r?d.current.contentWindow.postMessage({type:t,payload:n},r):console.warn(`invalid targetOrigin, iframe ${t} postMessage for ${i} aborted.`)}),[_,i]),b=t.useCallback((()=>{p.current&&clearTimeout(p.current)}),[]),E=t.useCallback((async(e,t)=>{b(),v({type:u$.VALIDATE,payload:{value:e,isSubmit:t}});try{return await new Promise(((e,t)=>{f.current.resolve=e,f.current.reject=t,p.current=setTimeout((()=>{t(!1),console.warn(`validation timeout for iframe component: ${i}. does child iframe have the validation handler? eiher extend validationTimeout value of set to -1 to skip it.`)}),s)}))}catch(e){return!1}}),[b,i,v,s]);return t.useEffect((()=>(g(i,Cx().test("validation",(async(e,t)=>!(s>=0)||await E(e,!1===t.options.abortEarly)))),()=>{b()})),[E,s]),t.useEffect((()=>{y("loading",i)}),[y,i,o]),t.useEffect((()=>{v({type:u$.SYNC,payload:{error:r,id:i,value:c}})}),[r,i,c,v]),Lk(u$.TRIGGER_SYNC,t.useCallback((()=>{v({type:u$.SYNC,payload:{error:r,id:i,value:c}})}),[r,i,c,v])),Lk(u$.RESIZE,t.useCallback((e=>{m({width:e.data.payload?.width,height:e.data.payload?.height})}),[])),Lk(u$.SET_VALUE,t.useCallback((e=>{l.setValue(i,e.data.payload,{shouldDirty:!0})}),[l,i])),Lk(u$.VALIDATION_RESULT,t.useCallback((e=>{e.data.payload?f.current.resolve(e.data.payload):f.current.reject(e.data.payload),b()}),[b])),Lk(u$.LOADED,t.useCallback((()=>{y("loaded",i)}),[y,i])),e.jsx(c$,{...u,ref:d,src:o,id:i,"data-testid":a||i,$width:h.width,$height:h?.height})},get EPostMessageEvent(){return u$},Review:n=>{const{id:r,schema:i}=n,{setFieldValidationConfig:o,removeFieldValidationConfig:s}=Nk(),{dispatchFieldEvent:u}=gI(),[c,l]=t.useState([]);t.useEffect((()=>(u("mount",r),o(r,Cx()),()=>{s(r)})),[]),ys((()=>{const t=i.items.map(((t,n)=>{const{value:r,mask:i,unmask:a,...o}=t,s=`item-${n+1}`,u="string"==typeof r?r:e.jsx(iU,{children:r}),c={formattedItem:{...o,id:s,value:u},unmaskFailureCount:0};return"mask"in t&&"string"==typeof r&&("uinfin"!==i&&"whole"!==i||(c.unmask=a,c.formattedItem={...o,id:s,value:u,maskState:"masked",maskRange:"uinfin"===i?[1,4]:[0,r.length]})),c}));l(t)}),[i.items]);const f=e=>{l((t=>t.map((t=>{const n={...t};return n.formattedItem.id!==e.id||n.unmaskedValue||dE(n.unmask)?n:(m(n.formattedItem.id),{...n,formattedItem:{...n.formattedItem,maskLoadingState:"loading"}})}))))},p=t=>{if(t)return e.jsx(iU,{children:t})},h=()=>c.map((({formattedItem:e,unmaskedValue:t,unmaskFailureCount:n})=>"unmasked"===e.maskState?{...e,value:t||e.value}:n>=3?{...e,alert:{type:"warning",children:"You can still submit form with this error"}}:e)),m=async e=>{const t=c.find((({formattedItem:t})=>t.id===e));try{const n=await new fl("",void 0,void 0,t.unmask.withCredentials).post(t.unmask.url,t.unmask.body,{headers:{"Content-Type":"application/json"}});g(e,n.data.value)}catch(t){y(e)}},g=(e,t)=>{l((n=>n.map((n=>n.formattedItem.id===e?{...n,unmaskFailureCount:0,unmaskedValue:t,formattedItem:{...n.formattedItem,maskState:"unmasked",maskLoadingState:void 0}}:n))))},y=e=>{l((t=>t.map((t=>t.formattedItem.id===e?{...t,unmaskFailureCount:t.unmaskFailureCount+1,formattedItem:{...t.formattedItem,maskLoadingState:"fail"}}:t))))};return"accordion"===i.variant?(t=>{const{button:n,bottomSection:i,expanded:o=!0,label:s,topSection:c,...l}=t;return e.jsx(d.BoxContainer,{title:s,callToActionComponent:!1===n?void 0:e.jsx(a.Button.Default,{styleType:"light",type:"button",onClick:()=>u("edit",r),children:n?.label??"Edit"}),expanded:o,...l,children:e.jsx(l$,{background:!1,id:r,items:h(),topSection:p(c),bottomSection:p(i),onUnmask:f,onTryAgain:f,fullWidth:!0})})})(i):(t=>{const{label:n,description:i,topSection:a,bottomSection:o,...s}=t;return e.jsx(S.UneditableSection,{...s,id:r,title:n,description:i,items:h(),topSection:p(a),bottomSection:p(o),onUnmask:f,onTryAgain:f})})(i)},Timeline:n=>{const{id:i,schema:{items:a,label:o,...s}}=n,{setFieldValidationConfig:u,removeFieldValidationConfig:c}=Nk();t.useEffect((()=>(u(i,zx()),()=>{c(i)})),[]);const l=a.map((({children:t,label:n,statuses:i,...a})=>{let o;return o="string"==typeof t?e.jsx(r.Typography.BodyBL,{children:e.jsx(RL,{inline:!0,children:t})}):e.jsx(iU,{children:t}),{content:o,statuses:i?.map((({icon:t,...n})=>{const r=H[t];return{icon:r?e.jsx(r,{}):void 0,...n}})),title:n,...a}}));return e.jsx(A.Timeline,{...s,items:l,title:o})},get ECustomElementType(){return d$},get ECustomFieldType(){return f$}});const h$=V.default(a.Button.Default)`
|
|
393
393
|
> span {
|
|
394
394
|
display: flex;
|
|
395
395
|
align-items: center;
|
|
@@ -478,7 +478,7 @@ function SO(e){return"[object Object]"===Object.prototype.toString.call(e)}Objec
|
|
|
478
478
|
cursor: pointer;
|
|
479
479
|
`,uz=V.default(c.Alert)`
|
|
480
480
|
margin-top: ${n.Spacing["spacing-8"]};
|
|
481
|
-
`;var cz=Vr,lz=Hr,dz=qt?qt.isConcatSpreadable:void 0;var fz=sa,pz=function(e){return lz(e)||cz(e)||!!(dz&&e&&e[dz])};var hz=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=pz),a||(a=[]);++o<s;){var u=t[o];n>0&&r(u)?n>1?e(u,n-1,r,i,a):fz(a,u):i||(a[a.length]=u)}return a};var mz=Na,gz=function(){},yz=mz&&1/FS(new mz([,-0]))[1]==1/0?function(e){return new mz(e)}:gz,_z=CS,vz=S$,bz=A$,Ez=DS,Sz=yz,Az=FS;var xz=function(e,t,n){var r=-1,i=vz,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=bz;else if(a>=200){var c=t?null:Sz(e);if(c)return Az(c);o=!1,i=Ez,u=new _z}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s},wz=N$,Tz=hz,Mz=xz;var Oz=function(e,t,n){var r=e.length;if(r<2)return r?Mz(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=wz(a[i]||o,e[s],t,n));return Mz(Tz(a,1),t,n)},Cz=Ki,Nz=Oz,Dz=SI,Lz=gk((function(e){return Nz(Cz(e,Dz))}));const Iz=t.createContext({files:[],setFiles:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),kz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState([]),s=t.useMemo((()=>({files:r,setFiles:i,currentFileIds:a,setCurrentFileIds:o})),[r,a]);return e.jsx(Iz.Provider,{value:s,children:n})};var $z,Rz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}($z||($z={})),exports.EFileStatus=void 0,(Rz=exports.EFileStatus||(exports.EFileStatus={}))[Rz.INJECTED=-99]="INJECTED",Rz[Rz.INJECTING=-98]="INJECTING",Rz[Rz.TO_DELETE=-4]="TO_DELETE",Rz[Rz.ERROR_FORMAT=-3]="ERROR_FORMAT",Rz[Rz.ERROR_GENERIC=-2]="ERROR_GENERIC",Rz[Rz.ERROR_SIZE=-1]="ERROR_SIZE",Rz[Rz.NONE=0]="NONE",Rz[Rz.UPLOAD_READY=4]="UPLOAD_READY",Rz[Rz.UPLOADING=5]="UPLOADING",Rz[Rz.UPLOADED=6]="UPLOADED";const Fz=t.lazy((()=>Promise.resolve().then((function(){return require("./file-upload-manager.
|
|
481
|
+
`;var cz=Vr,lz=Hr,dz=qt?qt.isConcatSpreadable:void 0;var fz=sa,pz=function(e){return lz(e)||cz(e)||!!(dz&&e&&e[dz])};var hz=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||(r=pz),a||(a=[]);++o<s;){var u=t[o];n>0&&r(u)?n>1?e(u,n-1,r,i,a):fz(a,u):i||(a[a.length]=u)}return a};var mz=Na,gz=function(){},yz=mz&&1/FS(new mz([,-0]))[1]==1/0?function(e){return new mz(e)}:gz,_z=CS,vz=S$,bz=A$,Ez=DS,Sz=yz,Az=FS;var xz=function(e,t,n){var r=-1,i=vz,a=e.length,o=!0,s=[],u=s;if(n)o=!1,i=bz;else if(a>=200){var c=t?null:Sz(e);if(c)return Az(c);o=!1,i=Ez,u=new _z}else u=t?[]:s;e:for(;++r<a;){var l=e[r],d=t?t(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),s.push(l)}else i(u,d,n)||(u!==s&&u.push(d),s.push(l))}return s},wz=N$,Tz=hz,Mz=xz;var Oz=function(e,t,n){var r=e.length;if(r<2)return r?Mz(e[0]):[];for(var i=-1,a=Array(r);++i<r;)for(var o=e[i],s=-1;++s<r;)s!=i&&(a[i]=wz(a[i]||o,e[s],t,n));return Mz(Tz(a,1),t,n)},Cz=Ki,Nz=Oz,Dz=SI,Lz=gk((function(e){return Nz(Cz(e,Dz))}));const Iz=t.createContext({files:[],setFiles:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),kz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState([]),s=t.useMemo((()=>({files:r,setFiles:i,currentFileIds:a,setCurrentFileIds:o})),[r,a]);return e.jsx(Iz.Provider,{value:s,children:n})};var $z,Rz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}($z||($z={})),exports.EFileStatus=void 0,(Rz=exports.EFileStatus||(exports.EFileStatus={}))[Rz.INJECTED=-99]="INJECTED",Rz[Rz.INJECTING=-98]="INJECTING",Rz[Rz.TO_DELETE=-4]="TO_DELETE",Rz[Rz.ERROR_FORMAT=-3]="ERROR_FORMAT",Rz[Rz.ERROR_GENERIC=-2]="ERROR_GENERIC",Rz[Rz.ERROR_SIZE=-1]="ERROR_SIZE",Rz[Rz.NONE=0]="NONE",Rz[Rz.UPLOAD_READY=4]="UPLOAD_READY",Rz[Rz.UPLOADING=5]="UPLOADING",Rz[Rz.UPLOADED=6]="UPLOADED";const Fz=t.lazy((()=>Promise.resolve().then((function(){return require("./file-upload-manager.bc7599d2.js")})))),zz=n=>{const{id:r,error:i,isDirty:a,isTouched:o,value:s,schema:{compressImages:u,description:c,hideThumbnail:l,label:d,uploadOnAddingFile:f,validation:p,warning:h,...m},warning:g}=n,{files:y,currentFileIds:_,setFiles:v}=t.useContext(Iz),b=t.useRef({}),E=t.useRef({}),S=t.useRef({}),A=t.useRef({}),x=t.useRef({}),{setFieldValidationConfig:w}=Nk(),{dispatchFieldEvent:T}=gI(),{clearErrors:O,setError:C}=xe(),[N,D]=t.useState(),L=t.useRef(y),I=t.useCallback(((e,t)=>{const n=[...t],i=n.length;e.forEach(((e,t)=>{!S.current.max||i+t<S.current.max?(n.push({...e,slot:$z.findAvailableSlot(n)}),O(r)):C(r,{type:"max",message:S.current.errorMessage||om.UPLOAD().MAX_FILES(S.current.max)})})),v(n)}),[O,r,C,v]);t.useEffect((()=>{L.current=y}),[y]),t.useEffect((()=>{T("mount",r)}),[T,r]),t.useEffect((()=>{const e=p?.find((e=>"required"in e)),t=p?.find((e=>"fileType"in e)),n=p?.find((e=>"fileExtension"in e)),i=p?.find((e=>"maxSizeInKb"in e)),a=p?.find((e=>"upload"in e&&e.upload));b.current=t?.fileType?t:{},E.current=t?.fileType&&n?.fileExtension?n:{},A.current=i?.maxSizeInKb>0?i:{},x.current=a||{};const o=p?.find((e=>"length"in e)),s=p?.find((e=>"max"in e));S.current=o?{max:o.length,errorMessage:o.errorMessage}:s?{max:s.max,errorMessage:s.errorMessage}:{},w(r,tT().of(Qw().shape({dataURL:zx(),fileId:zx(),fileName:zx(),fileUrl:zx(),uploadResponse:Qw()})).test("is-empty-array",e?.errorMessage||om.UPLOAD().REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",A.current.errorMessage||om.UPLOAD().MAX_FILE_SIZE(A.current.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&A.current.maxSizeInKb)||y.filter((e=>e.status===exports.EFileStatus.UPLOADED)).every((e=>{if("base64"===f.type&&e.dataURL)return exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*A.current.maxSizeInKb;if("multipart"===f.type){const t=e.uploadResponse?.data||e.uploadResponse;let n=e.rawFile?.size||t?.fileSize;return isNaN(n)&&(n=0),n<=1024*A.current.maxSizeInKb}})))).test("max-files",S.current.errorMessage||om.UPLOAD().MAX_FILES(S.current.max),(e=>!(e&&Array.isArray(e)&&S.current.max)||e.length<=S.current.max)).test("no-interim-statuses",om.UPLOAD().UPLOADING,(()=>{const e=new Set([exports.EFileStatus.INJECTED,exports.EFileStatus.INJECTING,exports.EFileStatus.NONE,exports.EFileStatus.UPLOAD_READY,exports.EFileStatus.UPLOADING]);return!L.current.some((t=>e.has(t.status)))})),p)}),[p,y.map((e=>e.status)).join(",")]),t.useEffect((()=>{if(!a&&!o){const e=Array.isArray(s)?s:[];if(!(Lz(e.map((({fileId:e})=>e)),_).length>0))return;const t=[];e.forEach((({dataURL:e,fileId:n,fileName:r,fileUrl:i,uploadResponse:a})=>{t.push({addedFrom:"schema",dataURL:e,fileItem:{id:n},uploadResponse:a,fileUrl:i,rawFile:{name:r},slot:null,status:exports.EFileStatus.INJECTED})})),I(t,[])}}),[I,a,o,_,s]),t.useEffect((()=>{if(i?.message)try{const{message:e,fileErrors:t}=JSON.parse(i.message);t&&v(L.current.map((e=>{const n=t[e.fileItem.id];return n?{...e,fileItem:{...e.fileItem,errorMessage:n}}:e}))),e&&D(e)}catch(e){D(i.message)}else D(void 0)}),[i?.message,v]);const k=t=>t?e.jsx(RL,{children:t}):null;return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(Fz,{compressImages:!!u,fileTypeRule:b.current,fileExtensionRule:E.current,hideThumbnail:l,id:r,maxFileSizeRule:A.current,upload:f,uploadRule:x.current,value:s})}),e.jsx(M.FileUpload,{...m,accept:b.current.fileType?.map((e=>`.${e}`)).join(","),description:k(c),errorMessage:k(N),fileItems:y.filter((({fileItem:e,status:t})=>!!e&&t!==exports.EFileStatus.INJECTED&&t!==exports.EFileStatus.INJECTING)).map((({fileItem:e})=>e)),id:r,maxFiles:S.current.max,onChange:e=>{I(e.map((e=>({addedFrom:"input",rawFile:e,slot:null,status:exports.EFileStatus.NONE}))),y)},onDelete:e=>{v(y.map((t=>t.fileItem.id!==e.id?t:{...t,status:exports.EFileStatus.TO_DELETE}))),O(r)},title:k(d),warning:k(g||h)})]})},Pz=t.createContext({images:[],setImages:()=>null,errorCount:0,setErrorCount:()=>null,currentFileIds:[],setCurrentFileIds:()=>null}),jz=({children:n})=>{const[r,i]=t.useState([]),[a,o]=t.useState(0),[s,u]=t.useState([]);return e.jsx(Pz.Provider,{value:{images:r,setImages:i,errorCount:a,setErrorCount:o,currentFileIds:s,setCurrentFileIds:u},children:n})};var Zz;!function(e){e.findAvailableSlot=e=>{const t=e.reduce(((e,{slot:t})=>t>e?t:e),0),n=Math.max(t,e.length),r=Array(n).fill(0).map(((e,t)=>t)),i=e.map((({slot:e})=>e));return r.filter((e=>!i.includes(e)))[0]??n}}(Zz||(Zz={}));const Uz=["jpg","gif","png","heic","heif","webp"];var Bz;exports.EImageStatus=void 0,(Bz=exports.EImageStatus||(exports.EImageStatus={}))[Bz.INJECTED=-99]="INJECTED",Bz[Bz.ERROR_FILENAME=-8]="ERROR_FILENAME",Bz[Bz.ERROR_CUSTOM_MUTED=-7]="ERROR_CUSTOM_MUTED",Bz[Bz.ERROR_EXCEED=-6]="ERROR_EXCEED",Bz[Bz.ERROR_CUSTOM=-5]="ERROR_CUSTOM",Bz[Bz.TO_DELETE=-4]="TO_DELETE",Bz[Bz.ERROR_FORMAT=-3]="ERROR_FORMAT",Bz[Bz.ERROR_GENERIC=-2]="ERROR_GENERIC",Bz[Bz.ERROR_SIZE=-1]="ERROR_SIZE",Bz[Bz.NONE=0]="NONE",Bz[Bz.TO_RECOMPRESS=1]="TO_RECOMPRESS",Bz[Bz.COMPRESSED=2]="COMPRESSED",Bz[Bz.RECOMPRESSED=2]="RECOMPRESSED",Bz[Bz.CONVERTED=2]="CONVERTED",Bz[Bz.EDITED=3]="EDITED",Bz[Bz.UPLOAD_READY=4]="UPLOAD_READY",Bz[Bz.UPLOADING=5]="UPLOADING",Bz[Bz.UPLOADED=6]="UPLOADED",Bz[Bz.PENDING=7]="PENDING";var Vz,Hz={exports:{}},Gz={exports:{}},Yz={};var Wz,qz,Kz,Jz,Xz,Qz,eP,tP,nP,rP,iP,aP,oP,sP,uP={};
|
|
482
482
|
/** @license React v16.13.1
|
|
483
483
|
* react-is.development.js
|
|
484
484
|
*
|
|
@@ -629,6 +629,7 @@ object-assign
|
|
|
629
629
|
}
|
|
630
630
|
`,Dj=V.default.div`
|
|
631
631
|
display: flex;
|
|
632
|
+
width: 100%;
|
|
632
633
|
`,Lj=({id:n="file-item",index:i,fileItem:a,maxSizeInKb:o,accepts:s,onDelete:u,validation:c})=>{const{dataURL:l,file:d,name:f,status:p,uploadProgress:h}=a,[m,g]=t.useState(!1),[y,_]=t.useState(),v=t.useRef(null),[b,E]=t.useState(),S=t.useCallback((()=>{const e=exports.FileHelper.truncateFileName(f,v);E(e)}),[f]);t.useEffect((()=>{const e=new ResizeObserver((()=>{v.current&&S()})),t=v.current;return t&&(e.observe(t),S()),()=>{t&&e.unobserve(t)}}),[v,S]),t.useEffect((()=>{switch(p){case exports.EImageStatus.ERROR_FORMAT:{const e=c?.find((e=>"fileType"in e)),t=e?.errorMessage||om.UPLOAD("photo").FILE_TYPE(s);g(!0),_(t);break}case exports.EImageStatus.ERROR_GENERIC:{const e=c?.find((e=>"upload"in e)),t=e?.errorMessage||om.UPLOAD("photo").GENERIC;g(!0),_(t);break}case exports.EImageStatus.ERROR_SIZE:{const e=c?.find((e=>"maxSizeInKb"in e)),t=e?.errorMessage||om.UPLOAD("photo").MAX_FILE_SIZE(o);g(!0),_(t);break}case exports.EImageStatus.ERROR_FILENAME:{const e=c?.find((e=>"matches"in e)),t=e?.errorMessage||om.UPLOAD("photo").MODAL.GENERIC_ERROR.INVALID_FILE_NAME;g(!0),_(t);break}case exports.EImageStatus.ERROR_CUSTOM:{const e=a.customErrorMessage;g(!0),_(e);break}case exports.EImageStatus.ERROR_CUSTOM_MUTED:{const e=a.customErrorMessage;g(!1),_(e);break}}}),[p,l,d.type,o]);const A=`${Math.round(exports.FileHelper.getFilesizeFromBase64(a.drawingDataURL||a.dataURL||"")/1e3)} KB`,x=()=>(m||p===exports.EImageStatus.ERROR_CUSTOM_MUTED)&&e.jsx(Cj,{weight:"semibold",id:exports.TestHelper.generateId(`${n}-${i+1}`,"error-text"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"error-text"),children:y});return e.jsx(_j,{isError:m,isCustomMuted:p===exports.EImageStatus.ERROR_CUSTOM_MUTED,id:exports.TestHelper.generateId(`${n}-${i+1}`),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`),children:e.jsxs(e.Fragment,{children:[e.jsx(vj,{children:p===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsxs(e.Fragment,{children:[e.jsxs(Dj,{children:[e.jsx(Aj,{src:a.dataURL??"",id:exports.TestHelper.generateId(`${n}-${i+1}`,"image"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"image")}),e.jsxs(xj,{forwardedAs:"div",id:exports.TestHelper.generateId(`${n}-${i+1}`,"file-image"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"file-image"),children:[e.jsx(wj,{ref:v,children:b}),e.jsx(Mj,{children:x()}),e.jsx(Tj,{children:A})]})]}),e.jsx(xj,{forwardedAs:"div",id:exports.TestHelper.generateId(`${n}-${i+1}`,"file-error"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"file-error"),children:e.jsx(Tj,{children:x()})})]}):e.jsxs(e.Fragment,{children:[p===exports.EImageStatus.UPLOADED&&!m&&e.jsx(Aj,{src:a.dataURL??"",id:exports.TestHelper.generateId(`${n}-${i+1}`,"image"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"image")}),e.jsxs(xj,{forwardedAs:"div",id:exports.TestHelper.generateId(`${n}-${i+1}`,"file-image"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"file-image"),children:[e.jsx(wj,{ref:v,children:b}),x(),e.jsx(Tj,{children:A})]})]})}),e.jsx(bj,{children:e.jsx(r.Typography.BodyBL,{id:exports.TestHelper.generateId(`${n}-${i+1}`,"file-size"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"file-size"),children:A})}),!m&&[exports.EImageStatus.COMPRESSED,exports.EImageStatus.CONVERTED,exports.EImageStatus.UPLOADING].includes(p)?e.jsx(Ej,{children:e.jsx(Oj,{value:h,max:100})}):e.jsx(Sj,{children:e.jsx(Nj,{onClick:u(i),id:exports.TestHelper.generateId(`${n}-${i+1}`,"btn-delete"),"data-testid":exports.TestHelper.generateId(`${n}-${i+1}`,"btn-delete"),"aria-label":`remove ${f}`,children:e.jsx(O.CrossIcon,{})})})]})})},Ij=V.default.div`
|
|
633
634
|
border-radius: ${n.Radius.sm};
|
|
634
635
|
${n.Border.Util["dashed-default"]({colour:n.Colour.border,thickness:n.Border["width-040"],radius:n.Radius.sm})}
|
|
@@ -984,7 +985,7 @@ object-assign
|
|
|
984
985
|
stroke: ${n.Colour["icon-primary"]};
|
|
985
986
|
stroke-width: 1;
|
|
986
987
|
}
|
|
987
|
-
`,TZ=n=>{const{accepts:r,activeFileIndex:i,capture:a,id:o="image-thumbnails",images:s,maxFiles:u,onClickThumbnail:c,onSelectFile:l,multiple:d}=n,f=t.useRef(null),p=async e=>{const t=Array.from(e.target.files||[]);t.length&&setTimeout((()=>{l(t)}),100)},h=()=>f?.current?.click();return e.jsxs(yZ,{id:exports.TestHelper.generateId(o),children:[s.map(((t,n)=>t.status===exports.EImageStatus.NONE?e.jsx(SZ,{children:[...Array(4)].map(((t,n)=>e.jsx(EZ,{},`dot-${n}`)))},n):t.status>exports.EImageStatus.NONE||t.status===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsx(_Z,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),src:t.thumbnailDataURL||t.dataURL||"https://assets.life.gov.sg/web-frontend-engine/img/icons/photo-placeholder-add.svg",type:"button","aria-label":`thumbnail of ${t.name}`,onClick:()=>c(n),children:e.jsx(AZ,{isSelected:i===n})},n):"reviewModal"===t.addedFrom||t.status<exports.EImageStatus.NONE?e.jsxs(_Z,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),type:"button","aria-label":`error with ${t.name}`,onClick:()=>c(n),error:!0,children:[e.jsx(AZ,{isSelected:i===n}),e.jsx(vZ,{})]},n):void 0)),(s.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED||"reviewModal"===t)).length<u||!u)&&e.jsxs(e.Fragment,{children:[e.jsx(xZ,{id:exports.TestHelper.generateId(o,"file-input"),"data-testid":exports.TestHelper.generateId(o,"file-input"),type:"file","aria-hidden":"true",tabIndex:-1,capture:a,ref:f,accept:r.map((e=>`.${e}`)).join(", "),onChange:p,multiple:d,value:""}),e.jsx(wZ,{type:"button",id:exports.TestHelper.generateId(o,"add-image-button"),"data-testid":exports.TestHelper.generateId(o,"add-image-button"),"aria-label":"add image",styleType:"secondary",onClick:h,children:e.jsx(k.PlusIcon,{})})]})]})},MZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.21340464.js")})))),OZ=[{color:"#282828",label:"black"},{color:"#FFF",colorScheme:"light",label:"white"},{color:"#017cd3",label:"blue"},{color:"#fb0101",label:"red"},{color:"#22910c",label:"green"},{color:"#f8e821",label:"yellow"}],CZ=n=>{const{accepts:r,capture:i,className:a,compress:s,dimensions:u,id:c="image-review",maxFiles:l,maxSizeInKb:d,onExit:f,outputType:p,show:h,multiple:m,maxFilesErrorMessage:g,imageReviewModalStyles:y}=n,{images:_,setImages:v}=t.useContext(Pz),{dispatchFieldEvent:b,addFieldEventListener:E,removeFieldEventListener:S}=gI(),A=Ik(h),[x,w]=t.useState(_.length-1),[T,M]=t.useState(!1),[C,N]=t.useState(),D=!!_?.find((({status:e})=>e===exports.EImageStatus.NONE)),[L,I]=t.useState(OZ[0].color),[k,$]=t.useState(!1),R=t.useRef(null),F=!!_?.find((({addedFrom:e,status:t})=>"reviewModal"===e&&t<=exports.EImageStatus.NONE))||!_.length,z=t.useCallback((e=>{e.detail.removePendingImages&&v((e=>e.filter((({status:e})=>e===exports.EImageStatus.UPLOADED||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)))),f()}),[f,v]),P=e=>{!l||e.length+_.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||"reviewModal"===t)).length<=l?e.forEach((e=>{v((t=>{const n=Zz.findAvailableSlot(t);return[...t,{id:um(),file:e,name:e.name,dimensions:u,status:exports.EImageStatus.NONE,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))})):v((t=>{const n=Zz.findAvailableSlot(t);return[...t,{id:um(),file:e[0],name:e[0].name,dimensions:u,status:exports.EImageStatus.ERROR_EXCEED,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))},j=e=>{e&&(v((e=>e.map(((e,t)=>({...e,...t===x?{status:exports.EImageStatus.TO_DELETE}:{}}))))),w(Math.max(0,x-1))),N(null)},Z=t.useCallback((()=>{v((e=>e.filter((({status:e})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)).map((e=>{const t={...e};return e.drawingDataURL&&(t.dataURL=e.drawingDataURL),e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE&&(t.status=exports.EImageStatus.UPLOAD_READY),t.drawingDataURL=void 0,t.drawing=void 0,t}))))}),[v]),U=()=>{!b("save-review-images",c,{images:_,retry:U})||(Z(),f())},B=()=>{M(!0),I(OZ[0].color)},V=async()=>{const{dataURL:e,drawing:t}=R.current?.export()||{},n=await exports.ImageHelper.dataUrlToImage(e),r=await exports.ImageHelper.resampleImage(n,{scale:96/n.width,type:exports.FileHelper.fileExtensionToMimeType(p)}),i=await exports.FileHelper.fileToDataUrl(r);v((n=>{const r=[...n];return r[x]={...r[x],thumbnailDataURL:i,drawingDataURL:e,drawing:t,status:s?exports.EImageStatus.TO_RECOMPRESS:exports.EImageStatus.EDITED},r})),M(!1),G()},H=()=>{G(),$(!0)},G=()=>{I(""),$(!1)};t.useEffect((()=>{const e={"trigger-save-review-images":Z,"dismiss-review-modal":z};return Object.entries(e).forEach((([e,t])=>{E(e,c,t)})),()=>{Object.entries(e).forEach((([e,t])=>{S(e,c,t)}))}}),[E,z,Z,c,S]),t.useEffect((()=>{w(_.length-1)}),[_.length]),t.useEffect((()=>{h?b("show-review-modal",c):A&&b("hide-review-modal",c)}),[h]);return e.jsx(o.Modal,{id:exports.TestHelper.generateId(c,void 0,h?"show":"hide"),className:a?`${a}-review`:void 0,show:h,children:e.jsx(Kj,{className:a?`${a}-review-modal-box`:void 0,imageReviewModalStyles:y,showCloseButton:!1,children:h?e.jsxs(e.Fragment,{children:[e.jsx(Jj,{className:a?`${a}-header`:void 0,$drawActive:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(tZ,{id:exports.TestHelper.generateId(c,"clear-drawing-button"),"data-testid":exports.TestHelper.generateId(c,"clear-drawing-button"),onClick:()=>N("clear-drawing"),children:"Clear"}),e.jsx(tZ,{id:exports.TestHelper.generateId(c,"save-drawing"),"data-testid":exports.TestHelper.generateId(c,"save-drawing"),onClick:V,children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Xj,{id:exports.TestHelper.generateId(c,"close-button"),"data-testid":exports.TestHelper.generateId(c,"close-button"),"aria-label":"exit review modal",onClick:()=>N("exit"),children:e.jsx(O.CrossIcon,{type:"cross"})}),e.jsx(Qj,{weight:"semibold",children:"Review photos"})]})}),e.jsxs(nZ,{children:[_.length>0&&e.jsx(cZ,{className:a?`${a}-editor`:void 0,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(MZ,{baseImageDataURL:_[x]?.dataURL,drawing:_[x]?.drawing,color:T?L:void 0,erase:!!T&&k,ref:R,maxSizeInKb:d})})}),_.length>0&&e.jsx(rZ,{children:"Loading Preview..."}),!T&&_[x]?.status>=exports.EImageStatus.NONE&&e.jsxs(iZ,{children:[e.jsxs(aZ,{id:exports.TestHelper.generateId(c,"draw-button"),"data-testid":exports.TestHelper.generateId(c,"draw-button"),onClick:B,disabled:D,children:[e.jsx(sZ,{$disabled:D}),e.jsx(oZ,{weight:"semibold",$disabled:D,children:"Draw"})]}),e.jsxs(aZ,{id:exports.TestHelper.generateId(c,"delete-button"),"data-testid":exports.TestHelper.generateId(c,"delete-button"),onClick:()=>N("delete"),disabled:D,children:[e.jsx(uZ,{$disabled:D}),e.jsx(oZ,{weight:"semibold",$disabled:D,children:"Delete"})]})]}),_[x]?.status<exports.EImageStatus.NONE&&e.jsx(Wj,{id:`${c}-photo-error`,image:_[x],accepts:r,maxSizeInKb:d,onClickOk:()=>j(!0),maxFilesErrorMessage:g,maxFiles:l})]}),e.jsx(lZ,{className:a?`${a}-footer`:void 0,children:T?e.jsxs(e.Fragment,{children:[e.jsx(fZ,{id:exports.TestHelper.generateId(c,"eraser-button"),"data-testid":exports.TestHelper.generateId(c,"eraser-button"),"aria-label":"eraser",onClick:H,children:e.jsx(pZ,{$eraseMode:k})}),e.jsx(mZ,{children:OZ.map((({color:t,colorScheme:n,label:r},i)=>e.jsx(gZ,{id:exports.TestHelper.generateId(c,`palette-color-${i}`),"aria-label":`${r} brush`,$color:t,$colorScheme:n,onClick:()=>(e=>{G(),I(e)})(t),children:L===t&&e.jsx(hZ,{$colorScheme:n})},t)))})]}):e.jsxs(e.Fragment,{children:[e.jsx(TZ,{id:`${c}-image-thumbnails`,activeFileIndex:x,accepts:r,capture:i,maxFiles:l,images:_,onClickThumbnail:w,onSelectFile:P,multiple:m}),e.jsx(dZ,{id:exports.TestHelper.generateId(c,"save-button"),"data-testid":exports.TestHelper.generateId(c,"save-button"),onClick:U,disabled:F,children:"Save"})]})}),e.jsx(qj,{images:_,show:C,onDecideClearDrawing:e=>{e&&R.current.clearDrawing(),N(null)},onDecideDelete:j,onDecideExit:e=>{e&&(v(_.filter((({addedFrom:e,status:t})=>t>=exports.EImageStatus.UPLOADED||t<exports.EImageStatus.NONE&&"dragInput"===e)).map((e=>({...e,drawingDataURL:void 0,drawing:void 0})))),f()),N(null)}})]}):e.jsx(e.Fragment,{})})})},NZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.516d4b9b.js")})))),DZ=n=>{const{schema:{buttonLabel:r,capture:i,className:a,compress:o,crop:s,description:u,dimensions:c={width:1e3,height:1e3},editImage:l,label:d,outputType:f="jpg",uploadOnAddingFile:p,validation:h,multiple:m,imageReviewModalStyles:g},id:y,isDirty:_,isTouched:v,value:b,warning:E,...S}=n,{images:A,setImages:x,currentFileIds:w}=t.useContext(Pz),T=Ik(A),[M,O]=t.useState([...Uz]),[C,N]=t.useState(0),[D,L]=t.useState(0),[I,k]=t.useState(!1),[$,R]=t.useState(!1),{setFieldValidationConfig:F}=Nk(),{dispatchFieldEvent:z}=gI(),P=$k();t.useEffect((()=>{z("mount",y)}),[z,y]),t.useEffect((()=>{if(!_&&!v){const e=Array.isArray(b)?b:[];if(!(Lz(e.map((({fileId:e})=>e)),w).length>0))return;const t=[];e.forEach((({fileId:e,fileName:n,dataURL:r,uploadResponse:i},a)=>{const o={id:e||um(),file:{},name:n,dimensions:{width:10,height:10},dataURL:r,status:exports.EImageStatus.INJECTED,addedFrom:"schema",uploadProgress:100,slot:a,uploadResponse:i};t.push(o)})),x(t)}}),[_,v,w,x,b]),t.useEffect((()=>{const e=h?.find((e=>"required"in e)),t=h?.find((e=>"fileType"in e)),n=h?.find((e=>"maxSizeInKb"in e));t?.fileType&&t?.fileType!==M&&O(t?.fileType),n?.maxSizeInKb&&n?.maxSizeInKb!==D&&L(n?.maxSizeInKb);const r=h?.find((e=>"length"in e)),i=h?.find((e=>"max"in e));let a;r?a={maxFiles:r.length,errorMessage:r.errorMessage}:i&&(a={maxFiles:i.max,errorMessage:i.errorMessage}),a?.maxFiles&&C!==a.maxFiles&&N(a.maxFiles),F(y,tT().of(Qw().shape({fileName:zx(),dataURL:zx()})).test("is-empty-array",e?.errorMessage||om.UPLOAD("photo").REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",n?.errorMessage||om.UPLOAD("photo").MAX_FILE_SIZE(n?.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&n?.maxSizeInKb)||e.every((e=>exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*n?.maxSizeInKb)))),h)}),[h]),t.useEffect((()=>{A.some((e=>e.status===exports.EImageStatus.NONE))||(A.some(((e,t)=>{const n=T?.[t];if(e.status!==n?.status||e.dataURL!==n.dataURL)switch(e.status){case exports.EImageStatus.COMPRESSED:case exports.EImageStatus.CONVERTED:if(l&&!$)return P()?R(!0):k(!0),!0}})),0===A.length&&R(!1))}),[A.map((e=>e.status)).join(","),A.map((e=>e.dataURL)).join(",")]);const j=(e=!1)=>{e?l&&(document.body.classList.remove("lifesg-ds-overlay-open"),R(!0)):x((e=>e.map((e=>e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE?{...e,status:exports.EImageStatus.UPLOAD_READY}:e)))),k(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(NZ,{accepts:M,compress:!!o,crop:!!s,dimensions:c,editImage:l,id:y,maxSizeInKb:D,outputType:f,upload:p,filenameMatches:h?.find((e=>"matches"in e))?.matches,filenameMatchesErrorMessage:h?.find((e=>"matches"in e))?.errorMessage,value:b})}),e.jsx(jj,{id:y,capture:i,className:a,label:d,description:u,buttonLabel:r,accepts:M,maxFiles:C,maxSizeInKb:D,dimensions:c,errorMessage:S.error?.message,validation:h,multiple:m,warning:E}),e.jsx(_T,{id:`${y}-review-prompt`,title:"Review photos?",size:"large",show:I,description:"This lets you check if you've selected the correct photos, and draw on them to highlight the issue.",buttons:[{id:"ok",title:"Ok",onClick:()=>j(!0)},{id:"skip",title:"Skip",buttonStyle:"secondary",onClick:()=>j()}]}),(()=>{const t=h?.find((e=>"max"in e));return e.jsx(CZ,{accepts:M,dimensions:c,id:y,className:a,maxFiles:C,maxFilesErrorMessage:t?.errorMessage,maxSizeInKb:D,onExit:()=>R(!1),outputType:f,show:$,multiple:m,capture:i,imageReviewModalStyles:g})})()]})},LZ=i.css`
|
|
988
|
+
`,TZ=n=>{const{accepts:r,activeFileIndex:i,capture:a,id:o="image-thumbnails",images:s,maxFiles:u,onClickThumbnail:c,onSelectFile:l,multiple:d}=n,f=t.useRef(null),p=async e=>{const t=Array.from(e.target.files||[]);t.length&&setTimeout((()=>{l(t)}),100)},h=()=>f?.current?.click();return e.jsxs(yZ,{id:exports.TestHelper.generateId(o),children:[s.map(((t,n)=>t.status===exports.EImageStatus.NONE?e.jsx(SZ,{children:[...Array(4)].map(((t,n)=>e.jsx(EZ,{},`dot-${n}`)))},n):t.status>exports.EImageStatus.NONE||t.status===exports.EImageStatus.ERROR_CUSTOM_MUTED?e.jsx(_Z,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),src:t.thumbnailDataURL||t.dataURL||"https://assets.life.gov.sg/web-frontend-engine/img/icons/photo-placeholder-add.svg",type:"button","aria-label":`thumbnail of ${t.name}`,onClick:()=>c(n),children:e.jsx(AZ,{isSelected:i===n})},n):"reviewModal"===t.addedFrom||t.status<exports.EImageStatus.NONE?e.jsxs(_Z,{id:exports.TestHelper.generateId(o,`item-${n+1}`),"data-testid":exports.TestHelper.generateId(o,`item-${n+1}`),type:"button","aria-label":`error with ${t.name}`,onClick:()=>c(n),error:!0,children:[e.jsx(AZ,{isSelected:i===n}),e.jsx(vZ,{})]},n):void 0)),(s.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED||"reviewModal"===t)).length<u||!u)&&e.jsxs(e.Fragment,{children:[e.jsx(xZ,{id:exports.TestHelper.generateId(o,"file-input"),"data-testid":exports.TestHelper.generateId(o,"file-input"),type:"file","aria-hidden":"true",tabIndex:-1,capture:a,ref:f,accept:r.map((e=>`.${e}`)).join(", "),onChange:p,multiple:d,value:""}),e.jsx(wZ,{type:"button",id:exports.TestHelper.generateId(o,"add-image-button"),"data-testid":exports.TestHelper.generateId(o,"add-image-button"),"aria-label":"add image",styleType:"secondary",onClick:h,children:e.jsx(k.PlusIcon,{})})]})]})},MZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.51cff881.js")})))),OZ=[{color:"#282828",label:"black"},{color:"#FFF",colorScheme:"light",label:"white"},{color:"#017cd3",label:"blue"},{color:"#fb0101",label:"red"},{color:"#22910c",label:"green"},{color:"#f8e821",label:"yellow"}],CZ=n=>{const{accepts:r,capture:i,className:a,compress:s,dimensions:u,id:c="image-review",maxFiles:l,maxSizeInKb:d,onExit:f,outputType:p,show:h,multiple:m,maxFilesErrorMessage:g,imageReviewModalStyles:y}=n,{images:_,setImages:v}=t.useContext(Pz),{dispatchFieldEvent:b,addFieldEventListener:E,removeFieldEventListener:S}=gI(),A=Ik(h),[x,w]=t.useState(_.length-1),[T,M]=t.useState(!1),[C,N]=t.useState(),D=!!_?.find((({status:e})=>e===exports.EImageStatus.NONE)),[L,I]=t.useState(OZ[0].color),[k,$]=t.useState(!1),R=t.useRef(null),F=!!_?.find((({addedFrom:e,status:t})=>"reviewModal"===e&&t<=exports.EImageStatus.NONE))||!_.length,z=t.useCallback((e=>{e.detail.removePendingImages&&v((e=>e.filter((({status:e})=>e===exports.EImageStatus.UPLOADED||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)))),f()}),[f,v]),P=e=>{!l||e.length+_.filter((({status:e,addedFrom:t})=>e>=exports.EImageStatus.NONE||"reviewModal"===t)).length<=l?e.forEach((e=>{v((t=>{const n=Zz.findAvailableSlot(t);return[...t,{id:um(),file:e,name:e.name,dimensions:u,status:exports.EImageStatus.NONE,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))})):v((t=>{const n=Zz.findAvailableSlot(t);return[...t,{id:um(),file:e[0],name:e[0].name,dimensions:u,status:exports.EImageStatus.ERROR_EXCEED,uploadProgress:0,addedFrom:"reviewModal",slot:n}]}))},j=e=>{e&&(v((e=>e.map(((e,t)=>({...e,...t===x?{status:exports.EImageStatus.TO_DELETE}:{}}))))),w(Math.max(0,x-1))),N(null)},Z=t.useCallback((()=>{v((e=>e.filter((({status:e})=>e>=exports.EImageStatus.NONE||e===exports.EImageStatus.ERROR_CUSTOM_MUTED)).map((e=>{const t={...e};return e.drawingDataURL&&(t.dataURL=e.drawingDataURL),e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE&&(t.status=exports.EImageStatus.UPLOAD_READY),t.drawingDataURL=void 0,t.drawing=void 0,t}))))}),[v]),U=()=>{!b("save-review-images",c,{images:_,retry:U})||(Z(),f())},B=()=>{M(!0),I(OZ[0].color)},V=async()=>{const{dataURL:e,drawing:t}=R.current?.export()||{},n=await exports.ImageHelper.dataUrlToImage(e),r=await exports.ImageHelper.resampleImage(n,{scale:96/n.width,type:exports.FileHelper.fileExtensionToMimeType(p)}),i=await exports.FileHelper.fileToDataUrl(r);v((n=>{const r=[...n];return r[x]={...r[x],thumbnailDataURL:i,drawingDataURL:e,drawing:t,status:s?exports.EImageStatus.TO_RECOMPRESS:exports.EImageStatus.EDITED},r})),M(!1),G()},H=()=>{G(),$(!0)},G=()=>{I(""),$(!1)};t.useEffect((()=>{const e={"trigger-save-review-images":Z,"dismiss-review-modal":z};return Object.entries(e).forEach((([e,t])=>{E(e,c,t)})),()=>{Object.entries(e).forEach((([e,t])=>{S(e,c,t)}))}}),[E,z,Z,c,S]),t.useEffect((()=>{w(_.length-1)}),[_.length]),t.useEffect((()=>{h?b("show-review-modal",c):A&&b("hide-review-modal",c)}),[h]);return e.jsx(o.Modal,{id:exports.TestHelper.generateId(c,void 0,h?"show":"hide"),className:a?`${a}-review`:void 0,show:h,children:e.jsx(Kj,{className:a?`${a}-review-modal-box`:void 0,imageReviewModalStyles:y,showCloseButton:!1,children:h?e.jsxs(e.Fragment,{children:[e.jsx(Jj,{className:a?`${a}-header`:void 0,$drawActive:T,children:T?e.jsxs(e.Fragment,{children:[e.jsx(tZ,{id:exports.TestHelper.generateId(c,"clear-drawing-button"),"data-testid":exports.TestHelper.generateId(c,"clear-drawing-button"),onClick:()=>N("clear-drawing"),children:"Clear"}),e.jsx(tZ,{id:exports.TestHelper.generateId(c,"save-drawing"),"data-testid":exports.TestHelper.generateId(c,"save-drawing"),onClick:V,children:"Save"})]}):e.jsxs(e.Fragment,{children:[e.jsx(Xj,{id:exports.TestHelper.generateId(c,"close-button"),"data-testid":exports.TestHelper.generateId(c,"close-button"),"aria-label":"exit review modal",onClick:()=>N("exit"),children:e.jsx(O.CrossIcon,{type:"cross"})}),e.jsx(Qj,{weight:"semibold",children:"Review photos"})]})}),e.jsxs(nZ,{children:[_.length>0&&e.jsx(cZ,{className:a?`${a}-editor`:void 0,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(MZ,{baseImageDataURL:_[x]?.dataURL,drawing:_[x]?.drawing,color:T?L:void 0,erase:!!T&&k,ref:R,maxSizeInKb:d})})}),_.length>0&&e.jsx(rZ,{children:"Loading Preview..."}),!T&&_[x]?.status>=exports.EImageStatus.NONE&&e.jsxs(iZ,{children:[e.jsxs(aZ,{id:exports.TestHelper.generateId(c,"draw-button"),"data-testid":exports.TestHelper.generateId(c,"draw-button"),onClick:B,disabled:D,children:[e.jsx(sZ,{$disabled:D}),e.jsx(oZ,{weight:"semibold",$disabled:D,children:"Draw"})]}),e.jsxs(aZ,{id:exports.TestHelper.generateId(c,"delete-button"),"data-testid":exports.TestHelper.generateId(c,"delete-button"),onClick:()=>N("delete"),disabled:D,children:[e.jsx(uZ,{$disabled:D}),e.jsx(oZ,{weight:"semibold",$disabled:D,children:"Delete"})]})]}),_[x]?.status<exports.EImageStatus.NONE&&e.jsx(Wj,{id:`${c}-photo-error`,image:_[x],accepts:r,maxSizeInKb:d,onClickOk:()=>j(!0),maxFilesErrorMessage:g,maxFiles:l})]}),e.jsx(lZ,{className:a?`${a}-footer`:void 0,children:T?e.jsxs(e.Fragment,{children:[e.jsx(fZ,{id:exports.TestHelper.generateId(c,"eraser-button"),"data-testid":exports.TestHelper.generateId(c,"eraser-button"),"aria-label":"eraser",onClick:H,children:e.jsx(pZ,{$eraseMode:k})}),e.jsx(mZ,{children:OZ.map((({color:t,colorScheme:n,label:r},i)=>e.jsx(gZ,{id:exports.TestHelper.generateId(c,`palette-color-${i}`),"aria-label":`${r} brush`,$color:t,$colorScheme:n,onClick:()=>(e=>{G(),I(e)})(t),children:L===t&&e.jsx(hZ,{$colorScheme:n})},t)))})]}):e.jsxs(e.Fragment,{children:[e.jsx(TZ,{id:`${c}-image-thumbnails`,activeFileIndex:x,accepts:r,capture:i,maxFiles:l,images:_,onClickThumbnail:w,onSelectFile:P,multiple:m}),e.jsx(dZ,{id:exports.TestHelper.generateId(c,"save-button"),"data-testid":exports.TestHelper.generateId(c,"save-button"),onClick:U,disabled:F,children:"Save"})]})}),e.jsx(qj,{images:_,show:C,onDecideClearDrawing:e=>{e&&R.current.clearDrawing(),N(null)},onDecideDelete:j,onDecideExit:e=>{e&&(v(_.filter((({addedFrom:e,status:t})=>t>=exports.EImageStatus.UPLOADED||t<exports.EImageStatus.NONE&&"dragInput"===e)).map((e=>({...e,drawingDataURL:void 0,drawing:void 0})))),f()),N(null)}})]}):e.jsx(e.Fragment,{})})})},NZ=t.lazy((()=>Promise.resolve().then((function(){return require("./index.8d9d1609.js")})))),DZ=n=>{const{schema:{buttonLabel:r,capture:i,className:a,compress:o,crop:s,description:u,dimensions:c={width:1e3,height:1e3},editImage:l,label:d,outputType:f="jpg",uploadOnAddingFile:p,validation:h,multiple:m,imageReviewModalStyles:g},id:y,isDirty:_,isTouched:v,value:b,warning:E,...S}=n,{images:A,setImages:x,currentFileIds:w}=t.useContext(Pz),T=Ik(A),[M,O]=t.useState([...Uz]),[C,N]=t.useState(0),[D,L]=t.useState(0),[I,k]=t.useState(!1),[$,R]=t.useState(!1),{setFieldValidationConfig:F}=Nk(),{dispatchFieldEvent:z}=gI(),P=$k();t.useEffect((()=>{z("mount",y)}),[z,y]),t.useEffect((()=>{if(!_&&!v){const e=Array.isArray(b)?b:[];if(!(Lz(e.map((({fileId:e})=>e)),w).length>0))return;const t=[];e.forEach((({fileId:e,fileName:n,dataURL:r,uploadResponse:i},a)=>{const o={id:e||um(),file:{},name:n,dimensions:{width:10,height:10},dataURL:r,status:exports.EImageStatus.INJECTED,addedFrom:"schema",uploadProgress:100,slot:a,uploadResponse:i};t.push(o)})),x(t)}}),[_,v,w,x,b]),t.useEffect((()=>{const e=h?.find((e=>"required"in e)),t=h?.find((e=>"fileType"in e)),n=h?.find((e=>"maxSizeInKb"in e));t?.fileType&&t?.fileType!==M&&O(t?.fileType),n?.maxSizeInKb&&n?.maxSizeInKb!==D&&L(n?.maxSizeInKb);const r=h?.find((e=>"length"in e)),i=h?.find((e=>"max"in e));let a;r?a={maxFiles:r.length,errorMessage:r.errorMessage}:i&&(a={maxFiles:i.max,errorMessage:i.errorMessage}),a?.maxFiles&&C!==a.maxFiles&&N(a.maxFiles),F(y,tT().of(Qw().shape({fileName:zx(),dataURL:zx()})).test("is-empty-array",e?.errorMessage||om.UPLOAD("photo").REQUIRED,(t=>!t||!e?.required||t.length>0)).test("max-size-in-kb",n?.errorMessage||om.UPLOAD("photo").MAX_FILE_SIZE(n?.maxSizeInKb),(e=>!(e&&Array.isArray(e)&&n?.maxSizeInKb)||e.every((e=>exports.FileHelper.getFilesizeFromBase64(e.dataURL)<=1024*n?.maxSizeInKb)))),h)}),[h]),t.useEffect((()=>{A.some((e=>e.status===exports.EImageStatus.NONE))||(A.some(((e,t)=>{const n=T?.[t];if(e.status!==n?.status||e.dataURL!==n.dataURL)switch(e.status){case exports.EImageStatus.COMPRESSED:case exports.EImageStatus.CONVERTED:if(l&&!$)return P()?R(!0):k(!0),!0}})),0===A.length&&R(!1))}),[A.map((e=>e.status)).join(","),A.map((e=>e.dataURL)).join(",")]);const j=(e=!1)=>{e?l&&(document.body.classList.remove("lifesg-ds-overlay-open"),R(!0)):x((e=>e.map((e=>e.status<exports.EImageStatus.UPLOAD_READY&&e.status>exports.EImageStatus.NONE?{...e,status:exports.EImageStatus.UPLOAD_READY}:e)))),k(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(t.Suspense,{fallback:null,children:e.jsx(NZ,{accepts:M,compress:!!o,crop:!!s,dimensions:c,editImage:l,id:y,maxSizeInKb:D,outputType:f,upload:p,filenameMatches:h?.find((e=>"matches"in e))?.matches,filenameMatchesErrorMessage:h?.find((e=>"matches"in e))?.errorMessage,value:b})}),e.jsx(jj,{id:y,capture:i,className:a,label:d,description:u,buttonLabel:r,accepts:M,maxFiles:C,maxSizeInKb:D,dimensions:c,errorMessage:S.error?.message,validation:h,multiple:m,warning:E}),e.jsx(_T,{id:`${y}-review-prompt`,title:"Review photos?",size:"large",show:I,description:"This lets you check if you've selected the correct photos, and draw on them to highlight the issue.",buttons:[{id:"ok",title:"Ok",onClick:()=>j(!0)},{id:"skip",title:"Skip",buttonStyle:"secondary",onClick:()=>j()}]}),(()=>{const t=h?.find((e=>"max"in e));return e.jsx(CZ,{accepts:M,dimensions:c,id:y,className:a,maxFiles:C,maxFilesErrorMessage:t?.errorMessage,maxSizeInKb:D,onExit:()=>R(!1),outputType:f,show:$,multiple:m,capture:i,imageReviewModalStyles:g})})()]})},LZ=i.css`
|
|
988
989
|
border: ${n.Border["width-010"]} ${n.Border.solid} ${n.Colour["border-focus"]};
|
|
989
990
|
box-shadow: none;
|
|
990
991
|
`,IZ=i.css`
|
|
@@ -1063,45 +1064,45 @@ object-assign
|
|
|
1063
1064
|
${e=>i.css`
|
|
1064
1065
|
margin-left: ${e.$readOnly?n.Spacing["spacing-4"]:n.Spacing["spacing-12"]};
|
|
1065
1066
|
`}
|
|
1066
|
-
`,zZ=t=>{const{id:n,"data-testid":r,className:i,disabled:a,readOnly:o,onFocus:s,value:u,placeholder:c,error:l}=t;return e.jsxs($Z,{id:n,"data-testid":r,type:"button",className:i,disabled:a,$readOnly:o,$error:l,onFocus:s,onClick:e=>{a||e.currentTarget.focus()},tabIndex:a?-1:0,"aria-disabled":a||void 0,"aria-haspopup":"dialog","aria-readonly":o,children:[c&&!u?e.jsx(RZ,{$placeholder:!0,$disabled:a,children:c}):e.jsx(RZ,{$disabled:a,children:u}),e.jsx(FZ,{$disabled:a,$readOnly:o,"aria-hidden":"true",children:e.jsx(R.PinFillIcon,{})})]})},PZ=t=>{const{id:n,label:r,className:i,locationInputPlaceholder:a="",onFocus:o,value:s,errorMessage:u,disabled:c,readOnly:l}=t;return e.jsx(x.Form.CustomField,{id:exports.TestHelper.generateId(n,"location-input"),"data-testid":exports.TestHelper.generateId(n,"location-input"),label:r,errorMessage:u,children:e.jsx(zZ,{id:exports.TestHelper.generateId(n,"location-input-base"),"data-testid":exports.TestHelper.generateId(n,"location-input-base"),disabled:c,readOnly:l,placeholder:a,onFocus:o,value:s,error:!!u,className:i})})},jZ=t.lazy((()=>Promise.resolve().then((function(){return require("./location-modal.
|
|
1067
|
+
`,zZ=t=>{const{id:n,"data-testid":r,className:i,disabled:a,readOnly:o,onFocus:s,value:u,placeholder:c,error:l}=t;return e.jsxs($Z,{id:n,"data-testid":r,type:"button",className:i,disabled:a,$readOnly:o,$error:l,onFocus:s,onClick:e=>{a||e.currentTarget.focus()},tabIndex:a?-1:0,"aria-disabled":a||void 0,"aria-haspopup":"dialog","aria-readonly":o,children:[c&&!u?e.jsx(RZ,{$placeholder:!0,$disabled:a,children:c}):e.jsx(RZ,{$disabled:a,children:u}),e.jsx(FZ,{$disabled:a,$readOnly:o,"aria-hidden":"true",children:e.jsx(R.PinFillIcon,{})})]})},PZ=t=>{const{id:n,label:r,className:i,locationInputPlaceholder:a="",onFocus:o,value:s,errorMessage:u,disabled:c,readOnly:l}=t;return e.jsx(x.Form.CustomField,{id:exports.TestHelper.generateId(n,"location-input"),"data-testid":exports.TestHelper.generateId(n,"location-input"),label:r,errorMessage:u,children:e.jsx(zZ,{id:exports.TestHelper.generateId(n,"location-input-base"),"data-testid":exports.TestHelper.generateId(n,"location-input-base"),disabled:c,readOnly:l,placeholder:a,onFocus:o,value:s,error:!!u,className:i})})},jZ=t.lazy((()=>Promise.resolve().then((function(){return require("./location-modal.ca4904e4.js")}))));class ZZ extends Error{code;message;constructor(e){super(),Object.assign(this,e)}}var UZ;!function(e){e.IS_EMAIL_VALID="is-email-valid",e.IS_PHONE_NUMBER_VALID="is-phone-number-valid",e.SEND_OTP_FAILED="send-otp-failed",e.OTP_VERIFICATION_FAILED="otp-verification-failed",e.IS_OTP_VERIFIED="is-otp-verified",e.API_ERROR="api"}(UZ||(UZ={}));const BZ=V.default(r.Typography.BodyMD)`
|
|
1067
1068
|
cursor: ${e=>e.disabled?"not-allowed":"pointer"};
|
|
1068
|
-
`,
|
|
1069
|
+
`,VZ=V.default(z.RadioButton)`
|
|
1069
1070
|
margin-right: ${n.Spacing["spacing-4"]};
|
|
1070
1071
|
flex-shrink: 0;
|
|
1071
|
-
`,
|
|
1072
|
+
`,HZ=V.default(F.ImageButton)`
|
|
1072
1073
|
flex: 1;
|
|
1073
1074
|
img {
|
|
1074
1075
|
min-width: 3.5rem;
|
|
1075
1076
|
}
|
|
1076
|
-
`,
|
|
1077
|
+
`,GZ=V.default.div`
|
|
1077
1078
|
display: flex;
|
|
1078
1079
|
align-items: center;
|
|
1079
1080
|
&:not(:last-of-type) {
|
|
1080
1081
|
margin-bottom: ${n.Spacing["spacing-16"]};
|
|
1081
1082
|
}
|
|
1082
|
-
`,
|
|
1083
|
+
`,YZ=V.default.div`
|
|
1083
1084
|
display: flex;
|
|
1084
1085
|
flex-wrap: wrap;
|
|
1085
1086
|
gap: ${n.Spacing["spacing-16"]};
|
|
1086
|
-
`,
|
|
1087
|
+
`,WZ=V.default.div`
|
|
1087
1088
|
display: flex;
|
|
1088
1089
|
flex-direction: ${e=>"vertical"===e.$layoutType?"column":"row"};
|
|
1089
1090
|
flex-wrap: wrap;
|
|
1090
1091
|
gap: ${n.Spacing["spacing-16"]};
|
|
1091
|
-
`,
|
|
1092
|
+
`,qZ=V.default(T.Toggle)`
|
|
1092
1093
|
[data-id="toggle-composite-children"] {
|
|
1093
1094
|
margin: 0;
|
|
1094
1095
|
padding: 0;
|
|
1095
1096
|
}
|
|
1096
|
-
`,
|
|
1097
|
+
`,KZ=V.default.div`
|
|
1097
1098
|
display: flex;
|
|
1098
1099
|
flex-wrap: wrap;
|
|
1099
1100
|
gap: ${n.Spacing["spacing-16"]};
|
|
1100
|
-
`,
|
|
1101
|
+
`,JZ=V.default.div`
|
|
1101
1102
|
${({$color:e})=>e&&`color: ${e};`}
|
|
1102
|
-
`;var JZ;exports.EFieldType=void 0,(JZ=exports.EFieldType||(exports.EFieldType={})).BUTTON="ButtonField",JZ.CHECKBOX="CheckboxGroup",JZ.CHIPS="Chips",JZ["CONTACT-FIELD"]="ContactField",JZ["DATE-FIELD"]="DateField",JZ["DATE-RANGE-FIELD"]="DateRangeField",JZ["EMAIL-FIELD"]="TextField",JZ["E-SIGNATURE-FIELD"]="ESignatureField",JZ["ERROR-FIELD"]="ErrorField",JZ["FILE-UPLOAD"]="FileUpload",JZ["HIDDEN-FIELD"]="HiddenField",JZ["HISTOGRAM-SLIDER"]="HistogramSlider",JZ["IMAGE-UPLOAD"]="ImageUpload",JZ["LOCATION-FIELD"]="LocationField",JZ["MASKED-FIELD"]="MaskedField",JZ["MULTI-SELECT"]="MultiSelect",JZ["NESTED-MULTI-SELECT"]="NestedMultiSelect",JZ["RANGE-SELECT"]="RangeSelect",JZ["NUMERIC-FIELD"]="TextField",JZ.RADIO="RadioButtonGroup",JZ.RESET="ResetButton",JZ.SELECT="Select",JZ["SELECT-HISTOGRAM"]="SelectHistogram",JZ.SLIDER="Slider",JZ.SUBMIT="SubmitButton",JZ.SWITCH="Switch",JZ.TEXTAREA="Textarea",JZ["TEXT-FIELD"]="TextField",JZ["TIME-FIELD"]="TimeField",JZ["UNIT-NUMBER-FIELD"]="UnitNumberField";var XZ=Object.freeze({__proto__:null,ButtonField:t=>{const{schema:{label:n,uiType:r,startIcon:i,endIcon:a,href:o,target:s,...u},id:c,...l}=t,{dispatchFieldEvent:d}=gI(),f=t=>{if(!t)return null;const n=H[t];return e.jsx(n,{})};return e.jsxs(h$,{type:"button",...u,...l,onClick:e=>{d("click",c,e),o&&(e=>{try{return!!new URL(e)}catch{return!1}})(o)&&(s?window.open(o,s,"noopener noreferrer"):window.location.href=o)},children:[f(i),n,f(a)]})},CheckboxGroup:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||[]),{setFieldValidationConfig:v}=Nk();t.useEffect((()=>{const e=f?.find((e=>"required"in e));v(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),f)}),[f]),ys((()=>{const e=h?.filter((e=>d.find((t=>t.value===e))));g(a,e)}),[d]),t.useEffect((()=>{_(h||[])}),[h]);const b=(e,t)=>{const n=d.find((e=>!0===e.none));let r=[...y];t?r=r.includes(e)?[]:[e]:r.includes(e)?r=k$(r,e,n?.value):(r.push(e),r=k$(r,n?.value)),o({target:{value:r}})},E=e=>y.includes(e),S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(rU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:r,errorMessage:i?.message,children:"toggle"===u?.styleType?d.length>0&&"toggle"===u.styleType&&e.jsx(z$,{$layoutType:u?.layoutType??"horizontal",className:s?`${s}-checkbox-container`:void 0,children:d.map(((t,n)=>{const r=S();return e.jsx(P$,{type:"checkbox","data-testid":exports.TestHelper.generateId(a,"toggle"),id:r,className:s,disabled:c??t.disabled,name:r,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(t.value),onChange:()=>b(t.value,t.none),error:!!i?.message,compositeSection:t.children?{children:e.jsx(rU,{children:t.children}),collapsible:!1}:null,subLabel:!!t.subLabel&&A(t.subLabel),children:A(t.label)},n)}))}):d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(F$,{className:s?`${s}-checkbox-container`:void 0,children:[e.jsx(R$,{...p,"data-testid":exports.TestHelper.generateId(a,"checkbox"),id:r,className:s,disabled:c??t.disabled,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx($$,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}),e.jsx(YL,{id:a,message:m})]})},Chips:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{disabled:s,label:u,options:c,textarea:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||[]),[_,v]=t.useState(!1),[b,E]=t.useState(!0),{setValue:S,unregister:A}=xe(),{setFieldValidationConfig:w,removeFieldValidationConfig:T}=Nk();t.useEffect((()=>{_||A(O())}),[]),t.useEffect((()=>{const e=d?.find((e=>"required"in e)),t=d?.find((e=>"max"in e)),n=d?.find((e=>"length"in e));w(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),d),1!==t?.max&&1!==n?.length||E(!1)}),[d]),ys((()=>{const e=[...c.map((e=>e.value)),l?.label],t=p?.filter((t=>e.includes(t)));S(a,t)}),[c]),t.useEffect((()=>{p?.includes(C())?N(!0):N(),y(p||[])}),[p]);const M=e=>g.includes(e),O=()=>`${a}-textarea`,C=()=>"string"==typeof l?.label?l?.label:l?.label?.mainLabel,N=(e=!1)=>{v(e),e||T(O())},D=e=>{let t=[...g];if(t.includes(e))return t=t.filter((t=>t!==e)),void o({target:{value:t}});b?t.push(e):t=[e],o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsxs(x.Form.CustomField,{label:i,errorMessage:r?.message,...m,children:[e.jsxs(Y$,{"data-testid":exports.TestHelper.generateId(a,"chips"),$showTextarea:_,children:[c.map(((e,n)=>t.createElement(uT,{...f,key:n,onClick:()=>D(e.value),isActive:M(e.value),disabled:s??e.disabled},e.label))),(()=>{if(!l?.label)return;const t=C();return e.jsx(uT,{...f,onClick:()=>{D(t)},isActive:M(t),children:t})})()]}),(()=>{if(!l?.label)return e.jsx(e.Fragment,{});const t=O(),n={uiType:"textarea",className:f.className?`${f.className}-textarea`:void 0,...l};return _?e.jsx(j$,{id:t,schema:n,Field:G$}):e.jsx(e.Fragment,{})})()]}),e.jsx(YL,{id:a,message:h})]})},ContactField:n=>{const{isDirty:r,formattedLabel:i,error:a,id:o,name:s,onChange:u,schema:{defaultCountry:c,disabled:l,enableSearch:d,label:f,placeholder:p,validation:h,...m},value:g,warning:y,..._}=n,{resetField:v}=xe(),[b,E]=t.useState(g||""),S=Ik(c),[A,w]=t.useState(c),[T]=t.useState((()=>{const e=new Map;return W$.forEach((t=>{const[n,...r]=t,i=r.find((e=>/^\d+$/.test(e)));e.set(n,i)})),e})()),[M,O]=t.useState(),[C,N]=t.useState(),[D,L]=t.useState(void 0),{setFieldValidationConfig:I}=Nk();t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber,r=e?.errorMessage;T.has(n)?(w(n),L(!0)):["default","house","mobile"].includes(t)?(w("Singapore"),L(!0)):L(!1),N(t),I(o,zx().test("singaporeNumber",r||om.CONTACT.INVALID_SINGAPORE_NUMBER,(e=>!e||!t||QF.isSingaporeNumber(e,t))).test("internationalNumber",r||om.CONTACT.INVALID_INTERNATIONAL_NUMBER,(e=>!(e&&!t&&n)||QF.isInternationalNumber(M?.name,e))),h)}),[h,M]),t.useEffect((()=>{const e=A||"Singapore";O({name:e,prefix:T.get(e)})}),[A,T]),t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber;!c||S===c||T.has(n)||["default","house","mobile"].includes(t)||w(c)}),[h,c]),t.useEffect((()=>{if(void 0!==D&&!r){const{prefix:e,number:t}=QF.getParsedPhoneNumber(g||""),n=e.replace(/\+/g,""),r=(e=>{for(const[t,,,n]of W$)if(t===e)return n})(A||"Singapore");if(!D||D&&n===r){const n=k({countryCode:e||r,number:t});v(o,{defaultValue:n,keepDirty:!0})}else{const e=k({countryCode:"",number:""});v(o,{defaultValue:e,keepDirty:!0})}}}),[g,r,D,A]);const k=e=>{const{countryCode:t,number:n}=e,r=t.replace(/\+/g,"");if(!1===D&&r!==M?.prefix){const e=((e,t)=>{for(const[n,r]of t.entries())if(r===e)return n})(r,T);e&&O({name:e,prefix:t})}return E(n),QF.formatPhoneNumber(e.countryCode,e.number)||""};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.PhoneNumberInput,{...m,..._,"data-testid":exports.TestHelper.generateId(o,"contact"),disabled:l,enableSearch:d,errorMessage:a?.message,fixedCountry:D,id:o,label:i,name:s,placeholder:(()=>{if(p)return p;if(C){return`Enter ${"mobile"===C?"mobile":"home"} number`}return"Enter contact number"})(),value:(()=>{if(!M)return;const{prefix:e}=M;return{number:b,countryCode:e}})(),onChange:e=>{const t=k(e);u({target:{value:t}})}}),e.jsx(YL,{id:o,message:y})]})},DateField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{label:u,useCurrentDate:c,dateFormat:l=ez,validation:d,...f},value:p,warning:h,...m}=n,{setValue:g}=xe(),[y,_]=t.useState(p||""),[v,b]=t.useState(),{setFieldValidationConfig:E}=Nk();t.useEffect((()=>{const e=d?.find((e=>"dateFormat"in e&&e.dateFormat)),t=d?.find((e=>"future"in e)),n=d?.find((e=>"past"in e)),r=d?.find((e=>"notFuture"in e)),i=d?.find((e=>"notPast"in e)),o=d?.find((e=>"minDate"in e)),s=d?.find((e=>"maxDate"in e)),u=d?.find((e=>"excludedDates"in e)),c=d?.find((e=>"withinDays"in e)),f=d?.find((e=>"beyondDays"in e)),p=sm.toLocalDateOrTime(o?.minDate,l,"date"),h=sm.toLocalDateOrTime(s?.maxDate,l,"date");E(a,zx().test("is-date",e?.errorMessage||om.DATE.INVALID,(e=>!e||""===e||!!w(e)&&!!sm.toLocalDateOrTime(e,l,"date"))).test("future",t?.errorMessage||om.DATE.MUST_BE_FUTURE,(e=>{if(!w(e)||!t?.future)return!0;const n=sm.toLocalDateOrTime(e,l,"date");return!!n?.isAfter(bf.now())})).test("past",n?.errorMessage||om.DATE.MUST_BE_PAST,(e=>{if(!w(e)||!n?.past)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!!t?.isBefore(bf.now())})).test("not-future",r?.errorMessage||om.DATE.CANNOT_BE_FUTURE,(e=>{if(!w(e)||!r?.notFuture)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(bf.now())})).test("not-past",i?.errorMessage||om.DATE.CANNOT_BE_PAST,(e=>{if(!w(e)||!i?.notPast)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(bf.now())})).test("min-date",o?.errorMessage||om.DATE.MIN_DATE(sm.formatDateTime(o?.minDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!p)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(p)})).test("max-date",s?.errorMessage||om.DATE.MAX_DATE(sm.formatDateTime(s?.maxDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!h)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(h)})).test("excluded-dates",u?.errorMessage||om.DATE.DISABLED_DATES,(e=>!w(e)||!u||!u.excludedDates.includes(e))).test("within-days",c?.errorMessage||c?.withinDays&&om.DATE.WITHIN_DAYS(c?.withinDays),(e=>!w(e)||!c||sm.checkWithinDays(e,{...c.withinDays,dateFormat:l}))).test("beyond-days",f?.errorMessage||f?.beyondDays&&om.DATE.BEYOND_DAYS(f?.beyondDays),(e=>!w(e)||!f||sm.checkBeyondDays(e,{...f.beyondDays,dateFormat:l}))),d);const m=c?.withinDays&&sm.calculateDisabledWithinDaysRange({...c.withinDays,dateFormat:l}),g=f?.beyondDays&&sm.calculateDisabledBeyondDaysRange({...f.beyondDays,dateFormat:l}),y=A([p,t?.future&&bf.now().plusDays(1),i?.notPast&&bf.now(),m?.startDate,g?.startDate]),_=S([h,n?.past&&bf.now().minusDays(1),r?.notFuture&&bf.now(),m?.endDate,g?.endDate]),v=[...u?.excludedDates||[]];(y||_||v)&&b((e=>({...e,minDate:y?.format(tz),maxDate:_?.format(tz),disabledDates:v})))}),[d]),t.useEffect((()=>{if(l)if(p)if(w(p)){const e=sm.toLocalDateOrTime(p,l,"date");_(sm.formatDateTime(e?.toString(),ez,"date",om.DATE.INVALID))}else _(om.DATE.INVALID);else if(!o)if(c){const e=sm.formatDateTime(bf.now().toString(),l,"date");g(a,e);const t=sm.formatDateTime(bf.now().toString(),ez,"date");_(t)}else _(void 0)}),[c,p,l,o]);const S=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],A=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],w=e=>e&&e!==om.DATE.INVALID;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateInput,{...f,...m,...v,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:e=>{s({target:{value:sm.formatDateTime(e,l,"date",om.DATE.INVALID)}})},value:y}),e.jsx(YL,{id:a,message:h})]})},DateRangeField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{dateFormat:u=rz,label:c,validation:l,variant:d,...f},value:p={from:void 0,to:void 0},warning:h,...m}=n,[g,y]=t.useState(p.from||""),[_,v]=t.useState(p.to||""),[b,E]=t.useState(),{setFieldValidationConfig:S}=Nk(),[A,w]=t.useState([]);ys((()=>{S(a,Qw().shape({from:zx(),to:zx()}).test({name:"is-empty-string",test(e,t){w(t.schema.describe().meta?.rules??[]);const n=N(t.schema.describe().meta?.rules,"required");if(!e||!n)return!0;return!!(e.from?.length>0&&e.to?.length>0)||t.createError({message:n?.errorMessage??om.DATE_RANGE.REQUIRED})}}).test({name:"is-date",test(e,t){const n=l?.find((e=>!!e&&"dateFormat"in e&&e.dateFormat));if(FL.exports.isEmpty(e?.from)||FL.exports.isEmpty(e?.to))return!0;return!(!O(e.from)||!O(e.to)||!sm.toLocalDateOrTime(e.from,u,"date")||!sm.toLocalDateOrTime(e.to,u,"date"))||t.createError({message:n?.errorMessage||om.DATE_RANGE.INVALID})}}).test({name:"number-of-days",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"numberOfDays"),r=n?.numberOfDays;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date");return!!sm.toLocalDateOrTime(e.to,u,"date").equals(i.plusDays(r-1))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_HAVE_NUMBER_OF_DAYS(r)})}}).test({name:"future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"future");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isAfter(bf.now())||!i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_FUTURE})}}).test({name:"past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"past");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isBefore(bf.now())||!i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_PAST})}}).test({name:"not-future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notFuture");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isAfter(bf.now())||i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_FUTURE})}}).test({name:"not-past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notPast");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isBefore(bf.now())||i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_PAST})}}).test({name:"min-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"minDate"),r=n?.minDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isBefore(i)||o?.isBefore(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MIN_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"max-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"maxDate"),r=n?.maxDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isAfter(i)||o?.isAfter(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MAX_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"excluded-dates",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"excludedDates"),r=n?.excludedDates;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date"),a=sm.toLocalDateOrTime(e.to,u,"date");try{const e=r.map((e=>sm.toLocalDateOrTime(e,u,"date")));for(const r of e)if(i.isEqual(r)||a.isEqual(r))return t.createError({message:n?.errorMessage??om.DATE_RANGE.DISABLED_DATES});return!0}catch{return!1}}}),l);const e=N(A,"future"),t=N(A,"past"),n=N(A,"notFuture"),r=N(A,"notPast"),i=N(A,"minDate"),o=N(A,"maxDate"),s=N(A,"excludedDates"),c=N(A,"numberOfDays"),f=sm.toLocalDateOrTime(i?.minDate,u,"date"),p=sm.toLocalDateOrTime(o?.maxDate,u,"date"),h=M([f,e?.future&&bf.now().plusDays(1),r?.notPast&&bf.now()]),m=T([p,t?.past&&bf.now().minusDays(1),n?.notFuture&&bf.now()]),g=s?.excludedDates,y=c?.numberOfDays;E((e=>({...e,minDate:h?.format(iz),maxDate:m?.format(iz),disabledDates:g,numberOfDays:y})))}),[l,A]),t.useEffect((()=>{C(nz.START)}),[p.from,u,o]),t.useEffect((()=>{C(nz.END)}),[p.to,u,o]);const T=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],M=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],O=e=>e&&e!==om.DATE_RANGE.INVALID,C=e=>{const t=e===nz.START?p.from:p.to,n=e===nz.START?y:v;if(u)if(t)if(O(t)){const e=sm.toLocalDateOrTime(t,u,"date");n(sm.formatDateTime(e?.toString(),rz,"date",om.DATE_RANGE.INVALID))}else n(om.DATE_RANGE.INVALID);else o||n(void 0)},N=(e,t)=>{const n=e?.find((e=>t in e)),r=l?.find((e=>!!e&&t in e));return FL.exports.isEmpty(n)?FL.exports.isEmpty(r)?void 0:r:n};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateRangeInput,{...f,...m,...b,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:(e,t)=>{s({target:{value:{from:sm.formatDateTime(e,u,"date",om.DATE_RANGE.INVALID),to:sm.formatDateTime(t,u,"date",om.DATE_RANGE.INVALID)}}})},value:g,valueEnd:_,variant:d}),e.jsx(YL,{id:a,message:h})]})},get TDateRangeInputType(){return nz},ESignatureField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,uiType:u,upload:c,validation:l,...d},value:f,warning:p}=n,[h,m]=t.useState(null),[g,y]=t.useState(0),[_,v]=t.useState(0),[b,E]=t.useState(null),{setFieldValidationConfig:S}=Nk(),A=t.useRef(null),{clearErrors:w}=xe();t.useEffect((()=>{const e=l?.find((e=>"upload"in e&&e.upload));A.current=e,S(a,Qw().shape({fileId:zx().required(),dataURL:zx(),fileUrl:zx(),uploadResponse:Cx().nullable()}).default(void 0),l)}),[l]),t.useEffect((()=>{if(v(0),M(f)){if(f.dataURL)m(f.dataURL);else if(f.fileUrl){const e=C(f.fileId,f.fileUrl);return()=>e.abort()}}else m(null)}),[f]);const T=async e=>{if(!e)return m(null),v(0),y(0),E(null),void o({target:{value:null}});const t=um();if(m(e),v(0),dE(c))o({target:{value:{fileId:t,dataURL:e}}});else try{const n=await O(t,e);o({target:{value:{fileId:t,..."base64"===c.type&&{dataURL:e},fileUrl:n?.data?.fileUrl,uploadResponse:n}}}),w(a),y(0)}catch(e){y((e=>e+1)),E(null)}},M=e=>!!e,O=async(e,t)=>{E(0);const n=new FormData;if(n.append("fileId",e),c.sessionId&&n.append("sessionId",c.sessionId),"base64"===c.type)n.append("dataURL",t);else if("multipart"===c.type){const r=await exports.FileHelper.dataUrlToBlob(t),i=exports.FileHelper.blobToFile(r,{name:e,lastModified:Date.now()});n.append("file",i,e)}const r=await new fl("",void 0,void 0,!0).post(c.url,n,{headers:{"Content-Type":"base64"===c.type?"application/json":"multipart/form-data",...c.headers},onUploadProgress:e=>{const{loaded:t,total:n}=e;E(t/n)}});return E(null),r},C=(e,t)=>{const n=new AbortController;return(async()=>{try{const r=await new fl("",void 0,void 0,!1,{responseType:"blob"}).get(t,{signal:n.signal}),i=await exports.FileHelper.getType(new File([r],e)),a=new File([r],e,{type:i.mime}),o=await exports.FileHelper.fileToDataUrl(a);m(o),v(0)}catch(e){if(e instanceof Kc)return;v((e=>e+1))}})(),n};return e.jsxs(az,{children:[e.jsx(x.Form.ESignature,{...d,id:a,label:i,onChange:T,value:h,...null!==b&&{loadingProgress:b}}),(r?.message||g||_)&&null===b?g>0?e.jsxs(oz,{children:[A.current?.errorMessage||om.ESIGNATURE.UPLOAD,e.jsx(sz,{type:"button",onClick:()=>T(h),children:"Please try again."}),g>=3&&e.jsx(uz,{type:"warning","data-testid":"upload-refresh-alert",children:"Refresh this page if you cannot upload your signature."})]}):_>0&&M(f)?e.jsxs(oz,{children:["Failed to load.",e.jsx(sz,{type:"button",onClick:()=>C(f.fileId,f.fileUrl),children:"Please try again."}),_>=3&&e.jsx(uz,{type:"warning","data-testid":"load-refresh-alert",children:"Refresh this page if your signature failed to load."})]}):e.jsx(oz,{children:r?.message}):null,e.jsx(YL,{id:a,message:p})]})},ErrorField:n=>{const{id:r,schema:{children:i}}=n,{setFieldValidationConfig:a}=Nk();return t.useEffect((()=>{a(r,Cx().test((()=>!1)),[])}),[]),i?e.jsx(rU,{children:i}):null},FileUploadInner:zz,FileUpload:t=>e.jsx(kz,{children:e.jsx(zz,{...t})}),get EFileStatus(){return exports.EFileStatus},HiddenField:n=>{const{id:r,name:i,onBlur:a,onChange:o,schema:{showIf:s,uiType:u,validation:c,valueType:l,value:d,...f},value:p}=n,{setFieldValidationConfig:h}=Nk(),{setValue:m}=xe();return t.useEffect((()=>{let e;switch(l){case"null":e=Cx();break;case"number":e=jx();break;case"boolean":e=Dx();break;default:e=zx()}h(r,e,c)}),[c,l]),t.useEffect((()=>{"null"===l&&null!==p?m(r,null):hE(d)||p===d||m(r,d)}),[m,r,l,d,p]),e.jsx("input",{onBlur:a,onChange:o,...f,type:"hidden",id:r,"data-testid":r,name:i,value:d??p??""})},HistogramSlider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,bins:u,interval:c,validation:l,disabled:d,readOnly:f,className:p,ariaLabels:h,customOptions:m},value:g,warning:y}=n,{resetField:_}=xe(),[v,b]=t.useState(void 0),{setFieldValidationConfig:E}=Nk();t.useEffect((()=>{if(g)b([g.from,g.to]);else{const e=Math.min(...u.map((e=>e.minValue))),t=Math.max(...u.map((e=>e.minValue)))+c;_(a,{defaultValue:{from:e,to:t},keepDirty:!0}),b([e,t])}}),[g]),t.useEffect((()=>{const e=l?.find((e=>"required"in e)),t=l?.find((e=>"bin"in e&&e.bin)),n=l?.find((e=>"incremental"in e&&e.incremental)),r=l?.find((e=>"withinRange"in e&&e.withinRange));E(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue)));return Number.isInteger((t-r)/c)&&Number.isInteger((n-r)/c)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue))),i=Math.max(...u.map((e=>e.minValue)))+c;return!(t<r||n>i)})),l)}),[l,u,c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.HistogramSlider,{...m,id:a,"data-testid":exports.TestHelper.generateId(a,"histogram-slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},value:v,bins:u,interval:c,disabled:d,readOnly:f,className:p,ariaLabels:h}),e.jsx(YL,{id:a,message:y})]})},ImageUploadInner:DZ,ImageUpload:t=>e.jsx(jz,{children:e.jsx(DZ,{...t})}),ACCEPTED_FILE_TYPES:Uz,get EImageStatus(){return exports.EImageStatus},LocationField:n=>{const{error:r,formattedLabel:i,id:o,schema:{className:s="location",mapApi:u,disabled:c,gettingCurrentLocationFetchMessage:l,interactiveMapPinIconUrl:d,label:f,locationInputPlaceholder:p,locationListTitle:h,locationModalStyles:m,mapBannerText:g,mapPanZoom:y,mustHavePostalCode:_,readOnly:v,staticMapPinColor:b,validation:E,hasExplicitEdit:S,locationSelectionMode:A="default",disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O},value:C,warning:N}=n,[D,L]=t.useState(!1),{setValue:I}=xe(),{setFieldValidationConfig:k}=Nk(),{dispatchFieldEvent:$,addFieldEventListener:R,removeFieldEventListener:F}=gI();t.useEffect((()=>(R("show-location-modal",o,j),()=>{F("show-location-modal",o,j)})),[]),t.useEffect((()=>{const e=E?.find((e=>"required"in e)),t=E?.find((e=>"postalCode"in e));k(o,Qw({address:zx(),blockNo:zx(),building:zx(),lat:jx(),lng:jx(),postalCode:zx(),roadName:zx(),x:jx(),y:jx()}).test("is-required",e?.errorMessage||om.COMMON.FIELD_REQUIRED,(t=>!e?.required||!!t&&!!t.lat&&!!t.lng)).test("must-have-postal-code",t?.errorMessage||om.LOCATION.MUST_HAVE_POSTAL_CODE,(t=>!e||!_||exports.LocationHelper.hasGotAddressValue(t.postalCode))),E)}),[E]);const z=(e,t=!0)=>{I(o,e,{shouldDirty:t})},P=()=>{v||c||(L(!0),$("show-location-modal",o))},j=()=>{L(!0)};return e.jsxs("div",{id:o,"data-testid":exports.TestHelper.generateId(o),className:s,children:[e.jsx(PZ,{id:o,label:i,className:s,locationInputPlaceholder:p,onChange:e=>e.currentTarget.blur(),onFocus:P,value:C?.address||"",errorMessage:r?.message,disabled:"explicit"===S&&!!C?.address||c,readOnly:v}),S&&C?.address&&e.jsx(a.Button.Default,{id:exports.TestHelper.generateId(o,"edit-button"),"data-testid":exports.TestHelper.generateId(o,"edit-button"),styleType:"secondary",onClick:()=>{!$("click-edit-button",o)||L(!0)},type:"button",children:"Edit"}),!!C?.lat&&!!C?.lng&&e.jsx(GL,{id:o,className:`${s}-static-map`,lat:C.lat,lng:C.lng,staticMapPinColor:b,onClick:P,disabled:c}),e.jsx(t.Suspense,{fallback:null,children:jZ&&e.jsx(jZ,{id:o,className:s,showLocationModal:D,onClose:()=>{L(!1),$("hide-location-modal",o)},formValues:C,onConfirm:z,updateFormValues:z,mapPanZoom:y,mapApi:u,interactiveMapPinIconUrl:d,gettingCurrentLocationFetchMessage:l,mustHavePostalCode:_,locationModalStyles:m,locationListTitle:h,mapBannerText:g,locationSelectionMode:A,disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O})}),e.jsx(YL,{id:o,message:N})]})},GeolocationPositionErrorWrapper:ZZ,MaskedField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:{label:u,uiType:c,validation:l,maskRegex:d,iconMask:f,iconUnmask:p,...h},warning:m,...g}=n,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Nk();t.useEffect((()=>{E(a,zx(),l);const e=l?.find((e=>"max"in e)),t=l?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n)}),[l]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]);const S=t=>{if(!t)return;const n=H[t];return e.jsx(n,{"data-testid":t})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MaskedInput,{...h,...g,...v,id:a,"data-testid":exports.TestHelper.generateId(a,c),label:i,onChange:e=>{o(e)},value:y,errorMessage:r?.message,maskRegex:(()=>{if(d)try{const e=d.match(/\/(.*)\/([a-z]+)?/);return new RegExp(e[1],e[2])}catch(e){console.warn(`invalid regex pattern: ${d}`)}})(),iconMask:S(f),iconUnmask:S(p)}),e.jsx(YL,{id:a,message:m})]})},MultiSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u=[],validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||[]),{setFieldValidationConfig:y}=Nk();t.useEffect((()=>{const e=c?.find((e=>"required"in e));y(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),c)}),[c]),_s((()=>{const e=d?.filter((e=>u.find((t=>t.value===e))));h(a,e)}),[u]),t.useEffect((()=>{g(d||[])}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MultiSelect,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOptions:e=>{const t=e.map((e=>e.value));o({target:{value:t}})},selectedOptions:u.filter((e=>m.includes(e.value))),valueExtractor:e=>e.value,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},NestedMultiSelect:n=>{const{schema:{label:r,validation:i,options:a=[],...o},id:s,value:u,formattedLabel:c,onChange:l,onBlur:d,error:f,warning:p,...h}=n,{setValue:m}=xe(),{setFieldValidationConfig:g}=Nk(),[y,_]=t.useState(u),[v,b]=t.useState([]),E=t.useCallback((e=>{const t=[],n=(e,r)=>{for(const i in e){const a=[...r,i],o=e[i];"string"==typeof o?t.push(a):n(o,a)}};return n(e,[]),t}),[]);t.useEffect((()=>{const e=i?.find((e=>"required"in e));g(s,Qw().test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!e?.required||!!t&&!!Object.keys(t).length)),i)}),[i]),_s((()=>{const e=(t,n)=>{const r={};for(const i of t){const{key:t,subItems:a}=i,o=n[t];if(o){const n="string"==typeof o?o:e(a||[],o);Object.keys(n).length?r[t]=n:delete r[t]}}return r},t=u?e(a,u):u;m(s,t)}),[a]),t.useEffect((()=>{_(u);const e=E(u);b(e)}),[E,y,u]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.NestedMultiSelect,{...o,...h,id:s,"data-testid":exports.TestHelper.generateId(s),label:c,options:a,onSelectOptions:(e,t)=>{const n=((e,t)=>{const n={};return e.forEach(((e,r)=>{e.reduce(((n,i,a)=>(a===e.length-1?n[i]=t[r]:n[i]||(n[i]={}),n[i])),n)})),n})(e,t);l({target:{value:n}})},onBlur:d,selectedKeyPaths:v,errorMessage:f?.message}),e.jsx(YL,{id:s,message:p})]})},RadioButtonGroup:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||""),{setFieldValidationConfig:v}=Nk();t.useEffect((()=>{v(a,zx(),f)}),[f]),ys((()=>{d.find((e=>e.value===h))||g(a,"")}),[d]),t.useEffect((()=>{_(h||"")}),[h]);const b=e=>{o({target:{value:e}})},E=e=>y===e,S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(rU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:(()=>{switch(u?.styleType){case"toggle":return d.length>0&&"toggle"===u.styleType&&e.jsx(YZ,{className:s?`${s} ${s}-radio-container`:void 0,$layoutType:u?.layoutType??"horizontal",children:d.map(((n,i)=>{const o=S();return t.createElement(WZ,{...p,key:i,type:"radio",id:o,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??n.disabled,name:o,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(n.value),onChange:()=>b(n.value),error:!!r?.message,compositeSection:n.children?{children:e.jsx(rU,{children:n.children}),collapsible:!1}:null,subLabel:!!n.subLabel&&A(n.subLabel)},A(n.label))}))});case"image-button":return d.length>0&&e.jsx(GZ,{className:s?`${s} ${s}-radio-container`:void 0,children:d.map(((e,n)=>{const i=S();return t.createElement(VZ,{...p,type:"button",key:n,id:i,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??e.disabled,name:i,selected:E(e.value),onClick:()=>b(e.value),imgSrc:e.imgSrc,error:!!r?.message},e.label)}))});default:return d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(HZ,{className:s?`${s}-radio-container`:void 0,children:[e.jsx(BZ,{...p,className:s,id:r,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??t.disabled,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx(UZ,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}})()}),e.jsx(YL,{id:a,message:m})]})},RangeSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d={from:void 0,to:void 0},warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d.from||""),[y,_]=t.useState(d.to||""),{setFieldValidationConfig:v}=Nk();t.useEffect((()=>{const e=c?.find((e=>"required"in e));v(a,Qw().shape({from:zx(),to:zx()}).test("is-empty-string",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e?.required||t.from?.length>0&&t.to?.length>0)),c)}),[c]),ys((()=>{const e={};u.from.find((e=>e.value===d.from))||(e.from=""),u.to.find((e=>e.value===d.to))||(e.to=""),h(a,{...d,...e})}),[u]),t.useEffect((()=>{_(d.from),g(d.to)}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.RangeSelect,{...l,...p,id:a,onHideOptions:()=>{d.from&&d.to||o({target:{value:{from:void 0,to:void 0}}})},"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOption:e=>{void 0===e.from&&void 0===e.to&&o({target:{value:{from:void 0,to:void 0}}}),e.from&&o({target:{value:{from:e.from.value,to:void 0}}}),e.to&&o({target:{value:{to:e.to.value,from:y}}})},selectedOptions:{from:u.from.find((({value:e})=>e===y)),to:u.to.find((({value:e})=>e===m))},valueToStringFunction:e=>`${e.from} - ${e.to}`,valueExtractor:e=>({from:e.value,to:e.value}),displayValueExtractor:e=>e.label,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},ResetButton:t=>{const{id:n,schema:{disabled:r,ignoreDefaultValues:i,label:o,...s},...u}=t,{reset:c,getValues:l}=xe(),{resetFields:d}=Ck(),{formSchema:{defaultValues:f}}=Ok();return e.jsx(a.Button.Default,{...s,...u,disabled:r,"data-testid":n,id:n,type:"reset",onClick:()=>{if(i){const e=l();Object.entries(e).forEach((([t,n])=>{Hr(n)?e[t]=[]:a$(n)||aI(n)?e[t]="":Rr(n)&&(e[t]={})})),c(e),d(e)}else c(),d(f)},children:o})},Select:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||""),{setFieldValidationConfig:y}=Nk();t.useEffect((()=>{y(a,zx(),c)}),[c]),ys((()=>{u.find((e=>e.value===d))||h(a,"")}),[u]),t.useEffect((()=>{g(d||"")}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Select,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a,"select"),label:i,errorMessage:r?.message,options:u,onSelectOption:(e,t)=>{o({target:{value:t}})},selectedOption:u.find((({value:e})=>e===m)),displayValueExtractor:e=>e.label,valueExtractor:e=>e.value,listExtractor:e=>e.label}),e.jsx(YL,{id:a,message:f})]})},SelectHistogram:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,validation:u,disabled:c,readOnly:l,className:d,histogramSlider:f,customOptions:p},value:h,warning:m,...g}=n,{bins:y,interval:_,...v}=f,{resetField:b}=xe(),[E,S]=t.useState([0,0]),{setFieldValidationConfig:A}=Nk();t.useEffect((()=>{if(h)S([h.from,h.to]);else{const e=Math.min(...y.map((e=>e.minValue))),t=Math.max(...y.map((e=>e.minValue)))+_;b(a,{defaultValue:{from:e,to:t},keepDirty:!0}),S([e,t])}}),[h]),t.useEffect((()=>{const e=u?.find((e=>"required"in e)),t=u?.find((e=>"bin"in e&&e.bin)),n=u?.find((e=>"incremental"in e&&e.incremental)),r=u?.find((e=>"withinRange"in e&&e.withinRange));A(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue)));return Number.isInteger((t-r)/_)&&Number.isInteger((n-r)/_)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue))),i=Math.max(...y.map((e=>e.minValue)))+_;return!(t<r||n>i)})),u)}),[u,y,_]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.SelectHistogram,{...g,id:a,"data-testid":exports.TestHelper.generateId(a,"select-histogram"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},disabled:c,readOnly:l,className:d,rangeLabelPrefix:p?.rangeLabelPrefix,rangeLabelSuffix:p?.rangeLabelSuffix,value:E,histogramSlider:{bins:y,interval:_,...v}}),e.jsx(YL,{id:a,message:m})]})},Slider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,customOptions:u,validation:c,disabled:l,readOnly:d,className:f,ariaLabel:p},value:h,warning:m}=n,[g,y]=t.useState(),{setFieldValidationConfig:_}=Nk();t.useEffect((()=>{const e=c?.find((e=>"min"in e)),t=c?.find((e=>"max"in e)),n=c?.find((e=>"increment"in e));_(a,jx().test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(t=>{if("number"!=typeof t||!n)return!0;const r=n.increment,i=(e?.min??0)-t;return Number.isInteger(i/r)})),c),(e||t||n)&&y({min:e?.min,max:t?.max,step:n?.increment})}),[c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Slider,{...u,...g,id:a,"data-testid":exports.TestHelper.generateId(a,"slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{o({target:{value:e}})},value:h,disabled:l,readOnly:d,className:f,ariaLabel:p}),e.jsx(YL,{id:a,message:m})]})},SubmitButton:n=>{const{id:r,schema:{disabled:i,label:o,...s},...u}=n,{submitHandler:c,wrapInForm:l}=Dk(),{setFieldValidationConfig:d}=Nk(),{hardValidationSchema:f}=kk(),p=$e({disabled:"invalid-form"!==i}),[h,m]=t.useState(!0===i);t.useEffect((()=>{d(r,Cx())}),[]),t.useEffect((()=>{"invalid-form"!==i&&m(!!i)}),[i]),ys((()=>{(async()=>{if("invalid-form"===i)try{await f.validate(p),m(!1)}catch(e){m(!0)}})()}),[p,f]);return e.jsx(a.Button.Default,{...s,...u,disabled:h,"data-testid":r,id:r,onClick:e=>{l||(e.preventDefault(),c?.())},type:"submit",children:o})},Switch:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,validation:d,...f},value:p,warning:h}=n,[m,g]=t.useState(p||void 0),{setFieldValidationConfig:y}=Nk();t.useEffect((()=>{y(a,Dx().strict(),d)}),[d]),t.useEffect((()=>{g(p)}),[p]);const _=e=>{o({target:{value:e}})},v=e=>m===e,b=e=>`${a}-${e}`;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:e.jsxs(qZ,{className:s,role:"radiogroup","aria-label":"string"==typeof l?l:$L(l.mainLabel,{allowedTags:[]}),children:[e.jsx(T.Toggle,{...f,type:"yes",id:b("yes"),"data-testid":exports.TestHelper.generateId(a,"switch-yes"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!0),onChange:()=>_(!0),indicator:!0,name:a,error:!!r?.message,children:"Yes"}),e.jsx(T.Toggle,{...f,type:"no",id:b("no"),"data-testid":exports.TestHelper.generateId(a,"switch-no"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!1),onChange:()=>_(!1),indicator:!0,name:a,error:!!r?.message,children:"No"})]})}),e.jsx(YL,{id:a,message:h})]})},TextField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:u,warning:c,...l}=n,{customOptions:d,inputMode:f,label:p,uiType:h,validation:m,...g}=u,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Nk(),S=t.useRef(null),A=t.useRef(0);t.useEffect((()=>{switch(h){case"numeric-field":{E(a,jx(),m);const e=m?.find((e=>"min"in e)),t=m?.find((e=>"max"in e)),n={...v};e?.min>0&&(n.min=e.min),t?.max>0&&(n.max=t.max),b(n);break}case"email-field":{const e=m?.find((e=>e.email));E(a,zx().email(e?.errorMessage||om.EMAIL.INVALID),m);const t=m?.find((e=>"max"in e)),n=m?.find((e=>"length"in e)),r={...v};t?.max>0?r.maxLength=t.max:n?.length>0&&(r.maxLength=n.length),b(r);break}case"text-field":{E(a,zx(),m);const e=m?.find((e=>"max"in e)),t=m?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n);break}}}),[m]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]),t.useEffect((()=>{"text-field"===h&&document?.activeElement===S.current&&S.current.selectionEnd!==A.current&&S.current.setSelectionRange(A.current,A.current)}),[y]),t.useEffect((()=>{"text-field"===u.uiType&&"uppercase"===u.customOptions?.textTransform&&y&&_((e=>e?.toString().toUpperCase()))}),["text-field"===u.uiType&&u.customOptions?.textTransform]);const w=()=>!!d?.addOn,T=w()?x.Form.InputGroup:x.Form.Input;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...g,...l,...v,id:a,"data-testid":exports.TestHelper.generateId(a,h),ref:S,type:(()=>{switch(h){case"numeric-field":return"number";case"email-field":return"email";default:return"text"}})(),label:i,onPaste:e=>{const t=e.clipboardData.getData("text");(d?.preventCopyAndPaste||"numeric-field"===h&&/e/i.test(t))&&e.preventDefault()},onDrop:e=>d?.preventDragAndDrop?e.preventDefault():null,inputMode:(()=>{if(f)return f;switch(h){case"numeric-field":return"numeric";case"email-field":return"email";case"text-field":return"text";default:return"none"}})(),onChange:e=>{if("numeric-field"===h){const t=!isNaN(parseFloat(e.target.value))?+e.target.value:void 0;return o({target:{value:t}}),void _(t)}"text-field"===u.uiType?(A.current=e.target.selectionEnd,"uppercase"===u.customOptions?.textTransform&&(e.target.value=e.target.value.toUpperCase()),o(e)):o(e),_(e.target.value)},onKeyDown:e=>{"numeric-field"===h&&"e"===e.key.toLowerCase()&&e.preventDefault()},value:y,errorMessage:r?.message,addon:(()=>{if(w()){if("label"===d.addOn.type)return{type:"label",position:d.addOn.position,attributes:{value:d.addOn.value}};if("icon"===d.addOn.type){const{icon:t,position:n,color:r}=d.addOn,i=H[t];return{type:"custom",position:n,attributes:{children:e.jsx(KZ,{as:i,$color:r})}}}}})()}),e.jsx(YL,{id:a,message:c})]})},Textarea:G$,TimeField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{is24HourFormat:s,label:u,placeholder:c,useCurrentTime:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||""),{setFieldValidationConfig:_}=Nk();t.useEffect((()=>{_(a,zx(),d)}),[d]),t.useEffect((()=>{if(l&&!p){const e=s?"H:mm":"h:mma";setTimeout((()=>v(e)))}else y(p)}),[p,l,s]);const v=e=>{const t=sm.formatDateTime(Af.now().toString().toUpperCase(),e,"time");y(t),o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Timepicker,{...f,...m,id:a,"data-testid":exports.TestHelper.generateId(a,"time"),label:i,errorMessage:r?.message,value:g,placeholder:c,format:s?"24hr":"12hr",onChange:e=>{o({target:{value:e}})}}),e.jsx(YL,{id:a,message:h})]})},get EFieldType(){return exports.EFieldType},UnitNumberField:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{label:s,validation:u,...c},value:l,warning:d,...f}=n,[p,h]=t.useState(l||""),{setFieldValidationConfig:m}=Nk();t.useEffect((()=>{const e=u?.find((e=>"unitNumberFormat"in e));m(a,zx().matches(/^([a-zA-Z0-9]{1,3}-[a-zA-Z0-9]{1,5})$/,{excludeEmptyString:!0,message:e?.errorMessage||om.UNIT_NUMBER.INVALID}),u)}),[u]),t.useEffect((()=>{h(l||"")}),[l]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.UnitNumberInput,{...c,...f,id:a,"data-testid":exports.TestHelper.generateId(a,"unit-number"),label:r,value:p,onChange:e=>{o({target:{value:e}})},errorMessage:i?.message}),e.jsx(YL,{id:a,message:d})]})}});const QZ=({id:t,children:n,childSchema:r})=>{if("columns"in r){if((i=r.columns)&&("xxs"in i||"xs"in i||"sm"in i||"md"in i||"lg"in i||"xl"in i||"xxl"in i)){const{xxs:i,xs:a,sm:o,md:s,lg:u,xl:c,xxl:d,...f}=r.columns||{};return e.jsx(l.Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),xlCols:c,lgCols:u,mdCols:s,smCols:o,xsCols:a,xxlCols:d,xxsCols:i,...f,children:n})}const{desktop:a,tablet:o,mobile:s,...u}=r.columns||{};return e.jsx(P.V2_Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),desktopCols:a??12,tabletCols:o,mobileCols:s,...u,children:n})}var i;return e.jsx(e.Fragment,{children:n})},eU=({id:n,renderRules:r,children:i,schema:a})=>{const{formValidationConfig:o,removeFieldValidationConfig:s}=Nk(),[u,c]=t.useState(void 0),{formValues:l}=Ck(),{unregister:d}=xe();_s((()=>{if(dE(r))return;const e=f();if(e!==u){if(!e){[n,...p(a)].forEach((e=>{s(e),d(e)}))}c(e)}}),[o,l,r]);const f=()=>{if(dE(r))return!0;let e=!1;return r.forEach((t=>{if(!e){const n={};Object.entries(t).forEach((([e,t])=>{if(t.find((e=>e.shown))&&!o?.[e])return void(n[e]={schema:Cx().test("shown",(()=>!1)),validationRules:[]});const r=o?.[e]?.schema.type;if(r){let i=KL.mapSchemaType(r);"number"===r&&(i=i.nullable().transform(((e,t)=>!isNaN(parseFloat(t?.toString()))?+t:void 0))),n[e]={schema:i,validationRules:t}}}));const r=KL.buildSchema(n);try{r.validateSync(l),e=!0}catch(e){}}})),e},p=e=>{const t=e.children,r=[];switch(e.uiType){case"chips":r.push(n+"-textarea");break;case"checkbox":case"radio":e.options.forEach((e=>{const t=e.children;!dE(t)&&un(t)&&Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))}))}))}return dE(t)||!un(t)||Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))})),r};return dE(r)||u?e.jsx(e.Fragment,{children:i}):null},tU=Object.keys(exports.EFieldType),nU=Object.keys(exports.EElementType),rU=n=>{const{id:r,schema:i,children:a}=n,{showIf:o,uiType:s,children:u,...c}=i||{},{warnings:l}=kk(),[d,f]=t.useState(null),{control:p}=xe(),{getCustomComponent:h}=hI(),{formSchema:{overrides:m},overrideSchema:g}=Ok();mI((()=>{const n=g(u||a,m);if("object"==typeof n){const r=[];Object.keys(n).forEach((i=>{const a=n[i];if(dE(a)||"object"!=typeof a)return;let o=e.jsx(t.Fragment,{children:om.GENERIC.UNSUPPORTED},i);if("referenceKey"in a){const n=a.referenceKey.toUpperCase();o=h(a.referenceKey)||p$[f$[n]]?y(i,a)(_):p$[d$[n]]?y(i,a)(v):e.jsx(t.Fragment,{},i)}else"uiType"in a&&(tU.includes(a.uiType.toUpperCase())?o=y(i,a)(_):nU.includes(a.uiType.toUpperCase())&&(o=y(i,a)(v)));r.push(o)})),f(r)}else f("string"==typeof n?n:om.GENERIC.UNSUPPORTED)}),[u||a,m,p,l,h]);const y=(t,n)=>r=>e.jsx(eU,{id:t,...n&&"showIf"in n&&{renderRules:n.showIf},schema:n,children:r(t,n)},t),_=(t,n)=>{let r;return"uiType"in n?r=XZ[exports.EFieldType[n.uiType?.toUpperCase()]]:"referenceKey"in n&&(r=p$[f$[n.referenceKey?.toUpperCase()]]||h(n.referenceKey)),r?e.jsx(QZ,{id:t,childSchema:n,children:e.jsx(j$,{id:t,schema:n,Field:r,warning:l?.[t]})}):null},v=(t,n)=>{let r;return"uiType"in n?r=Yk[exports.EElementType[n.uiType?.toUpperCase()]]||rU:"referenceKey"in n&&(r=p$[d$[n.referenceKey?.toUpperCase()]]),e.jsx(QZ,{id:t,childSchema:n,children:e.jsx(r,{schema:n,id:t})})},b=s;return b?e.jsx(b,{...c,id:r,"data-testid":exports.TestHelper.generateId(r,s),children:d}):e.jsx(e.Fragment,{children:d})},iU=V.default(l.Layout.Container)`
|
|
1103
|
+
`;var XZ;exports.EFieldType=void 0,(XZ=exports.EFieldType||(exports.EFieldType={})).BUTTON="ButtonField",XZ.CHECKBOX="CheckboxGroup",XZ.CHIPS="Chips",XZ["CONTACT-FIELD"]="ContactField",XZ["DATE-FIELD"]="DateField",XZ["DATE-RANGE-FIELD"]="DateRangeField",XZ["EMAIL-FIELD"]="TextField",XZ["E-SIGNATURE-FIELD"]="ESignatureField",XZ["ERROR-FIELD"]="ErrorField",XZ["FILE-UPLOAD"]="FileUpload",XZ["HIDDEN-FIELD"]="HiddenField",XZ["HISTOGRAM-SLIDER"]="HistogramSlider",XZ["IMAGE-UPLOAD"]="ImageUpload",XZ["LOCATION-FIELD"]="LocationField",XZ["MASKED-FIELD"]="MaskedField",XZ["MULTI-SELECT"]="MultiSelect",XZ["NESTED-MULTI-SELECT"]="NestedMultiSelect",XZ["RANGE-SELECT"]="RangeSelect",XZ["NUMERIC-FIELD"]="TextField",XZ["OTP-VERIFICATION-FIELD"]="OtpVerificationField",XZ.RADIO="RadioButtonGroup",XZ.RESET="ResetButton",XZ.SELECT="Select",XZ["SELECT-HISTOGRAM"]="SelectHistogram",XZ.SLIDER="Slider",XZ.SUBMIT="SubmitButton",XZ.SWITCH="Switch",XZ.TEXTAREA="Textarea",XZ["TEXT-FIELD"]="TextField",XZ["TIME-FIELD"]="TimeField",XZ["UNIT-NUMBER-FIELD"]="UnitNumberField";var QZ=Object.freeze({__proto__:null,ButtonField:t=>{const{schema:{label:n,uiType:r,startIcon:i,endIcon:a,href:o,target:s,...u},id:c,...l}=t,{dispatchFieldEvent:d}=gI(),f=t=>{if(!t)return null;const n=H[t];return e.jsx(n,{})};return e.jsxs(h$,{type:"button",...u,...l,onClick:e=>{d("click",c,e),o&&(e=>{try{return!!new URL(e)}catch{return!1}})(o)&&(s?window.open(o,s,"noopener noreferrer"):window.location.href=o)},children:[f(i),n,f(a)]})},CheckboxGroup:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||[]),{setFieldValidationConfig:v}=Nk();t.useEffect((()=>{const e=f?.find((e=>"required"in e));v(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),f)}),[f]),ys((()=>{const e=h?.filter((e=>d.find((t=>t.value===e))));g(a,e)}),[d]),t.useEffect((()=>{_(h||[])}),[h]);const b=(e,t)=>{const n=d.find((e=>!0===e.none));let r=[...y];t?r=r.includes(e)?[]:[e]:r.includes(e)?r=k$(r,e,n?.value):(r.push(e),r=k$(r,n?.value)),o({target:{value:r}})},E=e=>y.includes(e),S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(iU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:r,errorMessage:i?.message,children:"toggle"===u?.styleType?d.length>0&&"toggle"===u.styleType&&e.jsx(z$,{$layoutType:u?.layoutType??"horizontal",className:s?`${s}-checkbox-container`:void 0,children:d.map(((t,n)=>{const r=S();return e.jsx(P$,{type:"checkbox","data-testid":exports.TestHelper.generateId(a,"toggle"),id:r,className:s,disabled:c??t.disabled,name:r,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(t.value),onChange:()=>b(t.value,t.none),error:!!i?.message,compositeSection:t.children?{children:e.jsx(iU,{children:t.children}),collapsible:!1}:null,subLabel:!!t.subLabel&&A(t.subLabel),children:A(t.label)},n)}))}):d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(F$,{className:s?`${s}-checkbox-container`:void 0,children:[e.jsx(R$,{...p,"data-testid":exports.TestHelper.generateId(a,"checkbox"),id:r,className:s,disabled:c??t.disabled,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx($$,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}),e.jsx(YL,{id:a,message:m})]})},Chips:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{disabled:s,label:u,options:c,textarea:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||[]),[_,v]=t.useState(!1),[b,E]=t.useState(!0),{setValue:S,unregister:A}=xe(),{setFieldValidationConfig:w,removeFieldValidationConfig:T}=Nk();t.useEffect((()=>{_||A(O())}),[]),t.useEffect((()=>{const e=d?.find((e=>"required"in e)),t=d?.find((e=>"max"in e)),n=d?.find((e=>"length"in e));w(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),d),1!==t?.max&&1!==n?.length||E(!1)}),[d]),ys((()=>{const e=[...c.map((e=>e.value)),l?.label],t=p?.filter((t=>e.includes(t)));S(a,t)}),[c]),t.useEffect((()=>{p?.includes(C())?N(!0):N(),y(p||[])}),[p]);const M=e=>g.includes(e),O=()=>`${a}-textarea`,C=()=>"string"==typeof l?.label?l?.label:l?.label?.mainLabel,N=(e=!1)=>{v(e),e||T(O())},D=e=>{let t=[...g];if(t.includes(e))return t=t.filter((t=>t!==e)),void o({target:{value:t}});b?t.push(e):t=[e],o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsxs(x.Form.CustomField,{label:i,errorMessage:r?.message,...m,children:[e.jsxs(Y$,{"data-testid":exports.TestHelper.generateId(a,"chips"),$showTextarea:_,children:[c.map(((e,n)=>t.createElement(uT,{...f,key:n,onClick:()=>D(e.value),isActive:M(e.value),disabled:s??e.disabled},e.label))),(()=>{if(!l?.label)return;const t=C();return e.jsx(uT,{...f,onClick:()=>{D(t)},isActive:M(t),children:t})})()]}),(()=>{if(!l?.label)return e.jsx(e.Fragment,{});const t=O(),n={uiType:"textarea",className:f.className?`${f.className}-textarea`:void 0,...l};return _?e.jsx(j$,{id:t,schema:n,Field:G$}):e.jsx(e.Fragment,{})})()]}),e.jsx(YL,{id:a,message:h})]})},ContactField:n=>{const{isDirty:r,formattedLabel:i,error:a,id:o,name:s,onChange:u,schema:{defaultCountry:c,disabled:l,enableSearch:d,label:f,placeholder:p,validation:h,...m},value:g,warning:y,..._}=n,{resetField:v}=xe(),[b,E]=t.useState(g||""),S=Ik(c),[A,w]=t.useState(c),[T]=t.useState((()=>{const e=new Map;return W$.forEach((t=>{const[n,...r]=t,i=r.find((e=>/^\d+$/.test(e)));e.set(n,i)})),e})()),[M,O]=t.useState(),[C,N]=t.useState(),[D,L]=t.useState(void 0),{setFieldValidationConfig:I}=Nk();t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber,r=e?.errorMessage;T.has(n)?(w(n),L(!0)):["default","house","mobile"].includes(t)?(w("Singapore"),L(!0)):L(!1),N(t),I(o,zx().test("singaporeNumber",r||om.CONTACT.INVALID_SINGAPORE_NUMBER,(e=>!e||!t||QF.isSingaporeNumber(e,t))).test("internationalNumber",r||om.CONTACT.INVALID_INTERNATIONAL_NUMBER,(e=>!(e&&!t&&n)||QF.isInternationalNumber(M?.name,e))),h)}),[h,M]),t.useEffect((()=>{const e=A||"Singapore";O({name:e,prefix:T.get(e)})}),[A,T]),t.useEffect((()=>{const e=h?.find((e=>"contactNumber"in e)),t=e?.contactNumber?.singaporeNumber,n=e?.contactNumber?.internationalNumber;!c||S===c||T.has(n)||["default","house","mobile"].includes(t)||w(c)}),[h,c]),t.useEffect((()=>{if(void 0!==D&&!r){const{prefix:e,number:t}=QF.getParsedPhoneNumber(g||""),n=e.replace(/\+/g,""),r=(e=>{for(const[t,,,n]of W$)if(t===e)return n})(A||"Singapore");if(!D||D&&n===r){const n=k({countryCode:e||r,number:t});v(o,{defaultValue:n,keepDirty:!0})}else{const e=k({countryCode:"",number:""});v(o,{defaultValue:e,keepDirty:!0})}}}),[g,r,D,A]);const k=e=>{const{countryCode:t,number:n}=e,r=t.replace(/\+/g,"");if(!1===D&&r!==M?.prefix){const e=((e,t)=>{for(const[n,r]of t.entries())if(r===e)return n})(r,T);e&&O({name:e,prefix:t})}return E(n),QF.formatPhoneNumber(e.countryCode,e.number)||""};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.PhoneNumberInput,{...m,..._,"data-testid":exports.TestHelper.generateId(o,"contact"),disabled:l,enableSearch:d,errorMessage:a?.message,fixedCountry:D,id:o,label:i,name:s,placeholder:(()=>{if(p)return p;if(C){return`Enter ${"mobile"===C?"mobile":"home"} number`}return"Enter contact number"})(),value:(()=>{if(!M)return;const{prefix:e}=M;return{number:b,countryCode:e}})(),onChange:e=>{const t=k(e);u({target:{value:t}})}}),e.jsx(YL,{id:o,message:y})]})},DateField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{label:u,useCurrentDate:c,dateFormat:l=ez,validation:d,...f},value:p,warning:h,...m}=n,{setValue:g}=xe(),[y,_]=t.useState(p||""),[v,b]=t.useState(),{setFieldValidationConfig:E}=Nk();t.useEffect((()=>{const e=d?.find((e=>"dateFormat"in e&&e.dateFormat)),t=d?.find((e=>"future"in e)),n=d?.find((e=>"past"in e)),r=d?.find((e=>"notFuture"in e)),i=d?.find((e=>"notPast"in e)),o=d?.find((e=>"minDate"in e)),s=d?.find((e=>"maxDate"in e)),u=d?.find((e=>"excludedDates"in e)),c=d?.find((e=>"withinDays"in e)),f=d?.find((e=>"beyondDays"in e)),p=sm.toLocalDateOrTime(o?.minDate,l,"date"),h=sm.toLocalDateOrTime(s?.maxDate,l,"date");E(a,zx().test("is-date",e?.errorMessage||om.DATE.INVALID,(e=>!e||""===e||!!w(e)&&!!sm.toLocalDateOrTime(e,l,"date"))).test("future",t?.errorMessage||om.DATE.MUST_BE_FUTURE,(e=>{if(!w(e)||!t?.future)return!0;const n=sm.toLocalDateOrTime(e,l,"date");return!!n?.isAfter(bf.now())})).test("past",n?.errorMessage||om.DATE.MUST_BE_PAST,(e=>{if(!w(e)||!n?.past)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!!t?.isBefore(bf.now())})).test("not-future",r?.errorMessage||om.DATE.CANNOT_BE_FUTURE,(e=>{if(!w(e)||!r?.notFuture)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(bf.now())})).test("not-past",i?.errorMessage||om.DATE.CANNOT_BE_PAST,(e=>{if(!w(e)||!i?.notPast)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(bf.now())})).test("min-date",o?.errorMessage||om.DATE.MIN_DATE(sm.formatDateTime(o?.minDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!p)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isBefore(p)})).test("max-date",s?.errorMessage||om.DATE.MAX_DATE(sm.formatDateTime(s?.maxDate,"dd/MM/uuuu","date")),(e=>{if(!w(e)||!h)return!0;const t=sm.toLocalDateOrTime(e,l,"date");return!t?.isAfter(h)})).test("excluded-dates",u?.errorMessage||om.DATE.DISABLED_DATES,(e=>!w(e)||!u||!u.excludedDates.includes(e))).test("within-days",c?.errorMessage||c?.withinDays&&om.DATE.WITHIN_DAYS(c?.withinDays),(e=>!w(e)||!c||sm.checkWithinDays(e,{...c.withinDays,dateFormat:l}))).test("beyond-days",f?.errorMessage||f?.beyondDays&&om.DATE.BEYOND_DAYS(f?.beyondDays),(e=>!w(e)||!f||sm.checkBeyondDays(e,{...f.beyondDays,dateFormat:l}))),d);const m=c?.withinDays&&sm.calculateDisabledWithinDaysRange({...c.withinDays,dateFormat:l}),g=f?.beyondDays&&sm.calculateDisabledBeyondDaysRange({...f.beyondDays,dateFormat:l}),y=A([p,t?.future&&bf.now().plusDays(1),i?.notPast&&bf.now(),m?.startDate,g?.startDate]),_=S([h,n?.past&&bf.now().minusDays(1),r?.notFuture&&bf.now(),m?.endDate,g?.endDate]),v=[...u?.excludedDates||[]];(y||_||v)&&b((e=>({...e,minDate:y?.format(tz),maxDate:_?.format(tz),disabledDates:v})))}),[d]),t.useEffect((()=>{if(l)if(p)if(w(p)){const e=sm.toLocalDateOrTime(p,l,"date");_(sm.formatDateTime(e?.toString(),ez,"date",om.DATE.INVALID))}else _(om.DATE.INVALID);else if(!o)if(c){const e=sm.formatDateTime(bf.now().toString(),l,"date");g(a,e);const t=sm.formatDateTime(bf.now().toString(),ez,"date");_(t)}else _(void 0)}),[c,p,l,o]);const S=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],A=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],w=e=>e&&e!==om.DATE.INVALID;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateInput,{...f,...m,...v,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:e=>{s({target:{value:sm.formatDateTime(e,l,"date",om.DATE.INVALID)}})},value:y}),e.jsx(YL,{id:a,message:h})]})},DateRangeField:n=>{const{error:r,formattedLabel:i,id:a,isDirty:o,onChange:s,schema:{dateFormat:u=rz,label:c,validation:l,variant:d,...f},value:p={from:void 0,to:void 0},warning:h,...m}=n,[g,y]=t.useState(p.from||""),[_,v]=t.useState(p.to||""),[b,E]=t.useState(),{setFieldValidationConfig:S}=Nk(),[A,w]=t.useState([]);ys((()=>{S(a,Qw().shape({from:zx(),to:zx()}).test({name:"is-empty-string",test(e,t){w(t.schema.describe().meta?.rules??[]);const n=N(t.schema.describe().meta?.rules,"required");if(!e||!n)return!0;return!!(e.from?.length>0&&e.to?.length>0)||t.createError({message:n?.errorMessage??om.DATE_RANGE.REQUIRED})}}).test({name:"is-date",test(e,t){const n=l?.find((e=>!!e&&"dateFormat"in e&&e.dateFormat));if(FL.exports.isEmpty(e?.from)||FL.exports.isEmpty(e?.to))return!0;return!(!O(e.from)||!O(e.to)||!sm.toLocalDateOrTime(e.from,u,"date")||!sm.toLocalDateOrTime(e.to,u,"date"))||t.createError({message:n?.errorMessage||om.DATE_RANGE.INVALID})}}).test({name:"number-of-days",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"numberOfDays"),r=n?.numberOfDays;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date");return!!sm.toLocalDateOrTime(e.to,u,"date").equals(i.plusDays(r-1))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_HAVE_NUMBER_OF_DAYS(r)})}}).test({name:"future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"future");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isAfter(bf.now())||!i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_FUTURE})}}).test({name:"past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"past");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(!r?.isBefore(bf.now())||!i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MUST_BE_PAST})}}).test({name:"not-future",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notFuture");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isAfter(bf.now())||i?.isAfter(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_FUTURE})}}).test({name:"not-past",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"notPast");if(!O(e.from)||!O(e.to)||!n)return!0;const r=sm.toLocalDateOrTime(e.from,u,"date"),i=sm.toLocalDateOrTime(e.to,u,"date");return!(r?.isBefore(bf.now())||i?.isBefore(bf.now()))||t.createError({message:n?.errorMessage??om.DATE_RANGE.CANNOT_BE_PAST})}}).test({name:"min-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"minDate"),r=n?.minDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isBefore(i)||o?.isBefore(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MIN_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"max-date",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"maxDate"),r=n?.maxDate,i=r?sm.toLocalDateOrTime(r,u,"date"):void 0;if(!O(e.from)||!O(e.to)||!i)return!0;const a=sm.toLocalDateOrTime(e.from,u,"date"),o=sm.toLocalDateOrTime(e.to,u,"date");return!(a?.isAfter(i)||o?.isAfter(i))||t.createError({message:n?.errorMessage??om.DATE_RANGE.MAX_DATE(sm.formatDateTime(r,"dd/MM/uuuu","date"))})}}).test({name:"excluded-dates",test(e,t){if("week"===d)return!0;const n=N(t.schema.describe().meta?.rules,"excludedDates"),r=n?.excludedDates;if(!O(e.from)||!O(e.to)||!r)return!0;const i=sm.toLocalDateOrTime(e.from,u,"date"),a=sm.toLocalDateOrTime(e.to,u,"date");try{const e=r.map((e=>sm.toLocalDateOrTime(e,u,"date")));for(const r of e)if(i.isEqual(r)||a.isEqual(r))return t.createError({message:n?.errorMessage??om.DATE_RANGE.DISABLED_DATES});return!0}catch{return!1}}}),l);const e=N(A,"future"),t=N(A,"past"),n=N(A,"notFuture"),r=N(A,"notPast"),i=N(A,"minDate"),o=N(A,"maxDate"),s=N(A,"excludedDates"),c=N(A,"numberOfDays"),f=sm.toLocalDateOrTime(i?.minDate,u,"date"),p=sm.toLocalDateOrTime(o?.maxDate,u,"date"),h=M([f,e?.future&&bf.now().plusDays(1),r?.notPast&&bf.now()]),m=T([p,t?.past&&bf.now().minusDays(1),n?.notFuture&&bf.now()]),g=s?.excludedDates,y=c?.numberOfDays;E((e=>({...e,minDate:h?.format(iz),maxDate:m?.format(iz),disabledDates:g,numberOfDays:y})))}),[l,A]),t.useEffect((()=>{C(nz.START)}),[p.from,u,o]),t.useEffect((()=>{C(nz.END)}),[p.to,u,o]);const T=e=>e.filter((e=>e)).sort(((e,t)=>e.isAfter(t)?1:-1))?.[0],M=e=>e.filter((e=>e)).sort(((e,t)=>e.isBefore(t)?1:-1))?.[0],O=e=>e&&e!==om.DATE_RANGE.INVALID,C=e=>{const t=e===nz.START?p.from:p.to,n=e===nz.START?y:v;if(u)if(t)if(O(t)){const e=sm.toLocalDateOrTime(t,u,"date");n(sm.formatDateTime(e?.toString(),rz,"date",om.DATE_RANGE.INVALID))}else n(om.DATE_RANGE.INVALID);else o||n(void 0)},N=(e,t)=>{const n=e?.find((e=>t in e)),r=l?.find((e=>!!e&&t in e));return FL.exports.isEmpty(n)?FL.exports.isEmpty(r)?void 0:r:n};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.DateRangeInput,{...f,...m,...b,id:a,"data-testid":exports.TestHelper.generateId(a,"date"),label:i,errorMessage:r?.message,onChange:(e,t)=>{s({target:{value:{from:sm.formatDateTime(e,u,"date",om.DATE_RANGE.INVALID),to:sm.formatDateTime(t,u,"date",om.DATE_RANGE.INVALID)}}})},value:g,valueEnd:_,variant:d}),e.jsx(YL,{id:a,message:h})]})},get TDateRangeInputType(){return nz},ESignatureField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,uiType:u,upload:c,validation:l,...d},value:f,warning:p}=n,[h,m]=t.useState(null),[g,y]=t.useState(0),[_,v]=t.useState(0),[b,E]=t.useState(null),{setFieldValidationConfig:S}=Nk(),A=t.useRef(null),{clearErrors:w}=xe();t.useEffect((()=>{const e=l?.find((e=>"upload"in e&&e.upload));A.current=e,S(a,Qw().shape({fileId:zx().required(),dataURL:zx(),fileUrl:zx(),uploadResponse:Cx().nullable()}).default(void 0),l)}),[l]),t.useEffect((()=>{if(v(0),M(f)){if(f.dataURL)m(f.dataURL);else if(f.fileUrl){const e=C(f.fileId,f.fileUrl);return()=>e.abort()}}else m(null)}),[f]);const T=async e=>{if(!e)return m(null),v(0),y(0),E(null),void o({target:{value:null}});const t=um();if(m(e),v(0),dE(c))o({target:{value:{fileId:t,dataURL:e}}});else try{const n=await O(t,e);o({target:{value:{fileId:t,..."base64"===c.type&&{dataURL:e},fileUrl:n?.data?.fileUrl,uploadResponse:n}}}),w(a),y(0)}catch(e){y((e=>e+1)),E(null)}},M=e=>!!e,O=async(e,t)=>{E(0);const n=new FormData;if(n.append("fileId",e),c.sessionId&&n.append("sessionId",c.sessionId),"base64"===c.type)n.append("dataURL",t);else if("multipart"===c.type){const r=await exports.FileHelper.dataUrlToBlob(t),i=exports.FileHelper.blobToFile(r,{name:e,lastModified:Date.now()});n.append("file",i,e)}const r=await new fl("",void 0,void 0,!0).post(c.url,n,{headers:{"Content-Type":"base64"===c.type?"application/json":"multipart/form-data",...c.headers},onUploadProgress:e=>{const{loaded:t,total:n}=e;E(t/n)}});return E(null),r},C=(e,t)=>{const n=new AbortController;return(async()=>{try{const r=await new fl("",void 0,void 0,!1,{responseType:"blob"}).get(t,{signal:n.signal}),i=await exports.FileHelper.getType(new File([r],e)),a=new File([r],e,{type:i.mime}),o=await exports.FileHelper.fileToDataUrl(a);m(o),v(0)}catch(e){if(e instanceof Kc)return;v((e=>e+1))}})(),n};return e.jsxs(az,{children:[e.jsx(x.Form.ESignature,{...d,id:a,label:i,onChange:T,value:h,...null!==b&&{loadingProgress:b}}),(r?.message||g||_)&&null===b?g>0?e.jsxs(oz,{children:[A.current?.errorMessage||om.ESIGNATURE.UPLOAD,e.jsx(sz,{type:"button",onClick:()=>T(h),children:"Please try again."}),g>=3&&e.jsx(uz,{type:"warning","data-testid":"upload-refresh-alert",children:"Refresh this page if you cannot upload your signature."})]}):_>0&&M(f)?e.jsxs(oz,{children:["Failed to load.",e.jsx(sz,{type:"button",onClick:()=>C(f.fileId,f.fileUrl),children:"Please try again."}),_>=3&&e.jsx(uz,{type:"warning","data-testid":"load-refresh-alert",children:"Refresh this page if your signature failed to load."})]}):e.jsx(oz,{children:r?.message}):null,e.jsx(YL,{id:a,message:p})]})},ErrorField:n=>{const{id:r,schema:{children:i}}=n,{setFieldValidationConfig:a}=Nk();return t.useEffect((()=>{a(r,Cx().test((()=>!1)),[])}),[]),i?e.jsx(iU,{children:i}):null},FileUploadInner:zz,FileUpload:t=>e.jsx(kz,{children:e.jsx(zz,{...t})}),get EFileStatus(){return exports.EFileStatus},HiddenField:n=>{const{id:r,name:i,onBlur:a,onChange:o,schema:{showIf:s,uiType:u,validation:c,valueType:l,value:d,...f},value:p}=n,{setFieldValidationConfig:h}=Nk(),{setValue:m}=xe();return t.useEffect((()=>{let e;switch(l){case"null":e=Cx();break;case"number":e=jx();break;case"boolean":e=Dx();break;default:e=zx()}h(r,e,c)}),[c,l]),t.useEffect((()=>{"null"===l&&null!==p?m(r,null):hE(d)||p===d||m(r,d)}),[m,r,l,d,p]),e.jsx("input",{onBlur:a,onChange:o,...f,type:"hidden",id:r,"data-testid":r,name:i,value:d??p??""})},HistogramSlider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,bins:u,interval:c,validation:l,disabled:d,readOnly:f,className:p,ariaLabels:h,customOptions:m},value:g,warning:y}=n,{resetField:_}=xe(),[v,b]=t.useState(void 0),{setFieldValidationConfig:E}=Nk();t.useEffect((()=>{if(g)b([g.from,g.to]);else{const e=Math.min(...u.map((e=>e.minValue))),t=Math.max(...u.map((e=>e.minValue)))+c;_(a,{defaultValue:{from:e,to:t},keepDirty:!0}),b([e,t])}}),[g]),t.useEffect((()=>{const e=l?.find((e=>"required"in e)),t=l?.find((e=>"bin"in e&&e.bin)),n=l?.find((e=>"incremental"in e&&e.incremental)),r=l?.find((e=>"withinRange"in e&&e.withinRange));E(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue)));return Number.isInteger((t-r)/c)&&Number.isInteger((n-r)/c)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...u.map((e=>e.minValue))),i=Math.max(...u.map((e=>e.minValue)))+c;return!(t<r||n>i)})),l)}),[l,u,c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.HistogramSlider,{...m,id:a,"data-testid":exports.TestHelper.generateId(a,"histogram-slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},value:v,bins:u,interval:c,disabled:d,readOnly:f,className:p,ariaLabels:h}),e.jsx(YL,{id:a,message:y})]})},ImageUploadInner:DZ,ImageUpload:t=>e.jsx(jz,{children:e.jsx(DZ,{...t})}),ACCEPTED_FILE_TYPES:Uz,get EImageStatus(){return exports.EImageStatus},LocationField:n=>{const{error:r,formattedLabel:i,id:o,schema:{className:s="location",mapApi:u,disabled:c,gettingCurrentLocationFetchMessage:l,interactiveMapPinIconUrl:d,label:f,locationInputPlaceholder:p,locationListTitle:h,locationModalStyles:m,mapBannerText:g,mapPanZoom:y,mustHavePostalCode:_,readOnly:v,staticMapPinColor:b,validation:E,hasExplicitEdit:S,locationSelectionMode:A="default",disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O},value:C,warning:N}=n,[D,L]=t.useState(!1),{setValue:I}=xe(),{setFieldValidationConfig:k}=Nk(),{dispatchFieldEvent:$,addFieldEventListener:R,removeFieldEventListener:F}=gI();t.useEffect((()=>(R("show-location-modal",o,j),()=>{F("show-location-modal",o,j)})),[]),t.useEffect((()=>{const e=E?.find((e=>"required"in e)),t=E?.find((e=>"postalCode"in e));k(o,Qw({address:zx(),blockNo:zx(),building:zx(),lat:jx(),lng:jx(),postalCode:zx(),roadName:zx(),x:jx(),y:jx()}).test("is-required",e?.errorMessage||om.COMMON.FIELD_REQUIRED,(t=>!e?.required||!!t&&!!t.lat&&!!t.lng)).test("must-have-postal-code",t?.errorMessage||om.LOCATION.MUST_HAVE_POSTAL_CODE,(t=>!e||!_||exports.LocationHelper.hasGotAddressValue(t.postalCode))),E)}),[E]);const z=(e,t=!0)=>{I(o,e,{shouldDirty:t})},P=()=>{v||c||(L(!0),$("show-location-modal",o))},j=()=>{L(!0)};return e.jsxs("div",{id:o,"data-testid":exports.TestHelper.generateId(o),className:s,children:[e.jsx(PZ,{id:o,label:i,className:s,locationInputPlaceholder:p,onChange:e=>e.currentTarget.blur(),onFocus:P,value:C?.address||"",errorMessage:r?.message,disabled:"explicit"===S&&!!C?.address||c,readOnly:v}),S&&C?.address&&e.jsx(a.Button.Default,{id:exports.TestHelper.generateId(o,"edit-button"),"data-testid":exports.TestHelper.generateId(o,"edit-button"),styleType:"secondary",onClick:()=>{!$("click-edit-button",o)||L(!0)},type:"button",children:"Edit"}),!!C?.lat&&!!C?.lng&&e.jsx(GL,{id:o,className:`${s}-static-map`,lat:C.lat,lng:C.lng,staticMapPinColor:b,onClick:P,disabled:c}),e.jsx(t.Suspense,{fallback:null,children:jZ&&e.jsx(jZ,{id:o,className:s,showLocationModal:D,onClose:()=>{L(!1),$("hide-location-modal",o)},formValues:C,onConfirm:z,updateFormValues:z,mapPanZoom:y,mapApi:u,interactiveMapPinIconUrl:d,gettingCurrentLocationFetchMessage:l,mustHavePostalCode:_,locationModalStyles:m,locationListTitle:h,mapBannerText:g,locationSelectionMode:A,disableSearch:x,addressFieldPlaceholder:w,searchBarIcon:T,bufferRadius:M,pinsOnlyIndicateCurrentLocation:O})}),e.jsx(YL,{id:o,message:N})]})},GeolocationPositionErrorWrapper:ZZ,MaskedField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:{label:u,uiType:c,validation:l,maskRegex:d,iconMask:f,iconUnmask:p,...h},warning:m,...g}=n,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Nk();t.useEffect((()=>{E(a,zx(),l);const e=l?.find((e=>"max"in e)),t=l?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n)}),[l]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]);const S=t=>{if(!t)return;const n=H[t];return e.jsx(n,{"data-testid":t})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MaskedInput,{...h,...g,...v,id:a,"data-testid":exports.TestHelper.generateId(a,c),label:i,onChange:e=>{o(e)},value:y,errorMessage:r?.message,maskRegex:(()=>{if(d)try{const e=d.match(/\/(.*)\/([a-z]+)?/);return new RegExp(e[1],e[2])}catch(e){console.warn(`invalid regex pattern: ${d}`)}})(),iconMask:S(f),iconUnmask:S(p)}),e.jsx(YL,{id:a,message:m})]})},MultiSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u=[],validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||[]),{setFieldValidationConfig:y}=Nk();t.useEffect((()=>{const e=c?.find((e=>"required"in e));y(a,tT().of(zx()).test("is-empty-array",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!t||!e?.required||t.length>0)),c)}),[c]),_s((()=>{const e=d?.filter((e=>u.find((t=>t.value===e))));h(a,e)}),[u]),t.useEffect((()=>{g(d||[])}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.MultiSelect,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOptions:e=>{const t=e.map((e=>e.value));o({target:{value:t}})},selectedOptions:u.filter((e=>m.includes(e.value))),valueExtractor:e=>e.value,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},OtpVerificationField:n=>{const{error:r,id:i,value:a,formattedLabel:o,onChange:s,warning:u,schema:{validation:c,request:l,verification:d,withPrefix:f,verifyOtpCountdownTimer:p,prefixSeparator:h,type:m,...g}}=n,[y,_]=t.useState(a?.otpCode||""),[v,b]=t.useState(a?.otpPrefix),E=t.useRef(a?.transactionId),S=t.useRef(-1),A=t.useRef(-1),w=a?.state||"default",T=a?.contact||"",M={number:"phone-number"===m?T:"",countryCode:"+65"},O=c?.find((e=>"otp-type"in e)),C=c?.find((e=>"required"in e)),{setFieldValidationConfig:N}=Nk(),{formState:D,setError:L,clearErrors:I}=xe(),{submitCount:k}=D;t.useEffect((()=>{N(i,Qw().test(UZ.IS_OTP_VERIFIED,C?.errorMessage||R(),(e=>!C?.required||"verified"===e?.state)),c)}),[c,w]);const $=async()=>{const e=O?.["otp-type"]??void 0;if("email"===e&&(t=T,!zx().required().email().isValidSync(t)))throw L(i,{type:UZ.IS_EMAIL_VALID,message:O?.errorMessage||om.OTP_VERIFICATION.INVALID_EMAIL}),new Error;var t;const n=`${M.countryCode}${M.number}`;if("phone-number"===e&&!(e=>QF.isSingaporeNumber(e))(n))throw L(i,{type:UZ.IS_PHONE_NUMBER_VALID,message:O?.errorMessage||om.OTP_VERIFICATION.INVALID_PHONE}),new Error;const r={type:m,..."email"===m?{email:T}:{phoneNo:n},...void 0!==f&&{withPrefix:f}},a=await new fl("",void 0,void 0,!0).post(l.endpoint.url,r).catch((e=>{const t=e?.message||om.OTP_VERIFICATION.SEND_OTP_FAILED;throw L(i,{type:UZ.SEND_OTP_FAILED,message:t}),new Error(t)})),o=a?.transactionId??a?.data?.transactionId,u=a?.prefix??a?.data?.prefix;E.current=o,u&&b(u),I(i),S.current=k,s({target:{value:{contact:"email"===e?T:M.number,otpPrefix:u??v,type:m,state:"sent"}}})},R=()=>"default"===w?"email"===m?om.OTP_VERIFICATION.EMAIL_VERIFICATION_REQUIRED:om.OTP_VERIFICATION.PHONE_VERIFICATION_REQUIRED:"sent"===w?om.OTP_VERIFICATION.OTP_REQUIRED:void 0,F={...g,id:i,"data-testid":exports.TestHelper.generateId(i,"otp-verification-field"),label:o,otpState:w,onOtpStateChange:e=>{"default"===e&&(_(""),b(void 0),E.current=void 0,s({target:{value:{...a,state:void 0,additionalData:void 0,otpPrefix:void 0}}}))},onSendOtp:$,onResendOtp:$,onVerifyOtp:async e=>{const t="email"===m?T:M.number,n=await new fl("",void 0,void 0,!0).post(d.endpoint.url,{transactionId:E.current,otp:e,otpPrefix:v}).catch((e=>{const t=e?.message||om.OTP_VERIFICATION.OTP_VERIFICATION_FAILED;throw L(i,{type:UZ.OTP_VERIFICATION_FAILED,message:t}),new Error(t)}));s({target:{value:{contact:t,otpPrefix:v,type:m,state:"verified",additionalData:n?.additionalData??n?.data?.additionalData}}})},sendOtpError:(()=>{if("sent"===w)return;if(r?.type===UZ.IS_EMAIL_VALID||r?.type===UZ.IS_PHONE_NUMBER_VALID||r?.type===UZ.SEND_OTP_FAILED)return r?.message;return D.isSubmitted&&k>A.current&&r?.type===UZ.IS_OTP_VERIFIED?r?.message:void 0})(),verifyOtpError:(()=>{if("sent"!==w)return;return r?.type===UZ.IS_OTP_VERIFIED&&k>S.current||r?.type===UZ.OTP_VERIFICATION_FAILED||r?.type===UZ.API_ERROR?r?.message:void 0})(),otpValue:{value:y,...v&&{prefix:v},...h&&{prefixSeparator:h}},onOtpChange:e=>{I(i),_(e)},...void 0!==l.placeholder&&{sendOtpPlaceholder:l.placeholder},...void 0!==p&&{verifyOtpCountdownTimer:p},...void 0!==d.showThumbnail&&{showVerifyOtpThumbnail:d.showThumbnail},...void 0!==d.title&&{verifyOtpTitle:d.title},...void 0!==d.message&&{verifyOtpMessage:d.message}};return e.jsxs(e.Fragment,{children:["email"===m?e.jsx(x.Form.OtpVerification,{...F,type:"email",emailValue:T,onEmailChange:e=>{A.current=k,I(i),s({target:{value:{...a,contact:e}}})}}):e.jsx(x.Form.OtpVerification,{...F,type:"phone-number",phoneNumberValue:M,onPhoneNumberChange:e=>{A.current=k,I(i);let t=e.number;e.number||(t=""),s({target:{value:{...a,contact:t}}})},fixedCountry:!0}),e.jsx(YL,{id:i,message:u})]})},get EOtpVerificationErrorType(){return UZ},NestedMultiSelect:n=>{const{schema:{label:r,validation:i,options:a=[],...o},id:s,value:u,formattedLabel:c,onChange:l,onBlur:d,error:f,warning:p,...h}=n,{setValue:m}=xe(),{setFieldValidationConfig:g}=Nk(),[y,_]=t.useState(u),[v,b]=t.useState([]),E=t.useCallback((e=>{const t=[],n=(e,r)=>{for(const i in e){const a=[...r,i],o=e[i];"string"==typeof o?t.push(a):n(o,a)}};return n(e,[]),t}),[]);t.useEffect((()=>{const e=i?.find((e=>"required"in e));g(s,Qw().test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTION,(t=>!e?.required||!!t&&!!Object.keys(t).length)),i)}),[i]),_s((()=>{const e=(t,n)=>{const r={};for(const i of t){const{key:t,subItems:a}=i,o=n[t];if(o){const n="string"==typeof o?o:e(a||[],o);Object.keys(n).length?r[t]=n:delete r[t]}}return r},t=u?e(a,u):u;m(s,t)}),[a]),t.useEffect((()=>{_(u);const e=E(u);b(e)}),[E,y,u]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.NestedMultiSelect,{...o,...h,id:s,"data-testid":exports.TestHelper.generateId(s),label:c,options:a,onSelectOptions:(e,t)=>{const n=((e,t)=>{const n={};return e.forEach(((e,r)=>{e.reduce(((n,i,a)=>(a===e.length-1?n[i]=t[r]:n[i]||(n[i]={}),n[i])),n)})),n})(e,t);l({target:{value:n}})},onBlur:d,selectedKeyPaths:v,errorMessage:f?.message}),e.jsx(YL,{id:s,message:p})]})},RadioButtonGroup:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,options:d,validation:f,...p},value:h,warning:m}=n,{setValue:g}=xe(),[y,_]=t.useState(h||""),{setFieldValidationConfig:v}=Nk();t.useEffect((()=>{v(a,zx(),f)}),[f]),ys((()=>{d.find((e=>e.value===h))||g(a,"")}),[d]),t.useEffect((()=>{_(h||"")}),[h]);const b=e=>{o({target:{value:e}})},E=e=>y===e,S=()=>{const e=um();return`${a}-${e}`},A=t=>"string"==typeof t?e.jsx(RL,{inline:!0,children:t}):e.jsx(iU,{children:t});return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:(()=>{switch(u?.styleType){case"toggle":return d.length>0&&"toggle"===u.styleType&&e.jsx(WZ,{className:s?`${s} ${s}-radio-container`:void 0,$layoutType:u?.layoutType??"horizontal",children:d.map(((n,i)=>{const o=S();return t.createElement(qZ,{...p,key:i,type:"radio",id:o,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??n.disabled,name:o,indicator:u?.indicator,styleType:!1===u?.border?"no-border":"default",checked:E(n.value),onChange:()=>b(n.value),error:!!r?.message,compositeSection:n.children?{children:e.jsx(iU,{children:n.children}),collapsible:!1}:null,subLabel:!!n.subLabel&&A(n.subLabel)},A(n.label))}))});case"image-button":return d.length>0&&e.jsx(YZ,{className:s?`${s} ${s}-radio-container`:void 0,children:d.map(((e,n)=>{const i=S();return t.createElement(HZ,{...p,type:"button",key:n,id:i,className:s?`${s}-radio`:void 0,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??e.disabled,name:i,selected:E(e.value),onClick:()=>b(e.value),imgSrc:e.imgSrc,error:!!r?.message},e.label)}))});default:return d.length>0&&d.map(((t,n)=>{const r=S();return e.jsxs(GZ,{className:s?`${s}-radio-container`:void 0,children:[e.jsx(VZ,{...p,className:s,id:r,"data-testid":exports.TestHelper.generateId(a,"radio"),disabled:c??t.disabled,name:r,value:t.value,checked:E(t.value),onChange:()=>b(t.value)}),e.jsx(BZ,{forwardedAs:"label",htmlFor:r,disabled:c??t.disabled,children:A(t.label)})]},n)}))}})()}),e.jsx(YL,{id:a,message:m})]})},RangeSelect:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d={from:void 0,to:void 0},warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d.from||""),[y,_]=t.useState(d.to||""),{setFieldValidationConfig:v}=Nk(),b=t.useRef(!1);t.useEffect((()=>{const e=c?.find((e=>"required"in e));v(a,Qw().shape({from:zx(),to:zx()}).test("is-empty-string",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e?.required||t.from?.length>0&&t.to?.length>0)),c)}),[c]),ys((()=>{const e={};u.from.find((e=>e.value===d.from))||(e.from=""),u.to.find((e=>e.value===d.to))||(e.to=""),h(a,{...d,...e})}),[u]),t.useEffect((()=>{_(d.from),g(d.to)}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.RangeSelect,{...l,...p,id:a,onHideOptions:()=>{b.current?b.current=!1:d.from&&d.to||o({target:{value:{from:void 0,to:void 0}}})},"data-testid":exports.TestHelper.generateId(a),label:i,options:u,onSelectOption:e=>{void 0===e.from&&void 0===e.to&&o({target:{value:{from:void 0,to:void 0}}}),e.from&&o({target:{value:{from:e.from.value,to:void 0}}}),e.to&&(b.current=!0,o({target:{value:{to:e.to.value,from:y}}}))},selectedOptions:{from:u.from.find((({value:e})=>e===y)),to:u.to.find((({value:e})=>e===m))},valueToStringFunction:e=>`${e.from} - ${e.to}`,valueExtractor:e=>({from:e.value,to:e.value}),displayValueExtractor:e=>e.label,listExtractor:e=>e.label,errorMessage:r?.message}),e.jsx(YL,{id:a,message:f})]})},ResetButton:t=>{const{id:n,schema:{disabled:r,ignoreDefaultValues:i,label:o,...s},...u}=t,{reset:c,getValues:l}=xe(),{resetFields:d}=Ck(),{formSchema:{defaultValues:f}}=Ok();return e.jsx(a.Button.Default,{...s,...u,disabled:r,"data-testid":n,id:n,type:"reset",onClick:()=>{if(i){const e=l();Object.entries(e).forEach((([t,n])=>{Hr(n)?e[t]=[]:a$(n)||aI(n)?e[t]="":Rr(n)&&(e[t]={})})),c(e),d(e)}else c(),d(f)},children:o})},Select:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,options:u,validation:c,...l},value:d,warning:f,...p}=n,{setValue:h}=xe(),[m,g]=t.useState(d||""),{setFieldValidationConfig:y}=Nk();t.useEffect((()=>{y(a,zx(),c)}),[c]),ys((()=>{u.find((e=>e.value===d))||h(a,"")}),[u]),t.useEffect((()=>{g(d||"")}),[d]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Select,{...l,...p,id:a,"data-testid":exports.TestHelper.generateId(a,"select"),label:i,errorMessage:r?.message,options:u,onSelectOption:(e,t)=>{o({target:{value:t}})},selectedOption:u.find((({value:e})=>e===m)),displayValueExtractor:e=>e.label,valueExtractor:e=>e.value,listExtractor:e=>e.label}),e.jsx(YL,{id:a,message:f})]})},SelectHistogram:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,validation:u,disabled:c,readOnly:l,className:d,histogramSlider:f,customOptions:p},value:h,warning:m,...g}=n,{bins:y,interval:_,...v}=f,{resetField:b}=xe(),[E,S]=t.useState([0,0]),{setFieldValidationConfig:A}=Nk();t.useEffect((()=>{if(h)S([h.from,h.to]);else{const e=Math.min(...y.map((e=>e.minValue))),t=Math.max(...y.map((e=>e.minValue)))+_;b(a,{defaultValue:{from:e,to:t},keepDirty:!0}),S([e,t])}}),[h]),t.useEffect((()=>{const e=u?.find((e=>"required"in e)),t=u?.find((e=>"bin"in e&&e.bin)),n=u?.find((e=>"incremental"in e&&e.incremental)),r=u?.find((e=>"withinRange"in e&&e.withinRange));A(a,Qw({from:jx(),to:jx()}).test("is-required",e?.errorMessage||om.COMMON.REQUIRED_OPTIONS,(t=>!t||!e||!hE(t.from)&&!hE(t.to))).test("is-bin",t?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue)));return Number.isInteger((t-r)/_)&&Number.isInteger((n-r)/_)})).test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>!e||"number"!=typeof e.from||"number"!=typeof e.to||e.from<e.to)).test("is-within-range",r?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(e=>{if(!e||"number"!=typeof e.from||"number"!=typeof e.to)return!0;const{from:t,to:n}=e,r=Math.min(...y.map((e=>e.minValue))),i=Math.max(...y.map((e=>e.minValue)))+_;return!(t<r||n>i)})),u)}),[u,y,_]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.SelectHistogram,{...g,id:a,"data-testid":exports.TestHelper.generateId(a,"select-histogram"),label:i,errorMessage:r?.message,onChangeEnd:e=>{const[t,n]=e;o({target:{value:{from:t,to:n}}})},disabled:c,readOnly:l,className:d,rangeLabelPrefix:p?.rangeLabelPrefix,rangeLabelSuffix:p?.rangeLabelSuffix,value:E,histogramSlider:{bins:y,interval:_,...v}}),e.jsx(YL,{id:a,message:m})]})},Slider:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{label:s,customOptions:u,validation:c,disabled:l,readOnly:d,className:f,ariaLabel:p},value:h,warning:m}=n,[g,y]=t.useState(),{setFieldValidationConfig:_}=Nk();t.useEffect((()=>{const e=c?.find((e=>"min"in e)),t=c?.find((e=>"max"in e)),n=c?.find((e=>"increment"in e));_(a,jx().test("is-incremental",n?.errorMessage||om.SLIDER.MUST_BE_INCREMENTAL,(t=>{if("number"!=typeof t||!n)return!0;const r=n.increment,i=(e?.min??0)-t;return Number.isInteger(i/r)})),c),(e||t||n)&&y({min:e?.min,max:t?.max,step:n?.increment})}),[c]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Slider,{...u,...g,id:a,"data-testid":exports.TestHelper.generateId(a,"slider"),label:i,errorMessage:r?.message,onChangeEnd:e=>{o({target:{value:e}})},value:h,disabled:l,readOnly:d,className:f,ariaLabel:p}),e.jsx(YL,{id:a,message:m})]})},SubmitButton:n=>{const{id:r,schema:{disabled:i,label:o,...s},...u}=n,{submitHandler:c,wrapInForm:l}=Dk(),{setFieldValidationConfig:d}=Nk(),{hardValidationSchema:f}=kk(),p=$e({disabled:"invalid-form"!==i}),[h,m]=t.useState(!0===i);t.useEffect((()=>{d(r,Cx())}),[]),t.useEffect((()=>{"invalid-form"!==i&&m(!!i)}),[i]),ys((()=>{(async()=>{if("invalid-form"===i)try{await f.validate(p),m(!1)}catch(e){m(!0)}})()}),[p,f]);return e.jsx(a.Button.Default,{...s,...u,disabled:h,"data-testid":r,id:r,onClick:e=>{l||(e.preventDefault(),c?.())},type:"submit",children:o})},Switch:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{className:s,customOptions:u,disabled:c,label:l,validation:d,...f},value:p,warning:h}=n,[m,g]=t.useState(p||void 0),{setFieldValidationConfig:y}=Nk();t.useEffect((()=>{y(a,Dx().strict(),d)}),[d]),t.useEffect((()=>{g(p)}),[p]);const _=e=>{o({target:{value:e}})},v=e=>m===e,b=e=>`${a}-${e}`;return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.CustomField,{id:a,label:i,errorMessage:r?.message,children:e.jsxs(KZ,{className:s,role:"radiogroup","aria-label":"string"==typeof l?l:$L(l.mainLabel,{allowedTags:[]}),children:[e.jsx(T.Toggle,{...f,type:"yes",id:b("yes"),"data-testid":exports.TestHelper.generateId(a,"switch-yes"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!0),onChange:()=>_(!0),indicator:!0,name:a,error:!!r?.message,children:"Yes"}),e.jsx(T.Toggle,{...f,type:"no",id:b("no"),"data-testid":exports.TestHelper.generateId(a,"switch-no"),disabled:c,styleType:!1===u?.border?"no-border":"default",checked:v(!1),onChange:()=>_(!1),indicator:!0,name:a,error:!!r?.message,children:"No"})]})}),e.jsx(YL,{id:a,message:h})]})},TextField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,value:s,schema:u,warning:c,...l}=n,{customOptions:d,inputMode:f,label:p,uiType:h,validation:m,...g}=u,[y,_]=t.useState(s||""),[v,b]=t.useState({}),{setFieldValidationConfig:E}=Nk(),S=t.useRef(null),A=t.useRef(0);t.useEffect((()=>{switch(h){case"numeric-field":{E(a,jx(),m);const e=m?.find((e=>"min"in e)),t=m?.find((e=>"max"in e)),n={...v};e?.min>0&&(n.min=e.min),t?.max>0&&(n.max=t.max),b(n);break}case"email-field":{const e=m?.find((e=>e.email));E(a,zx().email(e?.errorMessage||om.EMAIL.INVALID),m);const t=m?.find((e=>"max"in e)),n=m?.find((e=>"length"in e)),r={...v};t?.max>0?r.maxLength=t.max:n?.length>0&&(r.maxLength=n.length),b(r);break}case"text-field":{E(a,zx(),m);const e=m?.find((e=>"max"in e)),t=m?.find((e=>"length"in e)),n={...v};e?.max>0?n.maxLength=e.max:t?.length>0&&(n.maxLength=t.length),b(n);break}}}),[m]),t.useEffect((()=>{s!==y&&_(s||"")}),[s]),t.useEffect((()=>{"text-field"===h&&document?.activeElement===S.current&&S.current.selectionEnd!==A.current&&S.current.setSelectionRange(A.current,A.current)}),[y]),t.useEffect((()=>{"text-field"===u.uiType&&"uppercase"===u.customOptions?.textTransform&&y&&_((e=>e?.toString().toUpperCase()))}),["text-field"===u.uiType&&u.customOptions?.textTransform]);const w=()=>!!d?.addOn,T=w()?x.Form.InputGroup:x.Form.Input;return e.jsxs(e.Fragment,{children:[e.jsx(T,{...g,...l,...v,id:a,"data-testid":exports.TestHelper.generateId(a,h),ref:S,type:(()=>{switch(h){case"numeric-field":return"number";case"email-field":return"email";default:return"text"}})(),label:i,onPaste:e=>{const t=e.clipboardData.getData("text");(d?.preventCopyAndPaste||"numeric-field"===h&&/e/i.test(t))&&e.preventDefault()},onDrop:e=>d?.preventDragAndDrop?e.preventDefault():null,inputMode:(()=>{if(f)return f;switch(h){case"numeric-field":return"numeric";case"email-field":return"email";case"text-field":return"text";default:return"none"}})(),onChange:e=>{if("numeric-field"===h){const t=!isNaN(parseFloat(e.target.value))?+e.target.value:void 0;return o({target:{value:t}}),void _(t)}"text-field"===u.uiType?(A.current=e.target.selectionEnd,"uppercase"===u.customOptions?.textTransform&&(e.target.value=e.target.value.toUpperCase()),o(e)):o(e),_(e.target.value)},onKeyDown:e=>{"numeric-field"===h&&"e"===e.key.toLowerCase()&&e.preventDefault()},value:y,errorMessage:r?.message,addon:(()=>{if(w()){if("label"===d.addOn.type)return{type:"label",position:d.addOn.position,attributes:{value:d.addOn.value}};if("icon"===d.addOn.type){const{icon:t,position:n,color:r}=d.addOn,i=H[t];return{type:"custom",position:n,attributes:{children:e.jsx(JZ,{as:i,$color:r})}}}}})()}),e.jsx(YL,{id:a,message:c})]})},Textarea:G$,TimeField:n=>{const{error:r,formattedLabel:i,id:a,onChange:o,schema:{is24HourFormat:s,label:u,placeholder:c,useCurrentTime:l,validation:d,...f},value:p,warning:h,...m}=n,[g,y]=t.useState(p||""),{setFieldValidationConfig:_}=Nk();t.useEffect((()=>{_(a,zx(),d)}),[d]),t.useEffect((()=>{if(l&&!p){const e=s?"H:mm":"h:mma";setTimeout((()=>v(e)))}else y(p)}),[p,l,s]);const v=e=>{const t=sm.formatDateTime(Af.now().toString().toUpperCase(),e,"time");y(t),o({target:{value:t}})};return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.Timepicker,{...f,...m,id:a,"data-testid":exports.TestHelper.generateId(a,"time"),label:i,errorMessage:r?.message,value:g,placeholder:c,format:s?"24hr":"12hr",onChange:e=>{o({target:{value:e}})}}),e.jsx(YL,{id:a,message:h})]})},get EFieldType(){return exports.EFieldType},UnitNumberField:n=>{const{formattedLabel:r,error:i,id:a,onChange:o,schema:{label:s,validation:u,...c},value:l,warning:d,...f}=n,[p,h]=t.useState(l||""),{setFieldValidationConfig:m}=Nk();t.useEffect((()=>{const e=u?.find((e=>"unitNumberFormat"in e));m(a,zx().matches(/^([a-zA-Z0-9]{1,3}-[a-zA-Z0-9]{1,5})$/,{excludeEmptyString:!0,message:e?.errorMessage||om.UNIT_NUMBER.INVALID}),u)}),[u]),t.useEffect((()=>{h(l||"")}),[l]);return e.jsxs(e.Fragment,{children:[e.jsx(x.Form.UnitNumberInput,{...c,...f,id:a,"data-testid":exports.TestHelper.generateId(a,"unit-number"),label:r,value:p,onChange:e=>{o({target:{value:e}})},errorMessage:i?.message}),e.jsx(YL,{id:a,message:d})]})}});const eU=({id:t,children:n,childSchema:r})=>{if("columns"in r){if((i=r.columns)&&("xxs"in i||"xs"in i||"sm"in i||"md"in i||"lg"in i||"xl"in i||"xxl"in i)){const{xxs:i,xs:a,sm:o,md:s,lg:u,xl:c,xxl:d,...f}=r.columns||{};return e.jsx(l.Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),xlCols:c,lgCols:u,mdCols:s,smCols:o,xsCols:a,xxlCols:d,xxsCols:i,...f,children:n})}const{desktop:a,tablet:o,mobile:s,...u}=r.columns||{};return e.jsx(P.V2_Layout.ColDiv,{"data-testid":exports.TestHelper.generateId(t,"grid_item"),desktopCols:a??12,tabletCols:o,mobileCols:s,...u,children:n})}var i;return e.jsx(e.Fragment,{children:n})},tU=({id:n,renderRules:r,children:i,schema:a})=>{const{formValidationConfig:o,removeFieldValidationConfig:s}=Nk(),[u,c]=t.useState(void 0),{formValues:l}=Ck(),{unregister:d}=xe();_s((()=>{if(dE(r))return;const e=f();if(e!==u){if(!e){[n,...p(a)].forEach((e=>{s(e),d(e)}))}c(e)}}),[o,l,r]);const f=()=>{if(dE(r))return!0;let e=!1;return r.forEach((t=>{if(!e){const n={};Object.entries(t).forEach((([e,t])=>{if(t.find((e=>e.shown))&&!o?.[e])return void(n[e]={schema:Cx().test("shown",(()=>!1)),validationRules:[]});const r=o?.[e]?.schema.type;if(r){let i=KL.mapSchemaType(r);"number"===r&&(i=i.nullable().transform(((e,t)=>!isNaN(parseFloat(t?.toString()))?+t:void 0))),n[e]={schema:i,validationRules:t}}}));const r=KL.buildSchema(n);try{r.validateSync(l),e=!0}catch(e){}}})),e},p=e=>{const t=e.children,r=[];switch(e.uiType){case"chips":r.push(n+"-textarea");break;case"checkbox":case"radio":e.options.forEach((e=>{const t=e.children;!dE(t)&&un(t)&&Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))}))}))}return dE(t)||!un(t)||Object.entries(t).forEach((([e,t])=>{r.push(e),t.children&&r.push(...p(t.children))})),r};return dE(r)||u?e.jsx(e.Fragment,{children:i}):null},nU=Object.keys(exports.EFieldType),rU=Object.keys(exports.EElementType),iU=n=>{const{id:r,schema:i,children:a}=n,{showIf:o,uiType:s,children:u,...c}=i||{},{warnings:l}=kk(),[d,f]=t.useState(null),{control:p}=xe(),{getCustomComponent:h}=hI(),{formSchema:{overrides:m},overrideSchema:g}=Ok();mI((()=>{const n=g(u||a,m);if("object"==typeof n){const r=[];Object.keys(n).forEach((i=>{const a=n[i];if(dE(a)||"object"!=typeof a)return;let o=e.jsx(t.Fragment,{children:om.GENERIC.UNSUPPORTED},i);if("referenceKey"in a){const n=a.referenceKey.toUpperCase();o=h(a.referenceKey)||p$[f$[n]]?y(i,a)(_):p$[d$[n]]?y(i,a)(v):e.jsx(t.Fragment,{},i)}else"uiType"in a&&(nU.includes(a.uiType.toUpperCase())?o=y(i,a)(_):rU.includes(a.uiType.toUpperCase())&&(o=y(i,a)(v)));r.push(o)})),f(r)}else f("string"==typeof n?n:om.GENERIC.UNSUPPORTED)}),[u||a,m,p,l,h]);const y=(t,n)=>r=>e.jsx(tU,{id:t,...n&&"showIf"in n&&{renderRules:n.showIf},schema:n,children:r(t,n)},t),_=(t,n)=>{let r;return"uiType"in n?r=QZ[exports.EFieldType[n.uiType?.toUpperCase()]]:"referenceKey"in n&&(r=p$[f$[n.referenceKey?.toUpperCase()]]||h(n.referenceKey)),r?e.jsx(eU,{id:t,childSchema:n,children:e.jsx(j$,{id:t,schema:n,Field:r,warning:l?.[t]})}):null},v=(t,n)=>{let r;return"uiType"in n?r=Yk[exports.EElementType[n.uiType?.toUpperCase()]]||iU:"referenceKey"in n&&(r=p$[d$[n.referenceKey?.toUpperCase()]]),e.jsx(eU,{id:t,childSchema:n,children:e.jsx(r,{schema:n,id:t})})},b=s;return b?e.jsx(b,{...c,id:r,"data-testid":exports.TestHelper.generateId(r,s),children:d}):e.jsx(e.Fragment,{children:d})},aU=V.default(l.Layout.Container)`
|
|
1103
1104
|
gap: ${n.Spacing["spacing-32"]};
|
|
1104
|
-
`,
|
|
1105
|
+
`,oU=V.default(l.Layout.Container)`
|
|
1105
1106
|
gap: ${n.Spacing["spacing-32"]};
|
|
1106
1107
|
display: grid;
|
|
1107
1108
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
@@ -1113,7 +1114,7 @@ object-assign
|
|
|
1113
1114
|
${p.V2_MediaQuery.MaxWidth.mobileL} {
|
|
1114
1115
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
1115
1116
|
}
|
|
1116
|
-
`,
|
|
1117
|
+
`,sU=V.default.div`
|
|
1117
1118
|
flex: 1;
|
|
1118
|
-
`,
|
|
1119
|
-
//# sourceMappingURL=index.
|
|
1119
|
+
`,uU=t=>{const{sectionSchema:{children:n,layoutType:r,customOptions:i={gridType:"v2"}},...a}=t;switch(r){case"grid":return(()=>{const t="v3"===i.gridType?aU:oU,r="v3"===i.gridType?"grid":"flex";return e.jsx(l.Layout.Section,{children:e.jsx(t,{type:r,children:e.jsx(iU,{...a,children:n})})})})();case"contain":return e.jsx(l.Layout.Content,{children:e.jsx(sU,{children:e.jsx(iU,{...a,children:n})})});default:return e.jsx(iU,{...a,children:n})}},cU=()=>{const{formSchema:{sections:t,overrides:n},overrideSchema:r}=Ok();return e.jsx(e.Fragment,{children:(()=>{const i=r(t,n);return i?Object.entries(i).map((([t,n],r)=>e.jsx(uU,{id:t,sectionSchema:n},`section-${r}`))):e.jsxs(e.Fragment,{children:["Unable to render Frontend Engine schema, make sure schema is declared within ",e.jsx("code",{children:"sections"}),"."]})})()})},lU=t.forwardRef(((n,r)=>{const{data:i,className:a=null,components:o,onSubmit:s,onSubmitError:u,wrapInForm:c=!0}=n,{className:l=null,defaultValues:d,id:f,stripUnknown:p,revalidationMode:h="onChange",validationMode:m="onTouched"}=i||{},{addFieldEventListener:g,dispatchFieldEvent:y,removeFieldEventListener:_}=gI(),{setCustomComponents:v}=hI(),{setSubmitHandler:b,setWrapInForm:E}=Dk(),{addWarnings:S,performSoftValidation:A,softValidationSchema:x,hardValidationSchema:w,rebuildValidationSchema:T,yupId:M}=kk(),O=function(e={}){const t=U.default.useRef(void 0),n=U.default.useRef(void 0),[r,i]=U.default.useState({isDirty:!1,isValidating:!1,isLoading:Be(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Be(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={..._t(e),formState:r});const a=t.current.control;return a._options=e,De({subject:a._subjects.state,next:e=>{Oe(e,a._proxyFormState,a._updateFormState,!0)&&i({...a._formState})}}),U.default.useEffect((()=>a._disableForm(e.disabled)),[a,e.disabled]),U.default.useEffect((()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==r.isDirty&&a._subjects.state.next({isDirty:e})}}),[a,r.isDirty]),U.default.useEffect((()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,a._options.resetOptions),n.current=e.values,i((e=>({...e})))):a._resetDefaultValues()}),[e.values,a]),U.default.useEffect((()=>{e.errors&&a._setErrors(e.errors)}),[e.errors,a]),U.default.useEffect((()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()})),U.default.useEffect((()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})}),[e.shouldUnregister,a]),t.current.formState=Te(r,a),t.current}({mode:m,reValidateMode:h,defaultValues:d,resolver:async(e,t,n)=>(A(x,e),await function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),function(r,i,a){try{return Promise.resolve(function(o,s){try{var u=(t.context&&"development"===process.env.NODE_ENV&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e["sync"===n.mode?"validateSync":"validate"](r,Object.assign({abortEarly:!1},t,{context:i}))).then((function(e){return a.shouldUseNativeValidation&&bt({},a),{values:n.rawValues?r:e,errors:{}}})))}catch(e){return s(e)}return u&&u.then?u.then(void 0,s):u}(0,(function(e){if(!e.inner)throw e;return{values:{},errors:Et((t=e,n=!a.shouldUseNativeValidation&&"all"===a.criteriaMode,(t.inner||[]).reduce((function(e,t){if(e[t.path]||(e[t.path]={message:t.message,type:t.type}),n){var r=e[t.path].types,i=r&&r[t.type];e[t.path]=Fe(t.path,n,e,t.type,i?[].concat(i,t.message):t.message)}return e}),{})),a)};var t,n})))}catch(e){return Promise.reject(e)}}}(w)(e,t,n))}),{setFormSchema:C}=Ok(),{reset:N,handleSubmit:D,getValues:L,setValue:I,setError:k,trigger:$,formState:R,clearErrors:F}=O,{resetFields:z,setFields:P,getFormValues:j,registeredFields:Z}=Ck(O),B=t.useRef(Z),{checkIsFormValid:V}=((e,n)=>{const{data:r,onChange:i,onValueChange:a}=e,{stripUnknown:o}=r||{},{hardValidationSchema:s}=kk(),{formValidationConfig:u}=Nk(),{watch:c,getValues:l,formState:d,clearErrors:f}=n,{setFields:p,setField:h,getFormValues:m}=Ck(n),[g,y]=t.useState({}),[_,v]=t.useState(!1),b=Ik(u),E=Ik(s),S=t.useRef(void 0),A=t.useRef(void 0),x=t.useCallback(((e=!1)=>{if(!e)try{return s.validateSync(l()),!0}catch(e){return!1}return(async()=>{try{return await s.validate(l()),!0}catch(e){return!1}})()}),[l,s]),w=t.useRef((async()=>{}));return w.current=async()=>{const e=m(void 0,o),t=await x(!0);a&&Object.keys(u||{}).length&&(A.current===t&&tI(S.current,e)||a(e,t)),S.current=e,A.current=t},t.useEffect((()=>{const e=c(((e,{name:t})=>{t?h(t,e[t]):p(e)}));return()=>e.unsubscribe()}),[]),t.useEffect((()=>{if(i&&Object.keys(u||{}).length){const e=c((async()=>{const e=await x(!0);i(m(void 0,o),e)}));return x(!0).then((e=>i(m(void 0,o),e))),()=>e.unsubscribe()}}),[x,i,c,u]),t.useEffect((()=>{const e=c((async()=>{await w.current()}));return()=>e.unsubscribe()}),[c]),t.useEffect((()=>{if(b){const e=e=>Object.entries(e).map((([e,{validationRules:t}])=>[e,t])),t=e(b),n=e(u);tI(t,n)||v(!0)}}),[u]),t.useEffect((()=>{_&&E!==s&&w.current().then((()=>v(!1)))}),[_,s]),t.useEffect((()=>{const e=d.errors;if(e&&!dE(e)){const e=c((e=>{const t=Object.fromEntries(Object.entries(d.errors).filter((([e,t])=>"api"===t.type)));t&&!dE(t)&&Object.keys(t).forEach((t=>{g[t]!==e[t]&&f(t)})),y(e)}));return()=>e.unsubscribe()}}),[d,c]),{checkIsFormValid:x}})(n,O);t.useImperativeHandle(r,(()=>({addFieldEventListener:g,addCustomValidation:H,dispatchFieldEvent:y,getValues:e=>j(e,p),isDirty:R.isDirty,isValid:V,validate:$,removeFieldEventListener:_,reset:(e,t)=>{N(e,t),z("function"==typeof e?e(O.getValues())??d:e??d)},setErrors:W,clearErrors:F,setWarnings:q,setValue:I,submit:D(G,Y)})));const H=(e,t,n,r=!1)=>{KL.addCondition(e,t,n,M,r),T()},G=t.useCallback((()=>{s?.(j(void 0,p))}),[j,s,p]),Y=t.useCallback((e=>{setTimeout((()=>u?.(e)))}),[u]),W=e=>{Object.entries(e).forEach((([e,t])=>{B.current.includes(e)&&(Array.isArray(t)?k(e,{type:"api",message:t[0]}):k(e,"object"==typeof t?{type:"api",message:JSON.stringify(t)}:{type:"api",message:t}))}))},q=e=>{const t={};Object.entries(e).forEach((([e,n])=>{B.current.includes(e)&&(t[e]=n)})),S(t)};t.useEffect((()=>{P(L())}),[]),_s((()=>{N(ds(d))}),[d]),ys((()=>{C(i)}),[i||{}]),t.useEffect((()=>{v(o)}),[o]),t.useEffect((()=>{b((()=>D(G,Y)))}),[G,Y]),t.useEffect((()=>{E(c)}),[c]),t.useEffect((()=>{B.current=Z}),[Z]);const K=f?`frontend-engine-${f}`:"frontend-engine",J=[a,l].join(" ").trim(),X=c?"form":"div";return i?e.jsx(we,{...O,children:e.jsx(X,{id:K,"data-testid":f?exports.TestHelper.generateId(f,"frontend-engine"):K,className:J,noValidate:!0,onSubmit:D(G,Y),ref:r,children:e.jsx(cU,{})})}):e.jsxs(e.Fragment,{children:["Missing ",e.jsx("code",{children:"data"})," prop, unable to render Frontend Engine."]})})),dU=t.forwardRef(((t,n)=>e.jsx(pI,{recaptchaSiteKey:t.recaptchaSiteKey,children:e.jsx(lU,{...t,ref:n})})));exports.AxiosApiClient=fl,exports.Description=gT,exports.ERROR_MESSAGES=om,exports.FileUploadContext=Iz,exports.FrontendEngine=dU,exports.GeolocationPositionErrorWrapper=ZZ,exports.ImageContext=Pz,exports.OneMapError=UL,exports.OneMapService=jL,exports.Prompt=_T,exports.RecaptchaContext=Ds,exports.Sanitize=RL,exports.commonjsGlobal=St,exports.generateRandomId=um,exports.lodash=FL,exports.useFieldEvent=gI,exports.useFormContext=xe,exports.useFrontendEngineComponent=()=>{const{addFieldEventListener:e,dispatchFieldEvent:t,removeFieldEventListener:n}=gI(),r=xe(),{setFieldValidationConfig:i,removeFieldValidationConfig:a}=Nk();return{event:{addFieldEventListener:e,dispatchFieldEvent:t,removeFieldEventListener:n},formContext:r,validation:{setValidation:i,removeValidation:a}}},exports.usePrevious=Ik,exports.useWindowHelper=$k;
|
|
1120
|
+
//# sourceMappingURL=index.17761159.js.map
|