@salla.sa/twilight-components 2.14.304 → 2.14.305
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/dist/cjs/{filepond-CSRZHHLr.js → filepond-CGAkApL-.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-poster-HbvHQ4xC.js → filepond-plugin-file-poster-DYFFANjm.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-size-MBHCj7aE.js → filepond-plugin-file-validate-size-BtBMyItP.js} +1 -1
- package/dist/cjs/{filepond-plugin-file-validate-type-f9k8C7xL.js → filepond-plugin-file-validate-type-GEqsaFeg.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-edit-C27nfWyY.js → filepond-plugin-image-edit-BL8FuIZG.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-exif-orientation-BVIWVV_U.js → filepond-plugin-image-exif-orientation-BO_s8dgb.js} +1 -1
- package/dist/cjs/{filepond-plugin-image-preview-DDZAVPrI.js → filepond-plugin-image-preview-D1PeMZgA.js} +1 -1
- package/dist/cjs/{index-iL6M6R0b.js → index-BLIAsiFR.js} +2 -2
- package/dist/cjs/{index-CA0dkTAr.js → index-DqxvZ_dy.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-accordion_62.cjs.entry.js +9 -9
- package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
- package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
- package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
- package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
- package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
- package/dist/cjs/salla-filters.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
- package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
- package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-orders.cjs.entry.js +1 -1
- package/dist/cjs/salla-payments.cjs.entry.js +1 -1
- package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
- package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
- package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
- package/dist/cjs/salla-social.cjs.entry.js +1 -1
- package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
- package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
- package/dist/cjs/salla-verify.cjs.entry.js +1 -1
- package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/esm/{filepond-BK3ryZ4O.js → filepond-Cmwauemw.js} +1 -1
- package/dist/esm/{filepond-plugin-file-poster-CXrGQn3f.js → filepond-plugin-file-poster-BiHq23PZ.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-size-TbV5jS_i.js → filepond-plugin-file-validate-size-ACFA-aZw.js} +1 -1
- package/dist/esm/{filepond-plugin-file-validate-type-Ddr49QTv.js → filepond-plugin-file-validate-type-CoLjBvRi.js} +1 -1
- package/dist/esm/{filepond-plugin-image-edit-Cl1HLh6D.js → filepond-plugin-image-edit-WEb_gBFl.js} +1 -1
- package/dist/esm/{filepond-plugin-image-exif-orientation-sh8N6lBS.js → filepond-plugin-image-exif-orientation-CX72KA0b.js} +1 -1
- package/dist/esm/{filepond-plugin-image-preview-CnbbixEI.js → filepond-plugin-image-preview-D3MDyjxO.js} +1 -1
- package/dist/esm/{index-BK1JdIAs.js → index-09rQwPEf.js} +2 -2
- package/dist/esm/{index-7Vj3wCbC.js → index-BrA22FUH.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-accordion_62.entry.js +9 -9
- package/dist/esm/salla-advertisement.entry.js +1 -1
- package/dist/esm/salla-app-install-alert.entry.js +1 -1
- package/dist/esm/salla-apps-icons.entry.js +1 -1
- package/dist/esm/salla-cart-item-offers.entry.js +1 -1
- package/dist/esm/salla-conditional-offer.entry.js +1 -1
- package/dist/esm/salla-contacts.entry.js +1 -1
- package/dist/esm/salla-custom-fields.entry.js +1 -1
- package/dist/esm/salla-filters-widget.entry.js +1 -1
- package/dist/esm/salla-filters.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
- package/dist/esm/salla-loyalty-program.entry.js +1 -1
- package/dist/esm/salla-metadata.entry.js +1 -1
- package/dist/esm/salla-notification-item.entry.js +1 -1
- package/dist/esm/salla-notifications.entry.js +1 -1
- package/dist/esm/salla-offer.entry.js +1 -1
- package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
- package/dist/esm/salla-order-details-options.entry.js +1 -1
- package/dist/esm/salla-order-details.entry.js +1 -1
- package/dist/esm/salla-order-summary.entry.js +1 -1
- package/dist/esm/salla-order-totals-card.entry.js +1 -1
- package/dist/esm/salla-orders.entry.js +1 -1
- package/dist/esm/salla-payments.entry.js +1 -1
- package/dist/esm/salla-price-range.entry.js +1 -1
- package/dist/esm/salla-review-card.entry.js +1 -1
- package/dist/esm/salla-reviews-page.entry.js +1 -1
- package/dist/esm/salla-reviews.entry.js +1 -1
- package/dist/esm/salla-social.entry.js +1 -1
- package/dist/esm/salla-tiered-offer.entry.js +1 -1
- package/dist/esm/salla-tooltip.entry.js +1 -1
- package/dist/esm/salla-trust-badges.entry.js +1 -1
- package/dist/esm/salla-verify.entry.js +1 -1
- package/dist/esm/salla-wallet.entry.js +1 -1
- package/dist/esm/twilight.js +2 -2
- package/dist/twilight/{p-4b8a857a.entry.js → p-05f6c6ba.entry.js} +1 -1
- package/dist/twilight/{p-BK1JdIAs.js → p-09rQwPEf.js} +2 -2
- package/dist/twilight/{p-c831c409.entry.js → p-0aa95e1e.entry.js} +1 -1
- package/dist/twilight/{p-5523f5f7.entry.js → p-20f27ca5.entry.js} +1 -1
- package/dist/twilight/{p-b0453703.entry.js → p-218a9eb2.entry.js} +1 -1
- package/dist/twilight/{p-a279bd07.entry.js → p-302a4e27.entry.js} +1 -1
- package/dist/twilight/{p-b2f7cc05.entry.js → p-352c96bd.entry.js} +1 -1
- package/dist/twilight/{p-3d230249.entry.js → p-3bcb3760.entry.js} +1 -1
- package/dist/twilight/{p-8736f3c4.entry.js → p-3e0508dc.entry.js} +1 -1
- package/dist/twilight/{p-dfd482e1.entry.js → p-480b46b6.entry.js} +1 -1
- package/dist/twilight/{p-600b8139.entry.js → p-52021ccb.entry.js} +1 -1
- package/dist/twilight/{p-94ee77ce.entry.js → p-5341d148.entry.js} +1 -1
- package/dist/twilight/{p-0cc20e03.entry.js → p-57520514.entry.js} +1 -1
- package/dist/twilight/{p-d9f33b22.entry.js → p-57aa0484.entry.js} +1 -1
- package/dist/twilight/{p-498a3cf6.entry.js → p-5b7fa291.entry.js} +1 -1
- package/dist/twilight/{p-b961be06.entry.js → p-5e96a2f6.entry.js} +1 -1
- package/dist/twilight/{p-aeb1875a.entry.js → p-62f245c1.entry.js} +1 -1
- package/dist/twilight/{p-5f9af57c.entry.js → p-69603ed4.entry.js} +1 -1
- package/dist/twilight/{p-a516b95f.entry.js → p-714fa08b.entry.js} +1 -1
- package/dist/twilight/{p-93a6f914.entry.js → p-717fafd1.entry.js} +1 -1
- package/dist/twilight/{p-f4dce389.entry.js → p-73072d04.entry.js} +2 -2
- package/dist/twilight/{p-e1238ad0.entry.js → p-76d9eaa3.entry.js} +1 -1
- package/dist/twilight/{p-446d1563.entry.js → p-8332a8ef.entry.js} +1 -1
- package/dist/twilight/{p-2d82b640.entry.js → p-8433e94f.entry.js} +1 -1
- package/dist/twilight/{p-91ff6fe9.entry.js → p-9d1346f5.entry.js} +1 -1
- package/dist/twilight/{p-BIUEEJFB.js → p-BCHGvsP5.js} +1 -1
- package/dist/twilight/{p-CNb5qGJ_.js → p-BF067TIH.js} +1 -1
- package/dist/twilight/{p-BLLbA40U.js → p-BgYaybbS.js} +1 -1
- package/dist/twilight/{p-CV8Smdt8.js → p-BssKqCoe.js} +1 -1
- package/dist/twilight/{p-Dl88tie_.js → p-D7JM1EWO.js} +1 -1
- package/dist/twilight/{p-TcYs-K6G.js → p-Dd-AI-4W.js} +1 -1
- package/dist/twilight/{p-DoKdTjbN.js → p-Dd-pZ28X.js} +1 -1
- package/dist/twilight/{p-DQlR80Sd.js → p-Di6S6G0K.js} +1 -1
- package/dist/twilight/{p-6b2af464.entry.js → p-a0242896.entry.js} +1 -1
- package/dist/twilight/{p-df4a99db.entry.js → p-aeb3e351.entry.js} +1 -1
- package/dist/twilight/{p-019ac8fd.entry.js → p-b01fdd25.entry.js} +1 -1
- package/dist/twilight/{p-16ea5bcd.entry.js → p-bc00393d.entry.js} +1 -1
- package/dist/twilight/{p-70f2ed1b.entry.js → p-d1d77250.entry.js} +1 -1
- package/dist/twilight/p-e53b912e.entry.js +4 -0
- package/dist/twilight/{p-ebadb30e.entry.js → p-e7e1f61b.entry.js} +1 -1
- package/dist/twilight/{p-b99d93ab.entry.js → p-f4d28445.entry.js} +1 -1
- package/dist/twilight/{p-013fce72.entry.js → p-fc82cede.entry.js} +1 -1
- package/dist/twilight/{p-619a5831.entry.js → p-fd157d55.entry.js} +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/package.json +5 -5
- package/dist/twilight/p-f93fea41.entry.js +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as A}from"./p-
|
|
4
|
+
import{d as A}from"./p-09rQwPEf.js";function n(A,n){return n.forEach((function(n){n&&"string"!=typeof n&&!Array.isArray(n)&&Object.keys(n).forEach((function(e){if("default"!==e&&!(e in A)){var r=Object.getOwnPropertyDescriptor(n,e);Object.defineProperty(A,e,r.get?r:{enumerable:!0,get:function(){return n[e]}})}}))})),Object.freeze(A)}var e,r={exports:{}},i=(e||(e=1,r.exports=function(){var A=65496,n=65505,e=1165519206,r=18761,i=274,t=65280,o=function(A,n){return A.getUint16(n,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},a=function(A,n){return A.getUint32(n,arguments.length>2&&void 0!==arguments[2]&&arguments[2])},f="undefined"!=typeof window&&void 0!==window.document,u=void 0,d=f?new Image:{};d.onload=function(){return u=d.naturalWidth>d.naturalHeight},d.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";var c=function(f){var d=f.utils,c=d.Type,v=d.isFile;return(0,f.addFilter)("DID_LOAD_ITEM",(function(f,d){var c=d.query;return new Promise((function(d){var w=f.file;if(!(v(w)&&function(A){return/^image\/jpeg/.test(A.type)}(w)&&c("GET_ALLOW_IMAGE_EXIF_ORIENTATION")&&u))return d(f);(function(f){return new Promise((function(u){var d=new FileReader;d.onload=function(f){var d=new DataView(f.target.result);if(o(d,0)===A){for(var c=d.byteLength,v=2;v<c;){var w=o(d,v);if(v+=2,w===n){if(a(d,v+=2)!==e)break;var g=o(d,v+=6)===r;v+=a(d,v+4,g);var l=o(d,v,g);v+=2;for(var p=0;p<l;p++)if(o(d,v+12*p,g)===i)return void u(o(d,v+12*p+8,g))}else{if((w&t)!==t)break;v+=o(d,v)}}u(-1)}else u(-1)},d.readAsArrayBuffer(f.slice(0,65536))}))})(w).then((function(A){f.setMetadata("exif",{orientation:A}),d(f)}))}))})),{options:{allowImageExifOrientation:[!0,c.BOOLEAN]}}};return"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:c})),c}()),r.exports),t=n({__proto__:null,default:A(i)},[i]);
|
|
5
5
|
/*!
|
|
6
6
|
* FilePondPluginImageExifOrientation 1.0.11
|
|
7
7
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as e}from"./p-
|
|
4
|
+
import{d as e}from"./p-09rQwPEf.js";function E(e,E){return E.forEach((function(E){E&&"string"!=typeof E&&!Array.isArray(E)&&Object.keys(E).forEach((function(i){if("default"!==i&&!(i in e)){var _=Object.getOwnPropertyDescriptor(E,i);Object.defineProperty(e,i,_.get?_:{enumerable:!0,get:function(){return E[i]}})}}))})),Object.freeze(e)}var i,_,l={exports:{}},n=i?l.exports:(i=1,l.exports=(_=function(e){var E=e.addFilter,i=e.utils,_=i.Type,l=i.replaceInString,n=i.toNaturalFileSize;return E("ALLOW_HOPPER_ITEM",(function(e,E){var i=E.query;if(!i("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var _=i("GET_MAX_FILE_SIZE");if(null!==_&&e.size>_)return!1;var l=i("GET_MIN_FILE_SIZE");return!(null!==l&&e.size<l)})),E("LOAD_FILE",(function(e,E){var i=E.query;return new Promise((function(E,_){if(!i("GET_ALLOW_FILE_SIZE_VALIDATION"))return E(e);var t=i("GET_FILE_VALIDATE_SIZE_FILTER");if(t&&!t(e))return E(e);var I=i("GET_MAX_FILE_SIZE");if(null!==I&&e.size>I)_({status:{main:i("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MAX_FILE_SIZE"),{filesize:n(I,".",i("GET_FILE_SIZE_BASE"),i("GET_FILE_SIZE_LABELS",i))})}});else{var L=i("GET_MIN_FILE_SIZE");if(null!==L&&e.size<L)_({status:{main:i("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MIN_FILE_SIZE"),{filesize:n(L,".",i("GET_FILE_SIZE_BASE"),i("GET_FILE_SIZE_LABELS",i))})}});else{var a=i("GET_MAX_TOTAL_FILE_SIZE");if(null!==a&&i("GET_ACTIVE_ITEMS").reduce((function(e,E){return e+E.fileSize}),0)>a)return void _({status:{main:i("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:l(i("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:n(a,".",i("GET_FILE_SIZE_BASE"),i("GET_FILE_SIZE_LABELS",i))})}});E(e)}}}))})),{options:{allowFileSizeValidation:[!0,_.BOOLEAN],maxFileSize:[null,_.INT],minFileSize:[null,_.INT],maxTotalFileSize:[null,_.INT],fileValidateSizeFilter:[null,_.FUNCTION],labelMinFileSizeExceeded:["File is too small",_.STRING],labelMinFileSize:["Minimum file size is {filesize}",_.STRING],labelMaxFileSizeExceeded:["File is too large",_.STRING],labelMaxFileSize:["Maximum file size is {filesize}",_.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",_.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",_.STRING]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_})),_)),t=E({__proto__:null,default:e(n)},[n]);
|
|
5
5
|
/*!
|
|
6
6
|
* FilePondPluginFileValidateSize 2.2.8
|
|
7
7
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as e}from"./p-
|
|
4
|
+
import{d as e}from"./p-09rQwPEf.js";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var E=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,E.get?E:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}var n,E,i={exports:{}},r=n?i.exports:(n=1,i.exports=(E=function(e){var t=e.addFilter,n=e.utils,E=n.Type,i=n.isString,r=n.replaceInString,T=n.guesstimateMimeType,u=n.getExtensionFromFilename,o=n.getFilenameFromURL,_=function(e,t){return e.some((function(e){return/\*$/.test(e)?(n=e,(/^[^/]+/.exec(t)||[]).pop()===n.slice(0,-2)):e===t;var n}))},a=function(e,t,n){if(0===t.length)return!0;var E=function(e){var t="";if(i(e)){var n=o(e),E=u(n);E&&(t=T(E))}else t=e.type;return t}(e);return n?new Promise((function(i,r){n(e,E).then((function(e){_(t,e)?i():r()})).catch(r)})):_(t,E)};return t("SET_ATTRIBUTE_TO_OPTION_MAP",(function(e){return Object.assign(e,{accept:"acceptedFileTypes"})})),t("ALLOW_HOPPER_ITEM",(function(e,t){var n=t.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||a(e,n("GET_ACCEPTED_FILE_TYPES"))})),t("LOAD_FILE",(function(e,t){var n=t.query;return new Promise((function(t,E){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var i=n("GET_ACCEPTED_FILE_TYPES"),T=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),u=a(e,i,T),o=function(){var e,t=i.map((e=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(t){return null!==e[t]&&(e[t]||t)})).filter((function(e){return!1!==e})),T=t.filter((function(e,n){return t.indexOf(e)===n}));E({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:r(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:T.join(", "),allButLastType:T.slice(0,-1).join(", "),lastType:T[t.length-1]})}})};if("boolean"==typeof u)return u?t(e):o();u.then((function(){t(e)})).catch(o)}else t(e)}))})),{options:{allowFileTypeValidation:[!0,E.BOOLEAN],acceptedFileTypes:[[],E.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",E.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",E.STRING],fileValidateTypeLabelExpectedTypesMap:[{},E.OBJECT],fileValidateTypeDetectType:[null,E.FUNCTION]}}},"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:E})),E)),T=t({__proto__:null,default:e(r)},[r]);
|
|
5
5
|
/*!
|
|
6
6
|
* FilePondPluginFileValidateType 1.2.8
|
|
7
7
|
* Licensed under MIT, https://opensource.org/licenses/MIT/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{d as i}from"./p-BK1JdIAs.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,s,n,a={exports:{}};var r,o=n?s:(n=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var s=t[e];t[e]={name:s[0],iso2:s[1],dialCode:s[2],priority:s[3]||0,areaCodes:s[4]||null}}function n(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var s=e.call(t,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),s=0;s<e.length;s++)t(e[s],i[e[s]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var s=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var n=t||{};this.options={},l(h,(function(i,t){s.options[i]=n.hasOwnProperty(i)?n[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return s=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,s){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var n=0;n<this.countryCodes[e].length;n++)if(this.countryCodes[e][n]===t)return;this.countryCodes[e][s!==i?s:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var s=this.countries[e];if(s.areaCodes)for(var n=this.countryCodes[s.dialCode][0],a=0;a<s.areaCodes.length;a++){for(var r=s.areaCodes[a],o=1;o<r.length;o++){var h=s.dialCode+r.substr(0,o);this._addCountryCode(n,h),this._addCountryCode(s.iso2,h)}this._addCountryCode(s.iso2,s.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var s=document.createElement(i);return t&&l(t,(function(i,t){return s.setAttribute(i,t)})),e&&e.appendChild(s),s}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,s=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),s&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||s||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},s=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&s.push.apply(s,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),s.forEach((function(t){n(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),s&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var s=0;s<i.length;s++){var n=i[s],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(n.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":n.dialCode,"data-country-code":n.iso2,"aria-selected":"false"},this.countryList);n.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(n.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(n.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(n.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,s=this._getDialCode(e),n=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;s&&!n?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):s&&n?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,s=t.top+e,n=this.dropdownContent.offsetHeight,a=s+this.telInput.offsetHeight+n<e+window.innerHeight,r=!this.options.countrySearch&&!a&&s-n>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(s+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",s=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),s&&clearTimeout(s),e+=t.key.toLowerCase(),i._searchForCountry(e),s=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var n=null;this._handleSearchChange=function(){n&&clearTimeout(n),n=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),n=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],s=!0;this.countryList.innerHTML="";for(var n=0;n<this.countries.length;n++){var a=this.countries[n],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),s&&(this._highlightListItem(a.node,!1),s=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,s=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?s.NATIONAL:s.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,s=this.selectedCountryData.dialCode;e&&"1"===s&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&s&&"+"!==e.charAt(0)&&(e="+".concat(s).concat(e));var n=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(n){var o=this.countryCodes[this._getNumeric(n)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=n.length-1;if(!("1"===s&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,s){for(var n=e?t:this.countries,a=0;a<n.length;a++)if(n[a].iso2===i)return n[a];if(s)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,s=t.separateDialCode,n=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),n&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,s),s){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var s=e.offsetWidth;return i.parentNode.removeChild(i),s}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,s=window.pageYOffset||document.documentElement.scrollTop,n=e.offsetHeight,a=e.getBoundingClientRect().top+s,r=a+n,o=i.offsetHeight,h=i.getBoundingClientRect().top+s,u=h+o,l=h-a+e.scrollTop,c=n/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(n-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,s="+".concat(i);if("+"===e.charAt(0)){var n=this._getDialCode(e);t=n?e.replace(n,s):s,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?s+e:s)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var s="",n=0;n<i.length;n++){var a=i.charAt(n);if(!isNaN(parseInt(a,10))){if(s+=a,t)this.countryCodes[s]&&(e=i.substr(0,n+1));else if(this.dialCodes[s]){e=i.substr(0,n+1);break}if(s.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var s=t[e];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,a(s.key),s)}}(s.prototype,r),Object.defineProperty(s,"prototype",{writable:!1}),e;var s,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var s=document.createElement("script");s.onload=function(){c("handleUtils"),t&&t()},s.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},s.className="iti-load-utils",s.async=!0,s.src=i,document.body.appendChild(s)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),s=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}
|
|
4
|
+
import{d as i}from"./p-09rQwPEf.js";function t(i,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(e){if("default"!==e&&!(e in i)){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}}))})),Object.freeze(i)}var e,n,s,a={exports:{}};var r,o=s?n:(s=1,e||(e=1,r=function(i){return function(){for(var t=[["Afghanistan","af","93"],["Albania","al","355"],["Algeria","dz","213"],["American Samoa","as","1",5,["684"]],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1",6,["264"]],["Antigua & Barbuda","ag","1",7,["268"]],["Argentina","ar","54"],["Armenia","am","374"],["Aruba","aw","297"],["Ascension Island","ac","247"],["Australia","au","61",0],["Austria","at","43"],["Azerbaijan","az","994"],["Bahamas","bs","1",8,["242"]],["Bahrain","bh","973"],["Bangladesh","bd","880"],["Barbados","bb","1",9,["246"]],["Belarus","by","375"],["Belgium","be","32"],["Belize","bz","501"],["Benin","bj","229"],["Bermuda","bm","1",10,["441"]],["Bhutan","bt","975"],["Bolivia","bo","591"],["Bosnia & Herzegovina","ba","387"],["Botswana","bw","267"],["Brazil","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1",11,["284"]],["Brunei","bn","673"],["Bulgaria","bg","359"],["Burkina Faso","bf","226"],["Burundi","bi","257"],["Cambodia","kh","855"],["Cameroon","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","263","289","306","343","354","365","367","368","382","387","403","416","418","428","431","437","438","450","584","468","474","506","514","519","548","579","581","584","587","604","613","639","647","672","683","705","709","742","753","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde","cv","238"],["Caribbean Netherlands","bq","599",1,["3","4","7"]],["Cayman Islands","ky","1",12,["345"]],["Central African Republic","cf","236"],["Chad","td","235"],["Chile","cl","56"],["China","cn","86"],["Christmas Island","cx","61",2,["89164"]],["Cocos (Keeling) Islands","cc","61",1,["89162"]],["Colombia","co","57"],["Comoros","km","269"],["Congo - Brazzaville","cg","242"],["Congo - Kinshasa","cd","243"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus","cy","357"],["Czech Republic","cz","420"],["Denmark","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1",13,["767"]],["Dominican Republic","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea","gq","240"],["Eritrea","er","291"],["Estonia","ee","372"],["Eswatini","sz","268"],["Ethiopia","et","251"],["Falkland Islands","fk","500"],["Faroe Islands","fo","298"],["Fiji","fj","679"],["Finland","fi","358",0],["France","fr","33"],["French Guiana","gf","594"],["French Polynesia","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia","ge","995"],["Germany","de","49"],["Ghana","gh","233"],["Gibraltar","gi","350"],["Greece","gr","30"],["Greenland","gl","299"],["Grenada","gd","1",14,["473"]],["Guadeloupe","gp","590",0],["Guam","gu","1",15,["671"]],["Guatemala","gt","502"],["Guernsey","gg","44",1,["1481","7781","7839","7911"]],["Guinea","gn","224"],["Guinea-Bissau","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong","hk","852"],["Hungary","hu","36"],["Iceland","is","354"],["India","in","91"],["Indonesia","id","62"],["Iran","ir","98"],["Iraq","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2,["1624","74576","7524","7924","7624"]],["Israel","il","972"],["Italy","it","39",0],["Jamaica","jm","1",4,["876","658"]],["Japan","jp","81"],["Jersey","je","44",3,["1534","7509","7700","7797","7829","7937"]],["Jordan","jo","962"],["Kazakhstan","kz","7",1,["33","7"]],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait","kw","965"],["Kyrgyzstan","kg","996"],["Laos","la","856"],["Latvia","lv","371"],["Lebanon","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya","ly","218"],["Liechtenstein","li","423"],["Lithuania","lt","370"],["Luxembourg","lu","352"],["Macau","mo","853"],["Madagascar","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania","mr","222"],["Mauritius","mu","230"],["Mayotte","yt","262",1,["269","639"]],["Mexico","mx","52"],["Micronesia","fm","691"],["Moldova","md","373"],["Monaco","mc","377"],["Mongolia","mn","976"],["Montenegro","me","382"],["Montserrat","ms","1",16,["664"]],["Morocco","ma","212",0],["Mozambique","mz","258"],["Myanmar (Burma)","mm","95"],["Namibia","na","264"],["Nauru","nr","674"],["Nepal","np","977"],["Netherlands","nl","31"],["New Caledonia","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea","kp","850"],["North Macedonia","mk","389"],["Northern Mariana Islands","mp","1",17,["670"]],["Norway","no","47",0],["Oman","om","968"],["Pakistan","pk","92"],["Palau","pw","680"],["Palestine","ps","970"],["Panama","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru","pe","51"],["Philippines","ph","63"],["Poland","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar","qa","974"],["Réunion","re","262",0],["Romania","ro","40"],["Russia","ru","7",0],["Rwanda","rw","250"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé & Príncipe","st","239"],["Saudi Arabia","sa","966"],["Senegal","sn","221"],["Serbia","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1",21,["721"]],["Slovakia","sk","421"],["Slovenia","si","386"],["Solomon Islands","sb","677"],["Somalia","so","252"],["South Africa","za","27"],["South Korea","kr","82"],["South Sudan","ss","211"],["Spain","es","34"],["Sri Lanka","lk","94"],["St Barthélemy","bl","590",1],["St Helena","sh","290"],["St Kitts & Nevis","kn","1",18,["869"]],["St Lucia","lc","1",19,["758"]],["St Martin","mf","590",2],["St Pierre & Miquelon","pm","508"],["St Vincent & Grenadines","vc","1",20,["784"]],["Sudan","sd","249"],["Suriname","sr","597"],["Svalbard & Jan Mayen","sj","47",1,["79"]],["Sweden","se","46"],["Switzerland","ch","41"],["Syria","sy","963"],["Taiwan","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad & Tobago","tt","1",22,["868"]],["Tunisia","tn","216"],["Turkey","tr","90"],["Turkmenistan","tm","993"],["Turks & Caicos Islands","tc","1",23,["649"]],["Tuvalu","tv","688"],["Uganda","ug","256"],["Ukraine","ua","380"],["United Arab Emirates","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["US Virgin Islands","vi","1",24,["340"]],["Uzbekistan","uz","998"],["Vanuatu","vu","678"],["Vatican City","va","39",1,["06698"]],["Venezuela","ve","58"],["Vietnam","vn","84"],["Wallis & Futuna","wf","681"],["Western Sahara","eh","212",1,["5288","5289"]],["Yemen","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1,["18"]]],e=0;e<t.length;e++){var n=t[e];t[e]={name:n[0],iso2:n[1],dialCode:n[2],priority:n[3]||0,areaCodes:n[4]||null}}function s(i,t,e){return(t=a(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function a(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(e!==i){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}var r={getInstance:function(i){var t=i.getAttribute("data-intl-tel-input-id");return window.intlTelInputGlobals.instances[t]},instances:{},documentReady:function(){return"complete"===document.readyState}};"object"==typeof window&&(window.intlTelInputGlobals=r);var o=0,h={allowDropdown:!0,autoInsertDialCode:!1,autoPlaceholder:"polite",countrySearch:!1,customContainer:"",customPlaceholder:null,dropdownContainer:null,excludeCountries:[],fixDropdownWidth:!1,formatOnDisplay:!0,geoIpLookup:null,hiddenInput:"",initialCountry:"",localizedCountries:null,nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,showFlags:!0,useFullscreenPopup:"undefined"!=typeof navigator&&"undefined"!=typeof window&&(/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<=500),utilsScript:""},u=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"],l=function(i,t){for(var e=Object.keys(i),n=0;n<e.length;n++)t(e[n],i[e[n]])},c=function(i){l(window.intlTelInputGlobals.instances,(function(t){window.intlTelInputGlobals.instances[t][i]()}))},d=function(){function e(i,t){var n=this;!function(i,t){if(!(i instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=o++,this.telInput=i,this.activeItem=null,this.highlightedItem=null;var s=t||{};this.options={},l(h,(function(i,t){n.options[i]=s.hasOwnProperty(i)?s[i]:t})),this.hadInitialPlaceholder=Boolean(i.getAttribute("placeholder"))}return n=e,r=[{key:"_init",value:function(){var i=this;if(this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!1),this.options.countrySearch&&!this.options.useFullscreenPopup&&(this.options.fixDropdownWidth=!0),this.options.nationalMode&&(this.options.autoInsertDialCode=!1),this.options.separateDialCode&&(this.options.autoInsertDialCode=!1),!this.options.showFlags&&this.options.allowDropdown&&!this.options.separateDialCode&&(this.options.showFlags=!0),this.options.useFullscreenPopup&&!this.options.dropdownContainer&&(this.options.dropdownContainer=document.body),this.isRTL=!!this.telInput.closest("[dir=rtl]"),"undefined"!=typeof Promise){var t=new Promise((function(t,e){i.resolveAutoCountryPromise=t,i.rejectAutoCountryPromise=e})),e=new Promise((function(t,e){i.resolveUtilsScriptPromise=t,i.rejectUtilsScriptPromise=e}));this.promise=Promise.all([t,e])}else this.resolveAutoCountryPromise=this.rejectAutoCountryPromise=function(){},this.resolveUtilsScriptPromise=this.rejectUtilsScriptPromise=function(){};this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests()}},{key:"_processCountryData",value:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries(),this.options.localizedCountries&&this._translateCountriesByLocale(),(this.options.onlyCountries.length||this.options.localizedCountries)&&this.countries.sort(this._countryNameSort)}},{key:"_addCountryCode",value:function(t,e,n){e.length>this.countryCodeMaxLen&&(this.countryCodeMaxLen=e.length),this.countryCodes.hasOwnProperty(e)||(this.countryCodes[e]=[]);for(var s=0;s<this.countryCodes[e].length;s++)if(this.countryCodes[e][s]===t)return;this.countryCodes[e][n!==i?n:this.countryCodes[e].length]=t}},{key:"_processAllCountries",value:function(){if(this.options.onlyCountries.length){var i=this.options.onlyCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(t){return i.indexOf(t.iso2)>-1}))}else if(this.options.excludeCountries.length){var e=this.options.excludeCountries.map((function(i){return i.toLowerCase()}));this.countries=t.filter((function(i){return-1===e.indexOf(i.iso2)}))}else this.countries=t}},{key:"_translateCountriesByLocale",value:function(){for(var i=0;i<this.countries.length;i++){var t=this.countries[i].iso2.toLowerCase();this.options.localizedCountries.hasOwnProperty(t)&&(this.countries[i].name=this.options.localizedCountries[t])}}},{key:"_countryNameSort",value:function(i,t){return i.name<t.name?-1:i.name>t.name?1:0}},{key:"_processCountryCodes",value:function(){this.countryCodeMaxLen=0,this.dialCodes={},this.countryCodes={};for(var i=0;i<this.countries.length;i++){var t=this.countries[i];this.dialCodes[t.dialCode]||(this.dialCodes[t.dialCode]=!0),this._addCountryCode(t.iso2,t.dialCode,t.priority)}for(var e=0;e<this.countries.length;e++){var n=this.countries[e];if(n.areaCodes)for(var s=this.countryCodes[n.dialCode][0],a=0;a<n.areaCodes.length;a++){for(var r=n.areaCodes[a],o=1;o<r.length;o++){var h=n.dialCode+r.substr(0,o);this._addCountryCode(s,h),this._addCountryCode(n.iso2,h)}this._addCountryCode(n.iso2,n.dialCode+r)}}}},{key:"_processPreferredCountries",value:function(){this.preferredCountries=[];for(var i=0;i<this.options.preferredCountries.length;i++){var t=this.options.preferredCountries[i].toLowerCase(),e=this._getCountryData(t,!1,!0);e&&this.preferredCountries.push(e)}}},{key:"_createEl",value:function(i,t,e){var n=document.createElement(i);return t&&l(t,(function(i,t){return n.setAttribute(i,t)})),e&&e.appendChild(n),n}},{key:"_generateMarkup",value:function(){this.telInput.classList.add("iti__tel-input"),this.telInput.hasAttribute("autocomplete")||this.telInput.form&&this.telInput.form.hasAttribute("autocomplete")||this.telInput.setAttribute("autocomplete","off");var i=this.options,t=i.allowDropdown,e=i.separateDialCode,n=i.showFlags,a=i.customContainer,r=i.hiddenInput,o=i.dropdownContainer,h=i.fixDropdownWidth,u=i.useFullscreenPopup,l=i.countrySearch,c="iti";t&&(c+=" iti--allow-dropdown"),e&&(c+=" iti--separate-dial-code"),n&&(c+=" iti--show-flags"),a&&(c+=" ".concat(a));var d=this._createEl("div",{class:c});this.telInput.parentNode.insertBefore(d,this.telInput);var f=t||n||e;if(f&&(this.flagsContainer=this._createEl("div",{class:"iti__flag-container"},d)),d.appendChild(this.telInput),f&&(this.selectedFlag=this._createEl("div",function(i){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e).filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.forEach((function(t){s(i,t,e[t])}))}return i}({class:"iti__selected-flag"},t&&{role:"combobox","aria-haspopup":"listbox","aria-controls":"iti-".concat(this.id,"__country-listbox"),"aria-expanded":"false","aria-label":"Telephone country code"}),this.flagsContainer)),n&&(this.selectedFlagInner=this._createEl("div",{class:"iti__flag"},this.selectedFlag)),this.selectedFlag&&this.telInput.disabled&&this.selectedFlag.setAttribute("aria-disabled","true"),e&&(this.selectedDialCode=this._createEl("div",{class:"iti__selected-dial-code"},this.selectedFlag)),t)if(this.telInput.disabled||this.selectedFlag.setAttribute("tabindex","0"),this.dropdownArrow=this._createEl("div",{class:"iti__arrow"},this.selectedFlag),this.dropdownContent=this._createEl("div",{class:"iti__dropdown-content iti__hide ".concat(h?"":"iti--flexible-dropdown-width")}),l&&(this.searchInput=this._createEl("input",{type:"text",class:"iti__search-input",placeholder:"Search"},this.dropdownContent)),this.countryList=this._createEl("ul",{class:"iti__country-list",id:"iti-".concat(this.id,"__country-listbox"),role:"listbox","aria-label":"List of countries"},this.dropdownContent),this.preferredCountries.length&&!l&&(this._appendListItems(this.preferredCountries,"iti__preferred",!0),this._createEl("li",{class:"iti__divider","aria-hidden":"true"},this.countryList)),this._appendListItems(this.countries,"iti__standard"),o){var v="iti iti--container";u&&(v+=" iti--fullscreen-popup"),l&&(v+=" iti--country-search"),this.dropdown=this._createEl("div",{class:v}),this.dropdown.appendChild(this.dropdownContent)}else this.flagsContainer.appendChild(this.dropdownContent);if(r){var p=r,y=this.telInput.getAttribute("name");if(y){var m=y.lastIndexOf("[");-1!==m&&(p="".concat(y.substr(0,m),"[").concat(p,"]"))}this.hiddenInput=this._createEl("input",{type:"hidden",name:p}),d.appendChild(this.hiddenInput)}}},{key:"_appendListItems",value:function(i,t,e){for(var n=0;n<i.length;n++){var s=i[n],a=e?"-preferred":"",r=this._createEl("li",{id:"iti-".concat(this.id,"__item-").concat(s.iso2).concat(a),class:"iti__country ".concat(t),tabindex:"-1",role:"option","data-dial-code":s.dialCode,"data-country-code":s.iso2,"aria-selected":"false"},this.countryList);s.node=r;var o="";this.options.showFlags&&(o+="<div class='iti__flag-box'><div class='iti__flag iti__".concat(s.iso2,"'></div></div>")),o+="<span class='iti__country-name'>".concat(s.name,"</span>"),o+="<span class='iti__dial-code'>+".concat(s.dialCode,"</span>"),r.insertAdjacentHTML("beforeend",o)}}},{key:"_setInitialState",value:function(){var i=this.telInput.getAttribute("value"),t=this.telInput.value,e=!i||"+"!==i.charAt(0)||t&&"+"===t.charAt(0)?t:i,n=this._getDialCode(e),s=this._isRegionlessNanp(e),a=this.options,r=a.initialCountry,o=a.autoInsertDialCode;n&&!s?this._updateFlagFromNumber(e):"auto"!==r&&(r&&this._getCountryData(r,!1,!0)?this._setFlag(r.toLowerCase()):n&&s?this._setFlag("us"):(this.defaultCountry=this.preferredCountries.length?this.preferredCountries[0].iso2:this.countries[0].iso2,e||this._setFlag(this.defaultCountry)),!e&&o&&(this.telInput.value="+".concat(this.selectedCountryData.dialCode))),e&&this._updateValFromNumber(e)}},{key:"_initListeners",value:function(){this._initKeyListeners(),this.options.autoInsertDialCode&&this._initBlurListeners(),this.options.allowDropdown&&this._initDropdownListeners(),this.hiddenInput&&this._initHiddenInputListener()}},{key:"_initHiddenInputListener",value:function(){var i=this;this._handleHiddenInputSubmit=function(){i.hiddenInput.value=i.getNumber()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleHiddenInputSubmit)}},{key:"_getClosestLabel",value:function(){for(var i=this.telInput;i&&"LABEL"!==i.tagName;)i=i.parentNode;return i}},{key:"_initDropdownListeners",value:function(){var i=this;this._handleLabelClick=function(t){i.dropdownContent.classList.contains("iti__hide")?i.telInput.focus():t.preventDefault()};var t=this._getClosestLabel();t&&t.addEventListener("click",this._handleLabelClick),this._handleClickSelectedFlag=function(){!i.dropdownContent.classList.contains("iti__hide")||i.telInput.disabled||i.telInput.readOnly||i._showDropdown()},this.selectedFlag.addEventListener("click",this._handleClickSelectedFlag),this._handleFlagsContainerKeydown=function(t){i.dropdownContent.classList.contains("iti__hide")&&["ArrowUp","ArrowDown"," ","Enter"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),i._showDropdown()),"Tab"===t.key&&i._closeDropdown()},this.flagsContainer.addEventListener("keydown",this._handleFlagsContainerKeydown)}},{key:"_initRequests",value:function(){var i=this;this.options.utilsScript&&!window.intlTelInputUtils?window.intlTelInputGlobals.documentReady()?window.intlTelInputGlobals.loadUtils(this.options.utilsScript):window.addEventListener("load",(function(){window.intlTelInputGlobals.loadUtils(i.options.utilsScript)})):this.resolveUtilsScriptPromise(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.resolveAutoCountryPromise()}},{key:"_loadAutoCountry",value:function(){window.intlTelInputGlobals.autoCountry?this.handleAutoCountry():window.intlTelInputGlobals.startedLoadingAutoCountry||(window.intlTelInputGlobals.startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup((function(i){window.intlTelInputGlobals.autoCountry=i.toLowerCase(),setTimeout((function(){return c("handleAutoCountry")}))}),(function(){return c("rejectAutoCountryPromise")})))}},{key:"_initKeyListeners",value:function(){var i=this;this._handleKeyupEvent=function(){i._updateFlagFromNumber(i.telInput.value)&&i._triggerCountryChange()},this.telInput.addEventListener("keyup",this._handleKeyupEvent),this._handleClipboardEvent=function(){setTimeout(i._handleKeyupEvent)},this.telInput.addEventListener("cut",this._handleClipboardEvent),this.telInput.addEventListener("paste",this._handleClipboardEvent)}},{key:"_cap",value:function(i){var t=this.telInput.getAttribute("maxlength");return t&&i.length>t?i.substr(0,t):i}},{key:"_initBlurListeners",value:function(){var i=this;this._handleSubmitOrBlurEvent=function(){i._removeEmptyDialCode()},this.telInput.form&&this.telInput.form.addEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.addEventListener("blur",this._handleSubmitOrBlurEvent)}},{key:"_removeEmptyDialCode",value:function(){if("+"===this.telInput.value.charAt(0)){var i=this._getNumeric(this.telInput.value);i&&this.selectedCountryData.dialCode!==i||(this.telInput.value="")}}},{key:"_getNumeric",value:function(i){return i.replace(/\D/g,"")}},{key:"_trigger",value:function(i){var t=document.createEvent("Event");t.initEvent(i,!0,!0),this.telInput.dispatchEvent(t)}},{key:"_showDropdown",value:function(){this.options.fixDropdownWidth&&(this.dropdownContent.style.width="".concat(this.telInput.offsetWidth,"px")),this.dropdownContent.classList.remove("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","true"),this._setDropdownPosition(),this.options.countrySearch?(this._highlightListItem(this.countryList.firstElementChild,!1),this.searchInput.focus()):this.activeItem&&(this._highlightListItem(this.activeItem,!1),this._scrollTo(this.activeItem,!0)),this._bindDropdownListeners(),this.dropdownArrow.classList.add("iti__arrow--up"),this._trigger("open:countrydropdown")}},{key:"_toggleClass",value:function(i,t,e){e&&!i.classList.contains(t)?i.classList.add(t):!e&&i.classList.contains(t)&&i.classList.remove(t)}},{key:"_setDropdownPosition",value:function(){var i=this;if(this.options.dropdownContainer&&this.options.dropdownContainer.appendChild(this.dropdown),!this.options.useFullscreenPopup){var t=this.telInput.getBoundingClientRect(),e=window.pageYOffset||document.documentElement.scrollTop,n=t.top+e,s=this.dropdownContent.offsetHeight,a=n+this.telInput.offsetHeight+s<e+window.innerHeight,r=!this.options.countrySearch&&!a&&n-s>e;this._toggleClass(this.dropdownContent,"iti__dropdown-content--dropup",r),this.options.dropdownContainer&&(this.dropdown.style.top="".concat(n+(r?0:this.telInput.offsetHeight),"px"),this.dropdown.style.left="".concat(t.left+document.body.scrollLeft,"px"),this._handleWindowScroll=function(){return i._closeDropdown()},window.addEventListener("scroll",this._handleWindowScroll))}}},{key:"_getClosestListItem",value:function(i){for(var t=i;t&&t!==this.countryList&&!t.classList.contains("iti__country");)t=t.parentNode;return t===this.countryList?null:t}},{key:"_bindDropdownListeners",value:function(){var i=this;this._handleMouseoverCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._highlightListItem(e,!1)},this.countryList.addEventListener("mouseover",this._handleMouseoverCountryList),this._handleClickCountryList=function(t){var e=i._getClosestListItem(t.target);e&&i._selectListItem(e)},this.countryList.addEventListener("click",this._handleClickCountryList);var t=!0;this._handleClickOffToClose=function(){t||i._closeDropdown(),t=!1},document.documentElement.addEventListener("click",this._handleClickOffToClose);var e="",n=null;if(this._handleKeydownOnDropdown=function(t){["ArrowUp","ArrowDown","Enter","Escape"].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key?i._handleUpDownKey(t.key):"Enter"===t.key?i._handleEnterKey():"Escape"===t.key&&i._closeDropdown()),!i.options.countrySearch&&/^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(t.key)&&(t.stopPropagation(),n&&clearTimeout(n),e+=t.key.toLowerCase(),i._searchForCountry(e),n=setTimeout((function(){e=""}),1e3))},document.addEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch){var s=null;this._handleSearchChange=function(){s&&clearTimeout(s),s=setTimeout((function(){var t;(t=i.searchInput.value.trim())?i._filterCountries(t.toLowerCase()):i._filterCountries(null,!0),s=null}),100)},this.searchInput.addEventListener("input",this._handleSearchChange),this.searchInput.addEventListener("click",(function(i){return i.stopPropagation()}))}}},{key:"_filterCountries",value:function(t){var e=arguments.length>1&&arguments[1]!==i&&arguments[1],n=!0;this.countryList.innerHTML="";for(var s=0;s<this.countries.length;s++){var a=this.countries[s],r=a.name.toLowerCase(),o="+".concat(a.dialCode);(e||r.includes(t)||o.includes(t))&&(this.countryList.appendChild(a.node),n&&(this._highlightListItem(a.node,!1),n=!1))}}},{key:"_handleUpDownKey",value:function(i){var t="ArrowUp"===i?this.highlightedItem.previousElementSibling:this.highlightedItem.nextElementSibling;t?t.classList.contains("iti__divider")&&(t="ArrowUp"===i?t.previousElementSibling:t.nextElementSibling):this.countryList.childElementCount>1&&(t="ArrowUp"===i?this.countryList.lastElementChild:this.countryList.firstElementChild),t&&(this._highlightListItem(t,!this.options.countrySearch),this.options.countrySearch&&this._scrollTo(t,!1))}},{key:"_handleEnterKey",value:function(){this.highlightedItem&&this._selectListItem(this.highlightedItem)}},{key:"_searchForCountry",value:function(i){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,i)){var e=this.countries[t].node;this._highlightListItem(e,!1),this._scrollTo(e,!0);break}}},{key:"_startsWith",value:function(i,t){return i.substr(0,t.length).toLowerCase()===t}},{key:"_updateValFromNumber",value:function(i){var t=i;if(this.options.formatOnDisplay&&window.intlTelInputUtils&&this.selectedCountryData){var e=this.options.nationalMode||"+"!==t.charAt(0)&&!this.options.separateDialCode,n=intlTelInputUtils.numberFormat;t=intlTelInputUtils.formatNumber(t,this.selectedCountryData.iso2,e?n.NATIONAL:n.INTERNATIONAL)}t=this._beforeSetNumber(t),this.telInput.value=t}},{key:"_updateFlagFromNumber",value:function(i){var t=i.indexOf("+"),e=t?i.substring(t):i,n=this.selectedCountryData.dialCode;e&&"1"===n&&"+"!==e.charAt(0)&&("1"!==e.charAt(0)&&(e="1".concat(e)),e="+".concat(e)),this.options.separateDialCode&&n&&"+"!==e.charAt(0)&&(e="+".concat(n).concat(e));var s=this._getDialCode(e,!0),a=this._getNumeric(e),r=null;if(s){var o=this.countryCodes[this._getNumeric(s)],h=-1!==o.indexOf(this.selectedCountryData.iso2)&&a.length<=s.length-1;if(!("1"===n&&this._isRegionlessNanp(a)||h))for(var u=0;u<o.length;u++)if(o[u]){r=o[u];break}}else"+"===e.charAt(0)&&a.length?r="":e&&"+"!==e||(r=this.defaultCountry);return null!==r&&this._setFlag(r)}},{key:"_isRegionlessNanp",value:function(i){var t=this._getNumeric(i);if("1"===t.charAt(0)){var e=t.substr(1,3);return-1!==u.indexOf(e)}return!1}},{key:"_highlightListItem",value:function(i,t){var e=this.highlightedItem;e&&e.classList.remove("iti__highlight"),this.highlightedItem=i,this.highlightedItem.classList.add("iti__highlight"),this.selectedFlag.setAttribute("aria-activedescendant",i.getAttribute("id")),t&&this.highlightedItem.focus()}},{key:"_getCountryData",value:function(i,e,n){for(var s=e?t:this.countries,a=0;a<s.length;a++)if(s[a].iso2===i)return s[a];if(n)return null;throw new Error("No country data for '".concat(i,"'"))}},{key:"_setFlag",value:function(i){var t=this.options,e=t.allowDropdown,n=t.separateDialCode,s=t.showFlags,a=this.selectedCountryData.iso2?this.selectedCountryData:{};if(this.selectedCountryData=i?this._getCountryData(i,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),s&&this.selectedFlagInner.setAttribute("class","iti__flag iti__".concat(i)),this._setSelectedCountryFlagTitleAttribute(i,n),n){var r=this.selectedCountryData.dialCode?"+".concat(this.selectedCountryData.dialCode):"";this.selectedDialCode.innerHTML=r;var o=this.selectedFlag.offsetWidth||this._getHiddenSelectedFlagWidth();this.isRTL?this.telInput.style.paddingRight="".concat(o+6,"px"):this.telInput.style.paddingLeft="".concat(o+6,"px")}if(this._updatePlaceholder(),e){var h=this.activeItem;if(h&&(h.classList.remove("iti__active"),h.setAttribute("aria-selected","false")),i){var u=this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i,"-preferred"))||this.countryList.querySelector("#iti-".concat(this.id,"__item-").concat(i));u.setAttribute("aria-selected","true"),u.classList.add("iti__active"),this.activeItem=u}}return a.iso2!==i}},{key:"_setSelectedCountryFlagTitleAttribute",value:function(i,t){var e;this.selectedFlag&&(e=i&&!t?"".concat(this.selectedCountryData.name,": +").concat(this.selectedCountryData.dialCode):i?this.selectedCountryData.name:"Unknown",this.selectedFlag.setAttribute("title",e))}},{key:"_getHiddenSelectedFlagWidth",value:function(){var i=this.telInput.parentNode.cloneNode();i.style.visibility="hidden",document.body.appendChild(i);var t=this.flagsContainer.cloneNode();i.appendChild(t);var e=this.selectedFlag.cloneNode(!0);t.appendChild(e);var n=e.offsetWidth;return i.parentNode.removeChild(i),n}},{key:"_updatePlaceholder",value:function(){if(window.intlTelInputUtils&&("aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&"polite"===this.options.autoPlaceholder)){var i=intlTelInputUtils.numberType[this.options.placeholderNumberType],t=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,i):"";t=this._beforeSetNumber(t),"function"==typeof this.options.customPlaceholder&&(t=this.options.customPlaceholder(t,this.selectedCountryData)),this.telInput.setAttribute("placeholder",t)}}},{key:"_selectListItem",value:function(i){var t=this._setFlag(i.getAttribute("data-country-code"));this._closeDropdown(),this._updateDialCode(i.getAttribute("data-dial-code")),this.telInput.focus();var e=this.telInput.value.length;this.telInput.setSelectionRange(e,e),t&&this._triggerCountryChange()}},{key:"_closeDropdown",value:function(){this.dropdownContent.classList.add("iti__hide"),this.selectedFlag.setAttribute("aria-expanded","false"),this.selectedFlag.removeAttribute("aria-activedescendant"),this.dropdownArrow.classList.remove("iti__arrow--up"),document.removeEventListener("keydown",this._handleKeydownOnDropdown),this.options.countrySearch&&this.searchInput.removeEventListener("input",this._handleSearchChange),document.documentElement.removeEventListener("click",this._handleClickOffToClose),this.countryList.removeEventListener("mouseover",this._handleMouseoverCountryList),this.countryList.removeEventListener("click",this._handleClickCountryList),this.options.dropdownContainer&&(this.options.useFullscreenPopup||window.removeEventListener("scroll",this._handleWindowScroll),this.dropdown.parentNode&&this.dropdown.parentNode.removeChild(this.dropdown)),this._trigger("close:countrydropdown")}},{key:"_scrollTo",value:function(i,t){var e=this.dropdownContent,n=window.pageYOffset||document.documentElement.scrollTop,s=e.offsetHeight,a=e.getBoundingClientRect().top+n,r=a+s,o=i.offsetHeight,h=i.getBoundingClientRect().top+n,u=h+o,l=h-a+e.scrollTop,c=s/2-o/2;h<a?(t&&(l-=c),e.scrollTop=l):u>r&&(t&&(l+=c),e.scrollTop=l-(s-o))}},{key:"_updateDialCode",value:function(i){var t,e=this.telInput.value,n="+".concat(i);if("+"===e.charAt(0)){var s=this._getDialCode(e);t=s?e.replace(s,n):n,this.telInput.value=t}else this.options.autoInsertDialCode&&(this.telInput.value=t=e?n+e:n)}},{key:"_getDialCode",value:function(i,t){var e="";if("+"===i.charAt(0))for(var n="",s=0;s<i.length;s++){var a=i.charAt(s);if(!isNaN(parseInt(a,10))){if(n+=a,t)this.countryCodes[n]&&(e=i.substr(0,s+1));else if(this.dialCodes[n]){e=i.substr(0,s+1);break}if(n.length===this.countryCodeMaxLen)break}}return e}},{key:"_getFullNumber",value:function(){var i=this.telInput.value.trim(),t=this.selectedCountryData.dialCode,e=this._getNumeric(i);return(this.options.separateDialCode&&"+"!==i.charAt(0)&&t&&e?"+".concat(t):"")+i}},{key:"_beforeSetNumber",value:function(i){var t=i;if(this.options.separateDialCode){var e=this._getDialCode(t);e&&(e="+".concat(this.selectedCountryData.dialCode),t=t.substr(" "===t[e.length]||"-"===t[e.length]?e.length+1:e.length))}return this._cap(t)}},{key:"_triggerCountryChange",value:function(){this._trigger("countrychange")}},{key:"handleAutoCountry",value:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=window.intlTelInputGlobals.autoCountry,this.telInput.value||this.setCountry(this.defaultCountry),this.resolveAutoCountryPromise())}},{key:"handleUtils",value:function(){window.intlTelInputUtils&&(this.telInput.value&&this._updateValFromNumber(this.telInput.value),this._updatePlaceholder()),this.resolveUtilsScriptPromise()}},{key:"destroy",value:function(){var i=this.telInput.form;if(this.options.allowDropdown){this._closeDropdown(),this.selectedFlag.removeEventListener("click",this._handleClickSelectedFlag),this.flagsContainer.removeEventListener("keydown",this._handleFlagsContainerKeydown);var t=this._getClosestLabel();t&&t.removeEventListener("click",this._handleLabelClick)}this.hiddenInput&&i&&i.removeEventListener("submit",this._handleHiddenInputSubmit),this.options.autoInsertDialCode&&(i&&i.removeEventListener("submit",this._handleSubmitOrBlurEvent),this.telInput.removeEventListener("blur",this._handleSubmitOrBlurEvent)),this.telInput.removeEventListener("keyup",this._handleKeyupEvent),this.telInput.removeEventListener("cut",this._handleClipboardEvent),this.telInput.removeEventListener("paste",this._handleClipboardEvent),this.telInput.removeAttribute("data-intl-tel-input-id");var e=this.telInput.parentNode;e.parentNode.insertBefore(this.telInput,e),e.parentNode.removeChild(e),delete window.intlTelInputGlobals.instances[this.id]}},{key:"getExtension",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""}},{key:"getNumber",value:function(i){if(window.intlTelInputUtils){var t=this.selectedCountryData.iso2;return intlTelInputUtils.formatNumber(this._getFullNumber(),t,i)}return""}},{key:"getNumberType",value:function(){return window.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99}},{key:"getSelectedCountryData",value:function(){return this.selectedCountryData}},{key:"getValidationError",value:function(){if(window.intlTelInputUtils){var i=this.selectedCountryData.iso2;return intlTelInputUtils.getValidationError(this._getFullNumber(),i)}return-99}},{key:"isValidNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isValidNumber(i,this.selectedCountryData.iso2):null}},{key:"isPossibleNumber",value:function(){var i=this._getFullNumber().trim();return window.intlTelInputUtils?intlTelInputUtils.isPossibleNumber(i,this.selectedCountryData.iso2):null}},{key:"setCountry",value:function(i){var t=i.toLowerCase();this.selectedCountryData.iso2!==t&&(this._setFlag(t),this._updateDialCode(this.selectedCountryData.dialCode),this._triggerCountryChange())}},{key:"setNumber",value:function(i){var t=this._updateFlagFromNumber(i);this._updateValFromNumber(i),t&&this._triggerCountryChange()}},{key:"setPlaceholderNumberType",value:function(i){this.options.placeholderNumberType=i,this._updatePlaceholder()}}],r&&function(i,t){for(var e=0;e<t.length;e++){var n=t[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,a(n.key),n)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),e;var n,r}();r.getCountryData=function(){return t};var f=function(i,t,e){var n=document.createElement("script");n.onload=function(){c("handleUtils"),t&&t()},n.onerror=function(){c("rejectUtilsScriptPromise"),e&&e()},n.className="iti-load-utils",n.async=!0,n.src=i,document.body.appendChild(n)};return r.loadUtils=function(i){if(!window.intlTelInputUtils&&!window.intlTelInputGlobals.startedLoadingUtilsScript){if(window.intlTelInputGlobals.startedLoadingUtilsScript=!0,"undefined"!=typeof Promise)return new Promise((function(t,e){return f(i,t,e)}));f(i)}return null},r.defaults=h,r.version="18.5.3",function(i,t){var e=new d(i,t);return e._init(),i.setAttribute("data-intl-tel-input-id",e.id),window.intlTelInputGlobals.instances[e.id]=e,e}}()},a.exports?a.exports=r():window.intlTelInput=r()),n=a.exports),h=t({__proto__:null,default:i(o)},[o]);export{h as i}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as t,H as s,a as l}from"./p-
|
|
4
|
+
import{r as a,h as t,H as s,a as l}from"./p-09rQwPEf.js";const i=class{constructor(t){a(this,t),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(a=1024){const t=window.innerWidth<=a,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&t&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}render(){return this.data?t(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},t("div",null,t("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),t("div",{class:"s-app-install-alert-content"},t("h2",{class:"s-app-install-alert-title"},this.data.title),t("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",t("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),t("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},t("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as a,H as r}from"./p-
|
|
4
|
+
import{r as s,h as a,H as r}from"./p-09rQwPEf.js";const t=class{constructor(a){s(this,a)}handleOrderChange(s){s?this.setSummaryFromProp(s):this.summary=void 0}async componentWillLoad(){await Salla.onReady(),this.order&&this.setSummaryFromProp(this.order)}setSummaryFromProp(s){try{const a="string"==typeof s?JSON.parse(s):s;this.summary=a}catch(s){salla.logger.error("Failed to parse order summary data",s),this.summary=void 0}}renderTotalRow(s,r,t,l,o){return a("div",{class:"s-order-totals-card-row"},a("div",{class:"s-order-totals-card-row-inner"},a("dt",{class:t||"s-order-totals-card-label"},s),a("dd",{class:l||"s-order-totals-card-value"},a(o?"b":"span",{innerHTML:salla.money(r)}))))}renderDiscountRow(){return this.summary?.discounts?.map((s=>a("div",{class:"s-order-totals-card-row",key:s.name},a("div",{class:"s-order-totals-card-row-inner"},a("dt",{class:"s-order-totals-card-discount"},s.name),a("dd",{class:"s-order-totals-card-value"},s.discount)))))}renderRefundRow(s){return a("div",{class:"s-order-totals-card-row"},a("div",{class:"s-order-totals-card-row-inner"},a("dt",{class:"s-order-totals-card-refund-label"},a("span",{class:"s-order-totals-card-refund-icon"},a("i",{class:"sicon-info"})),a("span",null," ",salla.lang.get("pages.orders.refund_amount"))),a("dd",{class:"s-order-totals-card-refund-value"},a("b",{innerHTML:salla.money(s)}))))}render(){if(!this.summary)return a(r,{class:"s-order-totals-card-wrapper"});const{summary:s}=this,t=!!Array.isArray(s.options)&&s.options.length>0;return a(r,{class:"s-order-totals-card-wrapper"},a("div",{class:"s-order-totals-card-panel"},a("h2",{id:"summary-heading",class:"s-order-totals-card-heading"},salla.lang.get("pages.orders.summary")),a("div",{class:"s-order-totals-card-flow"},a("dl",{class:"s-order-totals-card-list"},this.renderTotalRow(salla.lang.get("pages.cart.items_total"),s.sub_total),t&&this.renderTotalRow(salla.lang.get("pages.cart.order_options_total"),s.options_total),s.discounts&&this.renderDiscountRow(),s.cod_cost&&this.renderTotalRow(salla.lang.get("pages.orders.cod_cost"),s.cod_cost,""),s.shipping_cost&&this.renderTotalRow(salla.lang.get("pages.orders.shipping_cost"),s.shipping_cost,"s-order-totals-card-shipping"),s.tax&&this.renderTotalRow(`${salla.lang.get("pages.cart.tax")} ${s.tax.percent}%`,s.tax.amount,""),s.paid_amount?this.renderTotalRow(salla.lang.get("pages.orders.partially_paid"),s.paid_amount,""):null,s.remaining_amount?this.renderTotalRow(salla.lang.get("pages.orders.remaining_amount"),s.remaining_amount,""):null,a("div",{class:"s-order-totals-card-total"},this.renderTotalRow(salla.lang.get("pages.orders.final_total"),s.total,"s-order-totals-card-total-label","s-order-totals-card-total-value",!0)),s.refund_amount?a("div",{class:"s-order-totals-card-refund"},this.renderRefundRow(s.refund_amount)):null))))}static get watchers(){return{order:["handleOrderChange"]}}};t.style=":host{display:block}";export{t as salla_order_totals_card}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{e as t,f as i,i as s,d as e,r as a,h as r,a as n}from"./p-
|
|
4
|
+
import{e as t,f as i,i as s,d as e,r as a,h as r,a as n}from"./p-09rQwPEf.js";import{S as o}from"./p-DiKTtDW5.js";import{H as l}from"./p-Dljb4XCt.js";import"./p-CgtvEd63.js";var c,h,u,f,d,p,v,m,g,w,b,y;function _(){if(w)return g;w=1;var e=i(),a=function(){if(h)return c;h=1;var i=t();return c=function(){return i.Date.now()}}(),r=function(){if(m)return v;m=1;var t=function(){if(p)return d;p=1;var t=function(){if(f)return u;f=1;var t=/\s/;return u=function(i){for(var s=i.length;s--&&t.test(i.charAt(s)););return s}}(),i=/^\s+/;return d=function(s){return s?s.slice(0,t(s)+1).replace(i,""):s}}(),e=i(),a=s(),r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;return v=function(i){if("number"==typeof i)return i;if(a(i))return NaN;if(e(i)){var s="function"==typeof i.valueOf?i.valueOf():i;i=e(s)?s+"":s}if("string"!=typeof i)return 0===i?i:+i;i=t(i);var c=n.test(i);return c||o.test(i)?l(i.slice(2),c?2:8):r.test(i)?NaN:+i}}(),n=Math.max,o=Math.min;return g=function(t,i,s){var l,c,h,u,f,d,p=0,v=!1,m=!1,g=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function w(i){var s=l,e=c;return l=c=void 0,p=i,u=t.apply(e,s)}function b(t){var s=t-d;return void 0===d||s>=i||s<0||m&&t-p>=h}function y(){var t=a();if(b(t))return _(t);f=setTimeout(y,function(t){var s=i-(t-d);return m?o(s,h-(t-p)):s}(t))}function _(t){return f=void 0,g&&l?w(t):(l=c=void 0,u)}function k(){var t=a(),s=b(t);if(l=arguments,c=this,d=t,s){if(void 0===f)return function(t){return p=t,f=setTimeout(y,i),v?w(t):u}(d);if(m)return clearTimeout(f),f=setTimeout(y,i),w(d)}return void 0===f&&(f=setTimeout(y,i)),u}return i=r(i)||0,e(s)&&(v=!!s.leading,h=(m="maxWait"in s)?n(r(s.maxWait)||0,i):h,g="trailing"in s?!!s.trailing:g),k.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=d=c=f=void 0},k.flush=function(){return void 0===f?u:_(a())},k},g}var k=e(function(){if(y)return b;y=1;var t=_(),s=i();return b=function(i,e,a){var r=!0,n=!0;if("function"!=typeof i)throw new TypeError("Expected a function");return s(a)&&(r="leading"in a?!!a.leading:r,n="trailing"in a?!!a.trailing:n),t(i,e,{leading:r,maxWait:e,trailing:n})}}());class T{constructor(t){this.grid=t,this.create=()=>{this.mutationObserver.observe(this.grid,{childList:!0});for(const t of Array.from(this.grid.children))this.resizeObserver.observe(t)},this.onContainerMutation=t=>{const i=t.flatMap((t=>Array.from(t.removedNodes))),s=t.flatMap((t=>Array.from(t.addedNodes)));for(const t of i)t instanceof Element&&this.resizeObserver.unobserve(t);for(const t of s)t instanceof Element&&this.resizeObserver.observe(t);i.length>0&&0===s.length&&this.update()},this.onChildrenResize=t=>{t.filter((t=>null!==t.target.parentElement)).length>0&&this.update()},this.update=k((()=>{const t=window.getComputedStyle(this.grid);if(!1===t.getPropertyValue("display").includes("grid"))return void this.clean();const i=function(t){return window.getComputedStyle(t).getPropertyValue("grid-template-columns").trim().split(/\s+(?=(?:[^()]*\([^()]*\))*[^()]*$)/)}(this.grid);if(i.length<=1)return void this.clean();const s=Number.parseFloat(t.getPropertyValue("row-gap").trim())||0,e=Array.from(this.grid.children);for(let t=0;t<i.length;t++){const i=e[t];i?.style.removeProperty("margin-top")}for(let t=0;t<e.length;t++){const a=e[t-i.length],r=e[t];if(void 0!==a&&void 0!==r){const t=a.getBoundingClientRect().bottom;r.style.removeProperty("margin-top");const i=r.getBoundingClientRect().top;if(i-s!==t){const e=Math.round(100*(t-(i-s)+Number.EPSILON))/100;r.style.setProperty("margin-top",`${e}px`)}}}}),32),this.destroy=()=>{this.resizeObserver.disconnect(),this.mutationObserver.disconnect(),this.clean()},this.clean=()=>{for(const t of Array.from(this.grid.children))t.style.removeProperty("margin-top")},this.mutationObserver=new MutationObserver(this.onContainerMutation),this.resizeObserver=new ResizeObserver(this.onChildrenResize),!1===CSS.supports("grid-template-rows","masonry")&&this.create()}[Symbol.dispose](){this.destroy()}}const E=class{constructor(t){a(this,t),this.reviews=[],this.isLoading=!1,this.pagination=null,this.sort="latest"}getUrlParams(){const t=new URLSearchParams(window.location.search);return{sort:t.get("sort")||null,page:Number.parseInt(t.get("page"))||1}}updateUrlParams(t){const i=new URL(window.location.href);for(const[s,e]of Object.entries(t))e?i.searchParams.set(s,e.toString()):i.searchParams.delete(s);window.history.replaceState({},"",i.toString())}fetchReviews(t,i){const s=this.getUrlParams();return salla.api.request("reviews",{params:{type:"products",format:"lite",per_page:8,page:i||s.page||1,sort:t||s.sort||null}})}async initializeMasonry(){const t=this.el.querySelector(".s-reviews-page-grid");if(t)try{new T(t),salla.logger.info("Masonry initialized successfully")}catch(t){salla.logger.error("Masonry initialization failed:",t)}}animateReviewCards(){const t=this.wrapper.querySelectorAll("salla-review-card:not(.animated)");l.animateItems(t)}initiateInfiniteScroll(){this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.pagination?.links?.next||null,history:!1,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.isLoading=!0})),this.infiniteScroll?.on("load",(t=>{this.pagination=t.pagination,this.reviews=[...this.reviews,...t.data],this.isLoading=!1,this.updateUrlParams({page:t.pagination.current_page})})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more reviews:",t),this.isLoading=!1}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll.")}componentDidRender(){setTimeout((()=>{requestAnimationFrame(this.animateReviewCards.bind(this))}),176)}async componentWillLoad(){try{await salla.onReady(),this.langTitlesReviews=salla.lang.get("common.titles.reviews"),this.langSorting=salla.lang.get("pages.categories.sorting"),this.placeholderText=salla.lang.choice("pages.rating.reviews",0),this.langLoadMore=salla.lang.get("common.elements.load_more"),this.langSortByTopRating=salla.lang.get("pages.testimonials.sort_by_rating_desc"),this.langSortByMostRecent=salla.lang.get("pages.testimonials.sort_by_date_desc"),this.langSortByLeastRated=salla.lang.get("pages.testimonials.sort_by_rating_asc"),this.langSortByLeastRecent=salla.lang.get("pages.testimonials.sort_by_date_asc");const t=this.getUrlParams(),i=await this.fetchReviews(t.sort);this.sort=t.sort,this.reviews=i.data,this.pagination=i.pagination,this.langRatingReviews=salla.lang.choice("pages.rating.reviews",this.pagination?.total)}catch(t){salla.logger.error("Error loading reviews:",t)}}async handleSorting(t){const i=t.target.value;this.sort=i,this.updateUrlParams({sort:i,page:1});const s=await this.fetchReviews(i,1);this.reviews=s.data,this.pagination=s.pagination}async componentDidLoad(){await this.initializeMasonry(),this.initiateInfiniteScroll(),this.sort=this.getUrlParams().sort||"latest",this.updateUrlParams({sort:this.sort,page:1})}disconnectedCallback(){this.infiniteScroll&&this.infiniteScroll.destroy()}renderSortingOptions(){return[{value:"latest",label:this.langSortByMostRecent},{value:"oldest",label:this.langSortByLeastRecent},{value:"top_rating",label:this.langSortByTopRating},{value:"bottom_rating",label:this.langSortByLeastRated}].map((t=>r("option",{key:t.value,value:t.value,selected:t.value===this.sort},t.label)))}render(){return r("host",{key:"6d478caef9753d4aaf9ab1a5376961b748ec2088"},r("div",{key:"f84c127d660cba0890ba110b4d203e50fc1f2d8d",class:"s-reviews-page-header-wrapper"},r("h2",{key:"6c48e1343deaba4531987aefcc5888fc1e0d77ac",class:"s-reviews-page-title"},this.langTitlesReviews,r("span",{key:"fa9b923d592752b108da63efdf3167b118be65d0",class:"s-reviews-page-count"},"(",this.langRatingReviews,")")),r("div",{key:"52d0dd32e981721eb2529ed5d65769b078ad7538",class:"s-reviews-page-filter-wrapper"},r("label",{key:"0f7fe49f3ac27db63d8992efa2c3c04b3b19367d",class:"s-reviews-page-filter-label",htmlFor:"testimonials-filter"},this.langSorting),r("select",{key:"497563e494b7141c5a64dddc8cf4a202efba3776",onChange:t=>this.handleSorting(t),disabled:!this.reviews.length,class:"s-reviews-page-filter"},this.renderSortingOptions()))),this.reviews.length?r("main",{class:"s-reviews-page-grid",ref:t=>{this.wrapper=t}},this.reviews.map((t=>r("salla-review-card",{key:t.id,review:t})))):r("div",{class:"s-products-list-placeholder"},r("span",{innerHTML:o}),r("p",null,this.placeholderText)),this.pagination?.links?.next&&this.reviews.length?r("div",{class:"s-reviews-page-load-more-container"},r("salla-button",{class:"s-reviews-page-load-more-btn",loading:this.isLoading,onClick:()=>this.infiniteScroll?.loadNextPage(),onKeyUp:()=>this.infiniteScroll?.loadNextPage()},this.langLoadMore)):null)}get el(){return n(this)}};E.style=":host{display:block}";export{E as salla_reviews_page}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,a as o}from"./p-
|
|
4
|
+
import{r as t,h as s,a as o}from"./p-09rQwPEf.js";import{H as e}from"./p-Dljb4XCt.js";import"./p-CgtvEd63.js";const r=class{constructor(s){t(this,s),this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more"),this.languageCode=salla.lang.locale,this.orders=[],salla.lang.onLoaded((()=>{this.languageCode=salla.lang.locale,this.orderNumberText=salla.lang.get("pages.thank_you.order_id"),this.totalOrderText=salla.lang.get("pages.orders.total"),this.orderDateText=salla.lang.get("pages.orders.date"),this.orderStatusText=salla.lang.get("pages.orders.status"),this.noOrderText=salla.lang.get("pages.orders.non_orders"),this.load_more_text_trans=salla.lang.get("common.elements.load_more")}))}loading(t=!0){let s=this.status?.querySelector(".s-button-text");s&&(e.toggleElementClassIf(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none")}initiateInfiniteScroll(){this.hasInfiniteScroll&&(this.wrapper?(this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!1},!0),this.infiniteScroll?.on("request",(()=>{this.loading()})),this.infiniteScroll?.on("load",(t=>{this.loading(!1),this.pagination=t.pagination,this.nextPage=t.pagination?.links?.next||null,this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)}));let s=this.host.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)})),this.infiniteScroll?.on("error",(t=>{salla.logger.error("Error loading more comments:",t)}))):salla.logger.error("Wrapper is undefined. Cannot initiate infinite scroll."))}async loadMore(){this.infiniteScroll.loadNextPage()}handleResponse(t){return t.map((t=>this.getSingleOrderItem(t)))}async loadInitialData(){const t=new URL(window.location.href);await salla.order.api.fetch({...this.params,types:[""],feedback_status:t.searchParams.get("feedback_status")}).then((t=>{if(this.orders=t.data,this.hasInfiniteScroll=!!t.pagination?.links.next,this.pagination=t.pagination,this.total=t.pagination?.total,this.nextPage=t.pagination?.links?.next||null,!this.orders.length)return this.showPlaceholder=!0,this.loading(!1);setTimeout((()=>{this.handleResponse(t.data).forEach((t=>{this.wrapper.append(t)})),this.initiateInfiniteScroll();let s=this.wrapper.querySelectorAll(".s-orders-table-tbody-tr:not(.animated)");e.animateItems(s)}),100)})).catch((t=>{this.showPlaceholder=!0,this.loading(!1),salla.logger.error(t)}))}getSingleOrderItem(t){const s=document.createElement("tr");s.classList.add("s-orders-table-tbody-tr","s-orders-table-tbody-tr-shadow");const o=document.createElement("td");o.classList.add("s-orders-table-tbody-tr-td");const r=document.createElement("div");r.classList.add("s-orders-table-tbody-tr-td-content");const a=document.createElement("span");a.classList.add("s-orders-mobile-title"),a.textContent=this.orderNumberText+":";const n=document.createElement("span");if(n.classList.add("s-orders-reference-id"),n.textContent="#"+t.reference_id,r.appendChild(a),r.appendChild(n),"buy_as_gift"==t.source){const t=document.createElement("i");t.classList.add("sicon-gift-sharing","s-orders-buy-as-gift-icon"),r.appendChild(t)}const i=document.createElement("a");i.href=t.url,r.appendChild(i);const d=document.createElement("div");d.classList.add("s-orders-copy-to-clipboard-button");const l=document.createElement("salla-button");l.classList.add("relative"),l.setAttribute("color","dark"),l.setAttribute("shape","link"),l.dataset.content=t.reference_id.toString(),l.addEventListener("click",(t=>{e.copyToClipboard(t),e.toggleElementClassIf(l,"copied","code-to-copy",(()=>!0)),setTimeout((()=>{e.toggleElementClassIf(l,"code-to-copy","copied",(()=>!0))}),1e3)}));const c=document.createElement("span");c.textContent="#"+t.reference_id;const h=document.createElement("i");h.classList.add("sicon-swap-stroke","s-orders-copy-to-clipboard-button-icon"),salla.config.get("theme.is_rtl",!0)?(l.appendChild(h),l.appendChild(c)):(l.appendChild(c),l.appendChild(h)),d.appendChild(l),r.appendChild(d),o.appendChild(r),s.appendChild(o);const u=document.createElement("td");u.classList.add("s-orders-table-tbody-tr-td");const b=document.createElement("div");b.classList.add("s-orders-table-tbody-tr-td-content");const m=document.createElement("span");m.classList.add("s-orders-mobile-title"),m.textContent=this.totalOrderText+":";const p=document.createElement("div");p.innerHTML=salla.money(t.total);const y=document.createElement("a");y.href=t.url,b.appendChild(m),b.appendChild(p),b.appendChild(y),u.appendChild(b),s.appendChild(u);const f=document.createElement("td");f.classList.add("s-orders-table-tbody-tr-td");const g=document.createElement("div");g.classList.add("s-orders-table-tbody-tr-td-content");const _=document.createElement("span");_.classList.add("s-orders-mobile-title"),_.textContent=this.orderDateText+":";const v=document.createElement("div");v.textContent=e.formatDateFromString(t.created_at.date,salla.helpers.number,this.languageCode);const k=document.createElement("a");k.href=t.url,g.appendChild(_),g.appendChild(v),g.appendChild(k),f.appendChild(g),s.appendChild(f);const w=document.createElement("td");w.classList.add("s-orders-table-tbody-tr-td");const x=document.createElement("div");x.classList.add("s-orders-table-tbody-tr-td-content");const j=document.createElement("span");j.classList.add("s-orders-mobile-title"),j.textContent=this.orderStatusText+":";const C=document.createElement("span");C.classList.add("s-orders-status-container"),C.style.color=t.status.color;const E=document.createElement("i");E.classList.add(t.status.icon);const I=document.createElement("span");I.textContent=t.status.name,C.appendChild(E),C.appendChild(I),x.appendChild(j),x.appendChild(C);const T=document.createElement("i");T.classList.add("sicon-star2","s-orders-status-rated",t.is_rated?"s-orders-rated-text":"s-orders-unrated-text"),x.appendChild(T);const D=document.createElement("a");return D.href=t.url,x.appendChild(D),w.appendChild(x),s.appendChild(w),s}render(){return this.showPlaceholder?s("div",{class:"s-orders-no-content"},s("i",{class:"sicon-packed-box icon"}),s("p",null,this.noOrderText)):s("div",{class:"s-orders-wrapper"},s("table",{class:"s-orders-table"},s("thead",{class:"s-orders-table-head"},s("tr",{class:"s-orders-table-head-tr"},s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderNumberText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.totalOrderText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderDateText),s("th",{class:"s-orders-table-head-tr-th",scope:"col"},this.orderStatusText))),s("tbody",{class:"s-orders-table-tbody",ref:t=>this.wrapper=t})),this.nextPage&&s("div",{class:"s-infinite-scroll-wrapper",ref:t=>this.status=t},s("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},s("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText??this.load_more_text_trans),s("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))))}componentWillLoad(){return salla.onReady().then((()=>this.loadInitialData())).then((()=>this.initiateInfiniteScroll()))}get host(){return o(this)}};r.style=":host{display:block}";export{r as salla_orders}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as i,a as t}from"./p-
|
|
4
|
+
import{r as s,h as i,a as t}from"./p-09rQwPEf.js";import{I as e}from"./p-uTyAzPSy.js";const r=class{constructor(i){s(this,i),this.currentSlide=0,this.showPurchaseCount=!1,this.startPoint={x:0,y:0},this.isSwiping=!1,this.isRTL="rtl",this.handlePointerDown=s=>{s.isPrimary&&(this.sliderElement?.setPointerCapture(s.pointerId),this.startSwipe(s.clientX,s.clientY),s.preventDefault())},this.handlePointerMove=s=>{this.isSwiping&&s.isPrimary&&s.preventDefault()},this.handlePointerUp=s=>{this.isSwiping&&s.isPrimary&&(this.sliderElement?.releasePointerCapture(s.pointerId),this.endSwipe(s.clientX,s.clientY))},this.handlePointerCancel=s=>{this.isSwiping&&s.isPrimary&&(this.sliderElement?.releasePointerCapture(s.pointerId),this.isSwiping=!1)},this.goToSlide=s=>{this.currentSlide=Math.max(0,Math.min(s,this.images.length-1))}}async componentDidLoad(){await salla.onReady(),this.showPurchaseCount=!!salla.config.get("store.settings.product.total_sold_enabled",!1),this.isRTL=salla.config.get("theme.is_rtl",!0),this.purchasedCount=salla.lang.getWithDefault("blocks.home.reviews.purchased_count",this.isRTL?` تم شراءه ${this.review.product?.sold_quantity} مرة`:`Purchased ${this.review.product.sold_quantity} times`,{count:this.review.product?.sold_quantity}),this.initializeSlider()}disconnectedCallback(){this.removeEventListeners()}get images(){const{review:s}=this;return s?.images?.length>1?s.images.map(((s,i)=>({url:s,alt:"",id:i}))):s?.product?.images||[]}get hasMultipleImages(){return this.images.length>1}get slideTransform(){return`translateX(${100*this.currentSlide*(this.isRTL?1:-1)}%)`}initializeSlider(){this.hasMultipleImages&&(this.sliderElement=this.el.querySelector(".s-review-card-slider-container"),this.sliderElement&&(this.sliderElement.style.touchAction="pan-y pinch-zoom",this.addEventListeners()))}addEventListeners(){this.sliderElement&&(this.sliderElement.addEventListener("pointerdown",this.handlePointerDown,{passive:!1}),this.sliderElement.addEventListener("pointermove",this.handlePointerMove,{passive:!1}),this.sliderElement.addEventListener("pointerup",this.handlePointerUp,{passive:!0}),this.sliderElement.addEventListener("pointercancel",this.handlePointerCancel,{passive:!0}))}removeEventListeners(){this.sliderElement&&(this.sliderElement.removeEventListener("pointerdown",this.handlePointerDown),this.sliderElement.removeEventListener("pointermove",this.handlePointerMove),this.sliderElement.removeEventListener("pointerup",this.handlePointerUp),this.sliderElement.removeEventListener("pointercancel",this.handlePointerCancel))}startSwipe(s,i){this.startPoint={x:s,y:i},this.isSwiping=!0}componentDidRender(){this.removeEventListeners(),this.addEventListeners()}endSwipe(s,i){this.isSwiping=!1,this.processSwipe(s-this.startPoint.x,i-this.startPoint.y)}processSwipe(s,i){if(Math.abs(s)<10||Math.abs(i)>Math.abs(s))return;const t=s<0;(this.isRTL?!t:t)?this.goToNextSlide():this.goToPrevSlide()}goToNextSlide(){this.currentSlide<this.images.length-1&&this.currentSlide++}goToPrevSlide(){this.currentSlide>0&&this.currentSlide--}renderStars(){return Array(5).fill(null).map(((s,t)=>i("span",{key:t,innerHTML:this.review.stars>=t+1?' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="currentcolor" />\n</svg>':' <svg width="18" height="17" view-box="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M9.00045 13.6951L3.71036 16.6563L4.89186 10.71L0.440918 6.59397L6.4612 5.88017L9.00045 0.375122L11.5396 5.88017L17.5599 6.59397L13.109 10.71L14.2905 16.6563L9.00045 13.6951Z" fill="#DDDDDD" />\n</svg>'})))}renderDots(){return this.images.map((({url:s},t)=>i("button",{key:s||t,type:"button",class:"s-review-card-slider-dot "+(this.currentSlide===t?"active":""),onClick:()=>this.goToSlide(t),"aria-label":`Go to slide ${t+1}`,onPointerDown:()=>this.goToSlide(t)})))}renderSlider(){return this.hasMultipleImages?i("div",{class:"s-review-card-slider-container"},i("div",{class:"s-review-card-slides",style:{transform:this.slideTransform}},this.images.map((s=>i("div",{key:s?.id,class:"s-review-card-slider-slide"},i("img",{src:s.url,alt:s.alt||"Product image",width:275,height:275,loading:"lazy",draggable:!1}))))),i("div",{class:"s-review-card-slider-dots"},this.renderDots())):null}renderSingleImage(){const s=this.review?.product?.image;return!s||this.hasMultipleImages?null:i("img",{src:s.url,alt:s.alt||"Product image",class:"s-review-card-image",width:275,height:275,loading:"lazy",decoding:"async",draggable:!1})}renderHeader(){return i("div",{class:"s-review-card-header"},i("div",{class:"s-review-card-reviewer-name"},i("p",null,this.review?.name),this.review?.has_order&&i("span",{class:"s-review-card-verified-icon",innerHTML:e})),i("div",{class:"s-review-card-stars"},this.renderStars()))}renderProductInfo(){const s=this.review?.product;return s?i("a",{href:this.review?.product?.url,class:"s-review-card-product-container"},i("img",{alt:s.image?.alt||"Product",src:s.image?.url,class:"s-review-card-product-image",width:60,height:60,loading:"lazy",decoding:"async",draggable:!1}),i("div",{class:"s-review-card-product-details"},i("p",{class:"s-review-card-product-details-name"},s.name),this.showPurchaseCount?i("p",{class:"s-review-card-product-details-purchase-count"},i("span",{innerHTML:' <svg width="12" height="17" view-box="0 0 12 17" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M6 16.2501C9.10658 16.2501 11.625 13.7317 11.625 10.6251C11.625 9.976 11.4523 9.35252 11.25 8.77232C9.99998 10.0075 9.05002 10.6251 8.4 10.6251C11.3966 5.37512 9.75 3.12512 5.25 0.125122C5.625 3.87475 3.15302 5.58043 2.14634 6.52757C1.0559 7.5535 0.375 9.00977 0.375 10.6251C0.375 13.7317 2.89339 16.2501 6 16.2501ZM6.53205 2.92636C8.96333 4.98908 8.97495 6.59185 7.09725 9.88157C6.5265 10.8815 7.2486 12.1251 8.4 12.1251C8.9163 12.1251 9.43807 11.9745 9.98917 11.6789C9.52342 13.4466 7.91393 14.7501 6 14.7501C3.72182 14.7501 1.875 12.9033 1.875 10.6251C1.875 9.47072 2.34959 8.39582 3.17419 7.62002C3.2687 7.53115 3.74812 7.1062 3.76858 7.08782C4.08646 6.8017 4.34835 6.54985 4.60718 6.2727C5.52998 5.28461 6.19283 4.18735 6.53205 2.92636Z" fill="currentcolor" />\n </svg>'}),this.purchasedCount):null)):null}render(){return i("div",{key:"8c2e3500d7844c43e455e707c460a842995eda13",class:"s-review-card-container"},this.renderSlider(),this.renderSingleImage(),a(),i("div",{key:"1b5cb3b515118ab578d2f64202e33ff2a67b3e89",class:"s-review-card-content"},this.renderHeader(),i("p",{key:"784abce956a5ee45aa0d90b5bd5427c2658bcf2c",class:"s-review-card-review-content",innerHTML:this.review?.content}),a(),this.renderProductInfo()))}get el(){return t(this)}},a=()=>i("div",{class:"s-review-card-divider "});r.style=":host{display:block}";export{r as salla_review_card}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Crafted with ❤ by Salla
|
|
3
|
+
*/
|
|
4
|
+
import{r as e,c as t,h as i,H as s}from"./p-09rQwPEf.js";const a=class{constructor(i){e(this,i),this.prizeItemSelected=t(this,"prizeItemSelected")}onPrizeItemClick(){this.prizeItemSelected.emit(this.item)}render(){return i(s,{key:"1a3463c51bf3e3e250f62b65d3a81815ec465923"},i("div",{key:"03bf4d3e35b10d17a325ca4ef280cb384f3a76f4",onClick:this.onPrizeItemClick.bind(this)},i("img",{key:"a4d319b2daec5cdfec1c85910edea10bc1d1ab6c",class:"s-loyalty-prize-item-image",src:this.item.image,alt:this.item.name}),i("div",{key:"52059fafc318c1f5a6b0289669083476650f8761",class:"s-loyalty-prize-item-title"},this.item.name),i("div",{key:"a3e14e2d1bd86dc3e7dbd2e6c5115e119af965e5",class:"s-loyalty-prize-item-subtitle"},this.item.description),i("div",{key:"55df95c028748c0387dc75dc4ad35c7285c907af",class:"s-loyalty-prize-item-points"},this.item.cost_points," Points")))}};a.style="salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";export{a as salla_loyalty_prize_item}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,c as e,h as i}from"./p-
|
|
4
|
+
import{r as s,c as e,h as i}from"./p-09rQwPEf.js";import{C as t,F as l}from"./p-CBT_Nxny.js";const a=class{constructor(i){s(this,i),this.fieldChanged=e(this,"fieldChanged"),this.fileUploaded=e(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(s){this.parsedFields=s}async getFieldValues(){return this.parsedFields?.reduce(((s,e)=>(s[`custom_fields[${e.id}]`]=e.value,s)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const s=this.parsedFields.reduce(((s,e)=>(!e.required||e.value&&""!==e.value||(s[e.id.toString()]=`${e.label} is required`),s)),{});return this.fieldErrors=s,0===Object.keys(s).length}handleFieldChange(s,e){const i=e.target.value;s.value=i,this.clearFieldError(s.id);const t=!(s.required&&!i);t||this.setFieldError(s.id,`${s.label} is required`),this.fieldChanged.emit({fieldId:s.id,value:i,isValid:t})}handleFileUpload(s,e){const{error:i,file:t}=e.detail,l=!i;this.clearFieldError(s.id),l?s.value=t:this.setFieldError(s.id,"File upload failed"),this.fileUploaded.emit({fieldId:s.id,file:t,isValid:l})}clearFieldError(s){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[s]}setFieldError(s,e){this.fieldErrors={...this.fieldErrors,[s]:e}}renderTextField(s){return i("input",{disabled:!this.isEditable,type:s.type,id:`custom-field-${s.id}`,value:s.value?.toString()||"",onChange:e=>this.handleFieldChange(s,e),name:`${s.id}`,class:"form-input",required:s.required})}renderFileField(s){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${s.id}`,name:`${s.id}`,type:"registration",value:s.value,height:"120px",onAdded:e=>this.handleFileUpload(s,e),required:s.required,disabled:!this.isEditable,onUploaded:s=>{s.target.value=s.target.value?.url},allowRemove:!0,onRemoved:e=>{e.preventDefault(),e.stopPropagation(),s.value="",e.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:t})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(s){return i("div",{class:"s-custom-fields-field",key:s.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${s.id}`},s.label,s.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,s.type===l.Photo?this.renderFileField(s):this.renderTextField(s),this.fieldErrors[s.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[s.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(s){return s?"string"==typeof s?JSON.parse(s):Array.isArray(s)?s:[]:[]}async handleSubmit(s){s.preventDefault(),this.isSubmitting=!0;try{const e={},i=s.target.elements;for(let s=0;s<i.length;s++){const t=i[s];t.name&&!t.name.startsWith("hidden")&&t.value&&(e[t.name]=t.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:e})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((s=>this.renderField(s))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};a.style=":host{display:block}";export{a as salla_custom_fields}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as l,H as t}from"./p-
|
|
4
|
+
import{r as a,h as l,H as t}from"./p-09rQwPEf.js";import{G as s}from"./p-C0JNGIpa.js";const o=a=>a?new Date(Number(a)).toLocaleDateString(salla.lang.locale,{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric"}):"",r=a=>{if(!a)return"";try{const l=a.toLowerCase(),t=salla.lang.get(`pages.loyalty_program.${l}`);return t===`pages.loyalty_program.${l}`?a:t}catch{return a}},e=class{constructor(l){a(this,l),this.loyaltyPointsArray=[],this.isLoadingLoyalty=!1,this.nextPageUrlLoyalty="",this.handleClick=()=>{this.loadMoreLoyaltyPoints()}}componentWillLoad(){return salla.onReady().then((()=>{this.loadLoyaltyPoints()}))}async loadLoyaltyPoints(){this.isLoadingLoyalty=!0;try{let a="/balance/points?page=1",l=await salla.api.request(a);this.loyaltyPointsArray=l.data,this.nextPageUrlLoyalty=l.cursor.next}catch(a){console.error("Error loading loyalty points transactions",a)}finally{this.isLoadingLoyalty=!1}}async loadMoreLoyaltyPoints(){if(this.nextPageUrlLoyalty){this.isLoadingLoyalty=!0;try{let a=await salla.api.request(this.nextPageUrlLoyalty);this.loyaltyPointsArray=[...this.loyaltyPointsArray,...a.data],this.nextPageUrlLoyalty=a.cursor?.next||""}catch(a){console.error("Error loading more loyalty points",a)}finally{this.isLoadingLoyalty=!1}}}render(){return l(t,{key:"24ab88177569df0ae3c8e9003f8817935413f6f9"},l("div",{key:"1617bdd654819bc8c24a3afd1d4af5cc3a148352"},this.isLoadingLoyalty?l("salla-loading",null):l("div",null,this.loyaltyPointsArray.length>0?l("div",null,l("table",{class:"s-loyalty-program-table"},l("thead",{class:"s-loyalty-program-table-head"},l("tr",{class:"s-loyalty-program-table-head-tr"},l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.points")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.date")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("pages.wallet.expiry_date")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.note")),l("th",{scope:"col",class:"s-loyalty-program-table-head-tr-th"},salla.lang.get("common.elements.status")))),l("tbody",{class:"s-loyalty-program-table-tbody"},this.loyaltyPointsArray.map((a=>l("tr",{class:"s-loyalty-program-table-tbody-tr"},l("td",{class:"s-loyalty-program-table-tbody-tr-td"},"plus"===a?.type?"+":"",a?.points||""," ",salla.lang.get("pages.loyalty_program.point")),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},o(a?.created_at?1e3*Number(a.created_at):void 0)),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},o(a?.points_expire_date)),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(a?.key)),l("td",{class:"s-loyalty-program-table-tbody-tr-td"},r(a?.status_key))))))),l("div",{class:"s-infinite-scroll-wrapper"},!!this.nextPageUrlLoyalty&&l("salla-button",{onClick:this.handleClick,loading:this.isLoadingLoyalty},salla.lang.get("common.elements.load_more")))):l("div",null,l("div",{class:"s-loyalty-program-table-empty-state"},l("span",{innerHTML:s}),l("div",{class:"s-loyalty-program-table-placeholder-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_title")),l("div",{class:"s-loyalty-program-table-placeholder-sub-title"},salla.lang.get("pages.loyalty_program.no_loyality_points_sub_title")))))))}};e.style="";export{e as salla_loyalty_program}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as s,H as a}from"./p-
|
|
4
|
+
import{r as e,h as s,H as a}from"./p-09rQwPEf.js";const r=class{constructor(s){e(this,s),this.dark=!1,this.commercialRegisterLabel="",this.freelanceLabel=""}componentWillLoad(){this.initializeTranslations()}initializeTranslations(){salla.lang.onLoaded((()=>{const e=(e,s,a)=>{salla.helpers.setNested(salla.lang.messages[e],s,a)};e("ar.trans","blocks.footer.commercial_register","السجل التجاري"),e("en.trans","blocks.footer.commercial_register","Commercial Register"),e("ar.trans","blocks.footer.freelance","وثيقة العمل الحر"),e("en.trans","blocks.footer.freelance","Freelance Certificate"),this.commercialRegisterLabel=salla.lang.getWithDefault("blocks.footer.commercial_register","السجل التجاري"),this.freelanceLabel=salla.lang.getWithDefault("blocks.footer.freelance","وثيقة العمل الحر")}))}getBadgeData(){const e=salla.config.get("store.settings.commercial_number"),s=salla.config.get("store.settings.freelance_number");return e?{number:e,label:this.commercialRegisterLabel||"السجل التجاري",imageUrl:salla.url.cdn("images/commercial-register.png",70,70),type:"commercial"}:s?{number:s,label:this.freelanceLabel||"وثيقة العمل الحر",imageUrl:this.dark?salla.url.cdn("images/freelance-white.png"):salla.url.cdn("images/freelance.png"),type:"freelance"}:null}render(){const e=this.getBadgeData();return e?s(a,{class:"s-trust-badges-wrapper "+(this.dark?"dark":"")},s("img",{class:"s-trust-badges-image",width:"55",height:"55",src:e.imageUrl,alt:e.label}),s("div",{class:"s-trust-badges-content"},s("p",{class:"s-trust-badges-label"},e.label),s("b",{class:"s-trust-badges-number"},e.number))):null}};r.style="";export{r as salla_trust_badges}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as a,h as
|
|
4
|
+
import{r as a,h as t,H as s,a as e}from"./p-09rQwPEf.js";const i=class{constructor(t){if(a(this,t),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(a){salla.log("Bad json passed via entityId prop")}}getValue(a){if("file"===a.type)return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===a.type)return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`;if("date"===a.type){const t=new Date(a.value);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}return a.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const a=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=a.data[0]?.sections}render(){if(this.specs.length)return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};i.style="";export{i as salla_metadata}
|