@webority/ui-elements 0.49.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/{WuiPhone-GJglNelp.js → WuiPhone-CSUVhYSb.js} +2 -2
- package/dist/WuiTour-CE7SQAso.js +169 -0
- package/dist/elements/phone.js +1 -1
- package/dist/elements/tour.js +1 -1
- package/dist/ui-elements.global.js +158 -4
- package/dist/ui-elements.js +1 -1
- package/dist/ui-tour.global.js +1 -0
- package/package.json +3 -2
- package/dist/WuiTour-DiKZEWeb.js +0 -15
package/README.md
CHANGED
|
@@ -23,6 +23,11 @@ npm install --save-exact @webority/ui-elements
|
|
|
23
23
|
import '@webority/ui-elements'; // registers the custom elements
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
A page that uses nothing else from this library and loads no theme can show a product tour
|
|
27
|
+
with `@webority/ui-elements/tour` (`ui-tour.global.js`). The script registers `<wui-tour>` and
|
|
28
|
+
`<wui-tour-step>` and nothing else. Set `isolated` on the tour so that it renders in its own
|
|
29
|
+
shadow root with its own styles and adds nothing to the page's CSS.
|
|
30
|
+
|
|
26
31
|
Component catalogue: <https://ui-react.webority.dev>
|
|
27
32
|
|
|
28
33
|
## Authoring a `<wui-*>` element
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-WcDeH46q.js";import{t as i}from"./formMirror-BgY7zkC3.js";import{t as a}from"./iconGlyphs.g-CUm_mfze.js";import{n as o}from"./listboxKeyNav-DMIvs9d6.js";import{n as s,t as c}from"./countries-CvmZ2xpG.js";var l={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},u=new Set(c.map(([e])=>e)),d=new Map;for(let[e,t]of Object.entries(l))for(let n of t)d.set(n,e);function f(e){let t=d.get(e);return t&&u.has(t)?t:null}function p(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&u.has(t)?t:null}function m(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return f(e)||p(t)||`IN`}function h(){return Promise.all([import(`./max-CNrKnpEj.js`),import(`./examples.mobile.json-GS1_MGh9.js`)]).then(([e,t])=>g(e,t.default||t))}function g(e,t){return{AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isValidPhoneNumber:e.isValidPhoneNumber,parsePhoneNumber:e.parsePhoneNumber,examples:t}}var _=e=>`wui-flag wui-flag-${String(e).toLowerCase()}`,v=null,y=null;function b(){return v?Promise.resolve(v):(y||=h().then(e=>(v=e,v)).catch(()=>null),y)}function x(e,t){let n=`+${s(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function S(e,t){if(!v||!t)return t;try{return x(e,new v.AsYouType(e).input(`+${s(e)}${t}`))||t}catch{return t}}function C(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function w(e){if(!v)return null;try{return x(e,v.getExampleNumber(e,v.examples)?.formatInternational())||null}catch{return null}}function T(e){if(!v||!e)return null;try{if(!v.isValidPhoneNumber(e))return!1;let t=v.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function E(e){if(!v)return null;try{let t=v.getExampleNumber(e,v.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function D(e,t,n){try{let r=v.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function O(e){if(!v||!e?.trim().startsWith(`+`))return null;try{let t=new v.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}var k=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`placeholder`,`disabled`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=m(),this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n));return}if(e===`aria-describedby`){this._syncDescribedBy();return}e===`country`&&(this._country=n||this._defaultCountry,this._suppressCountryRender)||this.render()}}formResetCallback(){this.value=this._defaultValue||``}get value(){return this._national?`+${s(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim(),n=O(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(s(this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){i(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||w(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t,this.innerHTML=`
|
|
1
|
+
import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-WcDeH46q.js";import{t as i}from"./formMirror-BgY7zkC3.js";import{t as a}from"./iconGlyphs.g-CUm_mfze.js";import{n as o}from"./listboxKeyNav-DMIvs9d6.js";import{n as s,t as c}from"./countries-CvmZ2xpG.js";var l={AD:[`Europe/Andorra`],AE:[`Asia/Dubai`],AF:[`Asia/Kabul`],AG:[`America/Antigua`],AI:[`America/Anguilla`],AL:[`Europe/Tirane`],AM:[`Asia/Yerevan`],AO:[`Africa/Luanda`],AR:[`America/Argentina/Buenos_Aires`,`America/Argentina/Catamarca`,`America/Argentina/ComodRivadavia`,`America/Argentina/Cordoba`,`America/Argentina/Jujuy`,`America/Argentina/La_Rioja`,`America/Argentina/Mendoza`,`America/Argentina/Rio_Gallegos`,`America/Argentina/Salta`,`America/Argentina/San_Juan`,`America/Argentina/San_Luis`,`America/Argentina/Tucuman`,`America/Argentina/Ushuaia`,`America/Buenos_Aires`,`America/Catamarca`,`America/Cordoba`,`America/Jujuy`,`America/Mendoza`,`America/Rosario`],AS:[`Pacific/Pago_Pago`,`Pacific/Samoa`,`US/Samoa`],AT:[`Europe/Vienna`],AU:[`Antarctica/Macquarie`,`Australia/Adelaide`,`Australia/Brisbane`,`Australia/Broken_Hill`,`Australia/Canberra`,`Australia/Currie`,`Australia/Darwin`,`Australia/Eucla`,`Australia/Hobart`,`Australia/LHI`,`Australia/Lindeman`,`Australia/Lord_Howe`,`Australia/Melbourne`,`Australia/NSW`,`Australia/North`,`Australia/Perth`,`Australia/Queensland`,`Australia/South`,`Australia/Sydney`,`Australia/Tasmania`,`Australia/Victoria`,`Australia/West`,`Australia/Yancowinna`],AW:[`America/Aruba`],AX:[`Europe/Mariehamn`],AZ:[`Asia/Baku`],BA:[`Europe/Sarajevo`],BB:[`America/Barbados`],BD:[`Asia/Dacca`,`Asia/Dhaka`],BE:[`Europe/Brussels`],BF:[`Africa/Ouagadougou`],BG:[`Europe/Sofia`],BH:[`Asia/Bahrain`],BI:[`Africa/Bujumbura`],BJ:[`Africa/Porto-Novo`],BL:[`America/St_Barthelemy`],BM:[`Atlantic/Bermuda`],BN:[`Asia/Brunei`],BO:[`America/La_Paz`],BQ:[`America/Kralendijk`],BR:[`America/Araguaina`,`America/Bahia`,`America/Belem`,`America/Boa_Vista`,`America/Campo_Grande`,`America/Cuiaba`,`America/Eirunepe`,`America/Fortaleza`,`America/Maceio`,`America/Manaus`,`America/Noronha`,`America/Porto_Acre`,`America/Porto_Velho`,`America/Recife`,`America/Rio_Branco`,`America/Santarem`,`America/Sao_Paulo`,`Brazil/DeNoronha`,`Brazil/East`,`Brazil/West`],BS:[`America/Nassau`],BT:[`Asia/Thimbu`,`Asia/Thimphu`],BW:[`Africa/Gaborone`],BY:[`Europe/Minsk`],BZ:[`America/Belize`],CA:`America/Atikokan.America/Blanc-Sablon.America/Cambridge_Bay.America/Coral_Harbour.America/Creston.America/Dawson.America/Dawson_Creek.America/Edmonton.America/Fort_Nelson.America/Glace_Bay.America/Goose_Bay.America/Halifax.America/Inuvik.America/Iqaluit.America/Moncton.America/Montreal.America/Nipigon.America/Pangnirtung.America/Rainy_River.America/Rankin_Inlet.America/Regina.America/Resolute.America/St_Johns.America/Swift_Current.America/Thunder_Bay.America/Toronto.America/Vancouver.America/Whitehorse.America/Winnipeg.America/Yellowknife.Canada/Atlantic.Canada/Central.Canada/Eastern.Canada/Mountain.Canada/Newfoundland.Canada/Pacific.Canada/Saskatchewan.Canada/Yukon`.split(`.`),CC:[`Indian/Cocos`],CD:[`Africa/Kinshasa`,`Africa/Lubumbashi`],CF:[`Africa/Bangui`],CG:[`Africa/Brazzaville`],CH:[`Europe/Zurich`],CI:[`Africa/Abidjan`],CK:[`Pacific/Rarotonga`],CL:[`America/Coyhaique`,`America/Punta_Arenas`,`America/Santiago`,`Chile/Continental`,`Chile/EasterIsland`,`Pacific/Easter`],CM:[`Africa/Douala`],CN:[`Asia/Chongqing`,`Asia/Harbin`,`Asia/Kashgar`,`Asia/Shanghai`,`Asia/Urumqi`],CO:[`America/Bogota`],CR:[`America/Costa_Rica`],CU:[`America/Havana`],CV:[`Atlantic/Cape_Verde`],CW:[`America/Curacao`],CX:[`Indian/Christmas`],CY:[`Asia/Famagusta`,`Asia/Nicosia`,`Europe/Nicosia`],CZ:[`Europe/Prague`],DE:[`Europe/Berlin`,`Europe/Busingen`],DJ:[`Africa/Djibouti`],DK:[`Europe/Copenhagen`],DM:[`America/Dominica`],DO:[`America/Santo_Domingo`],DZ:[`Africa/Algiers`],EC:[`America/Guayaquil`,`Pacific/Galapagos`],EE:[`Europe/Tallinn`],EG:[`Africa/Cairo`],EH:[`Africa/El_Aaiun`],ER:[`Africa/Asmara`,`Africa/Asmera`],ES:[`Africa/Ceuta`,`Atlantic/Canary`,`Europe/Madrid`],ET:[`Africa/Addis_Ababa`],FI:[`Europe/Helsinki`],FJ:[`Pacific/Fiji`],FK:[`Atlantic/Stanley`],FM:[`Pacific/Chuuk`,`Pacific/Kosrae`,`Pacific/Pohnpei`,`Pacific/Ponape`,`Pacific/Truk`,`Pacific/Yap`],FO:[`Atlantic/Faeroe`,`Atlantic/Faroe`],FR:[`Europe/Paris`],GA:[`Africa/Libreville`],GB:[`Europe/Belfast`,`Europe/London`],GD:[`America/Grenada`],GE:[`Asia/Tbilisi`],GF:[`America/Cayenne`],GG:[`Europe/Guernsey`],GH:[`Africa/Accra`],GI:[`Europe/Gibraltar`],GL:[`America/Danmarkshavn`,`America/Godthab`,`America/Nuuk`,`America/Scoresbysund`,`America/Thule`],GM:[`Africa/Banjul`],GN:[`Africa/Conakry`],GP:[`America/Guadeloupe`],GQ:[`Africa/Malabo`],GR:[`Europe/Athens`],GT:[`America/Guatemala`],GU:[`Pacific/Guam`],GW:[`Africa/Bissau`],GY:[`America/Guyana`],HK:[`Asia/Hong_Kong`],HN:[`America/Tegucigalpa`],HR:[`Europe/Zagreb`],HT:[`America/Port-au-Prince`],HU:[`Europe/Budapest`],ID:[`Asia/Jakarta`,`Asia/Jayapura`,`Asia/Makassar`,`Asia/Pontianak`,`Asia/Ujung_Pandang`],IE:[`Europe/Dublin`],IL:[`Asia/Jerusalem`,`Asia/Tel_Aviv`],IM:[`Europe/Isle_of_Man`],IN:[`Asia/Calcutta`,`Asia/Kolkata`],IO:[`Indian/Chagos`],IQ:[`Asia/Baghdad`],IR:[`Asia/Tehran`],IS:[`Atlantic/Reykjavik`],IT:[`Europe/Rome`],JE:[`Europe/Jersey`],JM:[`America/Jamaica`],JO:[`Asia/Amman`],JP:[`Asia/Tokyo`],KE:[`Africa/Nairobi`],KG:[`Asia/Bishkek`],KH:[`Asia/Phnom_Penh`],KI:[`Pacific/Enderbury`,`Pacific/Kanton`,`Pacific/Kiritimati`,`Pacific/Tarawa`],KM:[`Indian/Comoro`],KN:[`America/St_Kitts`],KP:[`Asia/Pyongyang`],KR:[`Asia/Seoul`],KW:[`Asia/Kuwait`],KY:[`America/Cayman`],KZ:[`Asia/Almaty`,`Asia/Aqtau`,`Asia/Aqtobe`,`Asia/Atyrau`,`Asia/Oral`,`Asia/Qostanay`,`Asia/Qyzylorda`],LA:[`Asia/Vientiane`],LB:[`Asia/Beirut`],LC:[`America/St_Lucia`],LI:[`Europe/Vaduz`],LK:[`Asia/Colombo`],LR:[`Africa/Monrovia`],LS:[`Africa/Maseru`],LT:[`Europe/Vilnius`],LU:[`Europe/Luxembourg`],LV:[`Europe/Riga`],LY:[`Africa/Tripoli`],MA:[`Africa/Casablanca`],MC:[`Europe/Monaco`],MD:[`Europe/Chisinau`,`Europe/Tiraspol`],ME:[`Europe/Podgorica`],MF:[`America/Marigot`],MG:[`Indian/Antananarivo`],MH:[`Pacific/Kwajalein`,`Pacific/Majuro`],MK:[`Europe/Skopje`],ML:[`Africa/Bamako`,`Africa/Timbuktu`],MM:[`Asia/Rangoon`,`Asia/Yangon`],MN:[`Asia/Choibalsan`,`Asia/Hovd`,`Asia/Ulaanbaatar`,`Asia/Ulan_Bator`],MO:[`Asia/Macao`,`Asia/Macau`],MP:[`Pacific/Saipan`],MQ:[`America/Martinique`],MR:[`Africa/Nouakchott`],MS:[`America/Montserrat`],MT:[`Europe/Malta`],MU:[`Indian/Mauritius`],MV:[`Indian/Maldives`],MW:[`Africa/Blantyre`],MX:[`America/Bahia_Banderas`,`America/Cancun`,`America/Chihuahua`,`America/Ciudad_Juarez`,`America/Ensenada`,`America/Hermosillo`,`America/Matamoros`,`America/Mazatlan`,`America/Merida`,`America/Mexico_City`,`America/Monterrey`,`America/Ojinaga`,`America/Santa_Isabel`,`America/Tijuana`,`Mexico/BajaNorte`,`Mexico/BajaSur`,`Mexico/General`],MY:[`Asia/Kuala_Lumpur`,`Asia/Kuching`],MZ:[`Africa/Maputo`],NA:[`Africa/Windhoek`],NC:[`Pacific/Noumea`],NE:[`Africa/Niamey`],NF:[`Pacific/Norfolk`],NG:[`Africa/Lagos`],NI:[`America/Managua`],NL:[`Europe/Amsterdam`],NO:[`Europe/Oslo`],NP:[`Asia/Kathmandu`,`Asia/Katmandu`],NR:[`Pacific/Nauru`],NU:[`Pacific/Niue`],NZ:[`Pacific/Auckland`,`Pacific/Chatham`],OM:[`Asia/Muscat`],PA:[`America/Panama`],PE:[`America/Lima`],PF:[`Pacific/Gambier`,`Pacific/Marquesas`,`Pacific/Tahiti`],PG:[`Pacific/Bougainville`,`Pacific/Port_Moresby`],PH:[`Asia/Manila`],PK:[`Asia/Karachi`],PL:[`Europe/Warsaw`],PM:[`America/Miquelon`],PR:[`America/Puerto_Rico`],PS:[`Asia/Gaza`,`Asia/Hebron`],PT:[`Atlantic/Azores`,`Atlantic/Madeira`,`Europe/Lisbon`],PW:[`Pacific/Palau`],PY:[`America/Asuncion`],QA:[`Asia/Qatar`],RE:[`Indian/Reunion`],RO:[`Europe/Bucharest`],RS:[`Europe/Belgrade`],RU:`Asia/Anadyr.Asia/Barnaul.Asia/Chita.Asia/Irkutsk.Asia/Kamchatka.Asia/Khandyga.Asia/Krasnoyarsk.Asia/Magadan.Asia/Novokuznetsk.Asia/Novosibirsk.Asia/Omsk.Asia/Sakhalin.Asia/Srednekolymsk.Asia/Tomsk.Asia/Ust-Nera.Asia/Vladivostok.Asia/Yakutsk.Asia/Yekaterinburg.Europe/Astrakhan.Europe/Kaliningrad.Europe/Kirov.Europe/Moscow.Europe/Samara.Europe/Saratov.Europe/Ulyanovsk.Europe/Volgograd`.split(`.`),RW:[`Africa/Kigali`],SA:[`Asia/Riyadh`],SB:[`Pacific/Guadalcanal`],SC:[`Indian/Mahe`],SD:[`Africa/Khartoum`],SE:[`Europe/Stockholm`],SG:[`Asia/Singapore`],SH:[`Atlantic/St_Helena`],SI:[`Europe/Ljubljana`],SJ:[`Arctic/Longyearbyen`,`Atlantic/Jan_Mayen`],SK:[`Europe/Bratislava`],SL:[`Africa/Freetown`],SM:[`Europe/San_Marino`],SN:[`Africa/Dakar`],SO:[`Africa/Mogadishu`],SR:[`America/Paramaribo`],SS:[`Africa/Juba`],ST:[`Africa/Sao_Tome`],SV:[`America/El_Salvador`],SX:[`America/Lower_Princes`],SY:[`Asia/Damascus`],SZ:[`Africa/Mbabane`],TC:[`America/Grand_Turk`],TD:[`Africa/Ndjamena`],TG:[`Africa/Lome`],TH:[`Asia/Bangkok`],TJ:[`Asia/Dushanbe`],TK:[`Pacific/Fakaofo`],TL:[`Asia/Dili`],TM:[`Asia/Ashgabat`,`Asia/Ashkhabad`],TN:[`Africa/Tunis`],TO:[`Pacific/Tongatapu`],TR:[`Asia/Istanbul`,`Europe/Istanbul`],TT:[`America/Port_of_Spain`],TV:[`Pacific/Funafuti`],TW:[`Asia/Taipei`],TZ:[`Africa/Dar_es_Salaam`],UA:[`Europe/Kiev`,`Europe/Kyiv`,`Europe/Simferopol`,`Europe/Uzhgorod`,`Europe/Zaporozhye`],UG:[`Africa/Kampala`],US:`America/Adak.America/Anchorage.America/Atka.America/Boise.America/Chicago.America/Denver.America/Detroit.America/Fort_Wayne.America/Indiana/Indianapolis.America/Indiana/Knox.America/Indiana/Marengo.America/Indiana/Petersburg.America/Indiana/Tell_City.America/Indiana/Vevay.America/Indiana/Vincennes.America/Indiana/Winamac.America/Indianapolis.America/Juneau.America/Kentucky/Louisville.America/Kentucky/Monticello.America/Knox_IN.America/Los_Angeles.America/Louisville.America/Menominee.America/Metlakatla.America/New_York.America/Nome.America/North_Dakota/Beulah.America/North_Dakota/Center.America/North_Dakota/New_Salem.America/Phoenix.America/Shiprock.America/Sitka.America/Yakutat.Pacific/Honolulu.US/Alaska.US/Aleutian.US/Arizona.US/Central.US/East-Indiana.US/Eastern.US/Hawaii.US/Indiana-Starke.US/Michigan.US/Mountain.US/Pacific`.split(`.`),UY:[`America/Montevideo`],UZ:[`Asia/Samarkand`,`Asia/Tashkent`],VA:[`Europe/Vatican`],VC:[`America/St_Vincent`],VE:[`America/Caracas`],VG:[`America/Tortola`],VI:[`America/St_Thomas`,`America/Virgin`],VN:[`Asia/Ho_Chi_Minh`,`Asia/Saigon`],VU:[`Pacific/Efate`],WF:[`Pacific/Wallis`],WS:[`Pacific/Apia`],YE:[`Asia/Aden`],YT:[`Indian/Mayotte`],ZA:[`Africa/Johannesburg`],ZM:[`Africa/Lusaka`],ZW:[`Africa/Harare`]},u=new Set(c.map(([e])=>e)),d=new Map;for(let[e,t]of Object.entries(l))for(let n of t)d.set(n,e);function f(e){let t=d.get(e);return t&&u.has(t)?t:null}function p(e){if(!e)return null;let t;try{t=new Intl.Locale(e).region}catch{return null}return t&&u.has(t)?t:null}function m(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{e=void 0}let t=typeof navigator>`u`?void 0:navigator.language;return f(e)||p(t)||`IN`}function h(){return Promise.all([import(`./max-CNrKnpEj.js`),import(`./examples.mobile.json-GS1_MGh9.js`)]).then(([e,t])=>g(e,t.default||t))}function g(e,t){return{AsYouType:e.AsYouType,getExampleNumber:e.getExampleNumber,isValidPhoneNumber:e.isValidPhoneNumber,parsePhoneNumber:e.parsePhoneNumber,examples:t}}var _=e=>`wui-flag wui-flag-${String(e).toLowerCase()}`,v=null,y=null;function b(){return v?Promise.resolve(v):(y||=h().then(e=>(v=e,v)).catch(()=>null),y)}function x(e,t){let n=`+${s(e)}`;return t?.startsWith(n)?t.slice(n.length).trimStart():null}function S(e,t){if(!v||!t)return t;try{return x(e,new v.AsYouType(e).input(`+${s(e)}${t}`))||t}catch{return t}}function C(e,t){if(t<=0)return 0;let n=0;for(let r=0;r<e.length;r++)if(/[0-9]/.test(e[r])&&(n+=1,n===t))return r+1;return e.length}function w(e){if(!v)return null;try{return x(e,v.getExampleNumber(e,v.examples)?.formatInternational())||null}catch{return null}}function T(e){if(!v||!e)return null;try{if(!v.isValidPhoneNumber(e))return!1;let t=v.parsePhoneNumber(e)?.getType?.();return t===void 0||t===`MOBILE`||t===`FIXED_LINE_OR_MOBILE`}catch{return null}}function E(e){if(!v)return null;try{let t=v.getExampleNumber(e,v.examples);return t?.nationalNumber?t.nationalNumber.length:null}catch{return null}}function D(e,t,n){try{let r=v.parsePhoneNumber(t,e),i=r?.nationalNumber;return!i||r.country!==e||i.length>n||!t.endsWith(i)?null:i}catch{return null}}function O(e){if(!v||!e?.trim().startsWith(`+`))return null;try{let t=new v.AsYouType;t.input(e.trim());let n=t.getCountry();return n?{country:n,national:t.getNationalNumber()||``}:null}catch{return null}}var k=class extends e{static formAssociated=!0;static get observedAttributes(){return[`value`,`country`,`placeholder`,`disabled`,`required`,`aria-label`,`aria-describedby`]}constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=null}this._defaultCountry=m(),this._country=this._defaultCountry,this._national=``,this._active=-1,this._committedValue=``,this._validateOnInput=!1}connectedCallback(){if(!this._rendered){this.render();return}this._bindGlobal?.()}attributeChangedCallback(e,t,n){if(e===`value`){this.value=n;return}if(this._rendered){if(e===`aria-label`){let t=this.querySelector(`input[type=tel]`);t&&(n==null?t.removeAttribute(e):t.setAttribute(e,n));return}if(e===`aria-describedby`){this._syncDescribedBy();return}e===`country`&&(this._country=n||this._defaultCountry,this._suppressCountryRender)||this.render()}}formResetCallback(){this._validateOnInput=!1,this.value=this._defaultValue||``}get value(){return this._national?`+${s(this._country)}${this._national}`:``}set value(e){let t=String(e??``).trim(),n=O(t);if(n)this._country=n.country,this._national=n.national.replace(/[^0-9]/g,``);else if(t.startsWith(`+`)){let e=t.replace(/[^0-9]/g,``),n=String(s(this._country));n&&e.startsWith(n)&&(e=e.slice(n.length)),this._national=e}else this._national=t.replace(/[^0-9]/g,``);n&&this.getAttribute(`country`)!==this._country?this.setAttribute(`country`,this._country):this._rendered&&this.render(),this._committedValue=this.value,this._syncMirror()}_syncMirror(){i(this,this.value)}_syncDescribedBy(){let e=this.querySelector(`input[type=tel]`);if(!e)return;let t=[this.getAttribute(`aria-describedby`),this.querySelector(`[data-phone-error]`)?.id].filter(Boolean);t.length?e.setAttribute(`aria-describedby`,t.join(` `)):e.removeAttribute(`aria-describedby`)}_emitInput(){this.dispatchEvent(new Event(`input`,{bubbles:!0}))}_emitChange(){this._committedValue=this.value,this.dispatchEvent(new Event(`change`,{bubbles:!0}))}render(){this._defaultValue===void 0&&(this._defaultValue=this.getAttribute(`value`)||``),this._country=this.getAttribute(`country`)||this._country;let e=this.getAttribute(`placeholder`)||w(this._country)||`Enter phone number`;this.id||=`wui-phone-${Math.random().toString(36).slice(2,9)}`;let t=`${this.id}-listbox`;this._listboxId=t,this.innerHTML=`
|
|
2
2
|
<div class="phone-input-wrap">
|
|
3
3
|
<div class="phone-country-adornment">
|
|
4
4
|
<button type="button" class="country-toggle" aria-label="Choose country" aria-haspopup="listbox" aria-expanded="false" aria-controls="${A(t)}"${this.hasAttribute(`disabled`)?` disabled`:``}>
|
|
@@ -12,4 +12,4 @@ import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from".
|
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
14
|
<input type="tel" class="input" placeholder="${A(e)}" value="${A(S(this._country,this._national))}"${this.getAttribute(`aria-label`)?` aria-label="${A(this.getAttribute(`aria-label`))}"`:``}${this.getAttribute(`aria-describedby`)?` aria-describedby="${A(this.getAttribute(`aria-describedby`))}"`:``}${this.hasAttribute(`required`)?` required aria-required="true"`:``}${this.hasAttribute(`disabled`)?` disabled`:``} />
|
|
15
|
-
</div>`,this._rendered=!0,i(this,this.value),this._wire()}_ensureItems(){let e=this.querySelector(`.country-list-scroll`);if(!e||e.querySelector(`.country-dropdown-item`))return;let t=this._listboxId,n=c.map(([e,n,r],i)=>`<button type="button" role="option" id="${A(`${t}-opt-${i}`)}" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}" aria-selected="${e===this._country}"><span class="${_(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join(``);e.insertAdjacentHTML(`afterbegin`,n)}_itemEls(){return[...this.querySelectorAll(`.country-dropdown-item`)]}_visibleItems(){return this._itemEls().filter(e=>!e.hidden)}_wire(){this._teardown();let e=this.querySelector(`.country-toggle`),i=this.querySelector(`.phone-input-wrap`),a=this.querySelector(`.country-dropdown-menu`),c=this.querySelector(`.dropdown-search-input`),l=this.querySelector(`.country-list-scroll`),u=this.querySelector(`.country-empty`),d=this.querySelector(`input[type=tel]`),f=this.querySelector(`[data-flag]`),p=this.querySelector(`[data-dial]`);if(!e||!a)return;let m=()=>!a.hidden,h=()=>r(i||e,a),g=(e,{reveal:t=!0}={})=>{let n=this._visibleItems();this._active=e,o(l,e>=0&&n[e]||null),e>=0&&n[e]?(t&&n[e].scrollIntoView({block:`nearest`}),c?.setAttribute(`aria-activedescendant`,n[e].id)):c?.removeAttribute(`aria-activedescendant`)},v=()=>{m()&&h()},y=()=>{this._ensureItems(),a.hidden=!1,e.setAttribute(`aria-expanded`,`true`),c.value=``,k(``),h(),t(this,v),c.focus(),g(this._visibleItems().findIndex(e=>e.classList.contains(`selected`)))},x=()=>{a.hidden=!0,e.setAttribute(`aria-expanded`,`false`),g(-1),n(this)},k=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of this._itemEls()){let r=!t||e.textContent.toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}u&&(u.hidden=n>0)},A=e=>{this._country=e,this.getAttribute(`country`)!==e&&(this._suppressCountryRender=!0,this.setAttribute(`country`,e),this._suppressCountryRender=!1),f&&(f.className=_(e)),p&&(p.textContent=`+${s(e)}`);for(let t of this._itemEls()){let n=t.dataset.iso===e;t.classList.toggle(`selected`,n),t.setAttribute(`aria-selected`,String(n))}!this.getAttribute(`placeholder`)&&d&&(d.placeholder=w(e)||`Enter phone number`),d&&this._national&&(d.value=S(e,this._national)),x(),this._syncMirror(),this._emitChange(),d?.focus()},j=t=>{let n=this._visibleItems();if(t.key===`ArrowDown`){if(t.preventDefault(),!m()){y();return}g(Math.min(this._active+1,n.length-1))}else if(t.key===`ArrowUp`){if(t.preventDefault(),!m())return;g(Math.max(this._active-1,0))}else t.key===`Enter`?(t.preventDefault(),m()&&n[this._active]&&A(n[this._active].dataset.iso)):t.key===`Escape`&&m()&&(t.preventDefault(),x(),e.focus())};e.addEventListener(`click`,()=>m()?x():y()),e.addEventListener(`keydown`,e=>{if(m()){j(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y())}),c.addEventListener(`input`,()=>{k(c.value);let e=this._visibleItems();g(e.length?0:-1)}),l.addEventListener(`click`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&A(t.dataset.iso)}),l.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&!t.classList.contains(`is-active`)&&g(this._visibleItems().indexOf(t),{reveal:!1})}),l.addEventListener(`mouseleave`,()=>g(-1)),a.addEventListener(`keydown`,j);let M=e=>{d.classList.toggle(`is-invalid`,e),e?d.setAttribute(`aria-invalid`,`true`):d.removeAttribute(`aria-invalid`);let t=this.querySelector(`[data-phone-error]`);if(e){t||(t=document.createElement(`div`),t.className=`field-error`,t.id=`${this.id}-phone-error`,t.setAttribute(`data-phone-error`,``),i.after(t));let e=w(this._country);t.textContent=e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`}else t?.remove();this._syncDescribedBy()};d.addEventListener(`input`,e=>{e.stopPropagation();let t=d.selectionStart??d.value.length,n=d.value.slice(0,t).replace(/[^0-9]/g,``).length,r=d.value.replace(/[^0-9]/g,``),i=E(this._country);if(i&&r.length>i){let e=D(this._country,r,i);e?(n=Math.max(0,n-(r.length-e.length)),r=e):r=r.slice(0,i)}this._national=r;let a=S(this._country,this._national);if(d.value!==a){d.value=a;let e=C(a,Math.min(n,r.length));d.setSelectionRange(e,e)}this._syncMirror(),this._emitInput(),
|
|
15
|
+
</div>`,this._rendered=!0,i(this,this.value),this._wire()}_ensureItems(){let e=this.querySelector(`.country-list-scroll`);if(!e||e.querySelector(`.country-dropdown-item`))return;let t=this._listboxId,n=c.map(([e,n,r],i)=>`<button type="button" role="option" id="${A(`${t}-opt-${i}`)}" class="country-dropdown-item${e===this._country?` selected`:``}" data-iso="${e}" aria-selected="${e===this._country}"><span class="${_(e)}" aria-hidden="true"></span><span class="country-name-text">${n}<span class="country-code-text">+${r}</span></span></button>`).join(``);e.insertAdjacentHTML(`afterbegin`,n)}_itemEls(){return[...this.querySelectorAll(`.country-dropdown-item`)]}_visibleItems(){return this._itemEls().filter(e=>!e.hidden)}_wire(){this._teardown();let e=this.querySelector(`.country-toggle`),i=this.querySelector(`.phone-input-wrap`),a=this.querySelector(`.country-dropdown-menu`),c=this.querySelector(`.dropdown-search-input`),l=this.querySelector(`.country-list-scroll`),u=this.querySelector(`.country-empty`),d=this.querySelector(`input[type=tel]`),f=this.querySelector(`[data-flag]`),p=this.querySelector(`[data-dial]`);if(!e||!a)return;let m=()=>!a.hidden,h=()=>r(i||e,a),g=(e,{reveal:t=!0}={})=>{let n=this._visibleItems();this._active=e,o(l,e>=0&&n[e]||null),e>=0&&n[e]?(t&&n[e].scrollIntoView({block:`nearest`}),c?.setAttribute(`aria-activedescendant`,n[e].id)):c?.removeAttribute(`aria-activedescendant`)},v=()=>{m()&&h()},y=()=>{this._ensureItems(),a.hidden=!1,e.setAttribute(`aria-expanded`,`true`),c.value=``,k(``),h(),t(this,v),c.focus(),g(this._visibleItems().findIndex(e=>e.classList.contains(`selected`)))},x=()=>{a.hidden=!0,e.setAttribute(`aria-expanded`,`false`),g(-1),n(this)},k=e=>{let t=e.trim().toLowerCase(),n=0;for(let e of this._itemEls()){let r=!t||e.textContent.toLowerCase().includes(t);e.hidden=!r,r&&(n+=1)}u&&(u.hidden=n>0)},A=e=>{this._country=e,this.getAttribute(`country`)!==e&&(this._suppressCountryRender=!0,this.setAttribute(`country`,e),this._suppressCountryRender=!1),f&&(f.className=_(e)),p&&(p.textContent=`+${s(e)}`);for(let t of this._itemEls()){let n=t.dataset.iso===e;t.classList.toggle(`selected`,n),t.setAttribute(`aria-selected`,String(n))}!this.getAttribute(`placeholder`)&&d&&(d.placeholder=w(e)||`Enter phone number`),d&&this._national&&(d.value=S(e,this._national)),x(),this._syncMirror(),this._emitChange(),this._validateOnInput&&M(N()),d?.focus()},j=t=>{let n=this._visibleItems();if(t.key===`ArrowDown`){if(t.preventDefault(),!m()){y();return}g(Math.min(this._active+1,n.length-1))}else if(t.key===`ArrowUp`){if(t.preventDefault(),!m())return;g(Math.max(this._active-1,0))}else t.key===`Enter`?(t.preventDefault(),m()&&n[this._active]&&A(n[this._active].dataset.iso)):t.key===`Escape`&&m()&&(t.preventDefault(),x(),e.focus())};e.addEventListener(`click`,()=>m()?x():y()),e.addEventListener(`keydown`,e=>{if(m()){j(e);return}(e.key===`ArrowDown`||e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y())}),c.addEventListener(`input`,()=>{k(c.value);let e=this._visibleItems();g(e.length?0:-1)}),l.addEventListener(`click`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&A(t.dataset.iso)}),l.addEventListener(`mousemove`,e=>{let t=e.target.closest(`.country-dropdown-item`);t&&!t.classList.contains(`is-active`)&&g(this._visibleItems().indexOf(t),{reveal:!1})}),l.addEventListener(`mouseleave`,()=>g(-1)),a.addEventListener(`keydown`,j);let M=e=>{d.classList.toggle(`is-invalid`,e),e?d.setAttribute(`aria-invalid`,`true`):d.removeAttribute(`aria-invalid`);let t=this.querySelector(`[data-phone-error]`);if(e){t||(t=document.createElement(`div`),t.className=`field-error`,t.id=`${this.id}-phone-error`,t.setAttribute(`data-phone-error`,``),i.after(t));let e=w(this._country);t.textContent=e?`Enter a valid phone number, e.g. ${e}`:`Enter a valid phone number`}else t?.remove();this._syncDescribedBy()},N=()=>this._national.length>0&&T(this.value)===!1;d.addEventListener(`input`,e=>{e.stopPropagation();let t=d.selectionStart??d.value.length,n=d.value.slice(0,t).replace(/[^0-9]/g,``).length,r=d.value.replace(/[^0-9]/g,``),i=E(this._country);if(i&&r.length>i){let e=D(this._country,r,i);e?(n=Math.max(0,n-(r.length-e.length)),r=e):r=r.slice(0,i)}this._national=r;let a=S(this._country,this._national);if(d.value!==a){d.value=a;let e=C(a,Math.min(n,r.length));d.setSelectionRange(e,e)}this._syncMirror(),this._emitInput(),this._validateOnInput&&M(N())}),d.addEventListener(`change`,e=>e.stopPropagation()),d.addEventListener(`blur`,()=>{let e=N();M(e),e&&(this._validateOnInput=!0),this.value!==this._committedValue&&this._emitChange()}),d.addEventListener(`paste`,e=>{let t=O(e.clipboardData?.getData(`text`));t&&(e.preventDefault(),this._national=t.national.replace(/[^0-9]/g,``),t.country===this._country?d.value=S(this._country,this._national):this.setAttribute(`country`,t.country),this._syncMirror(),this._emitInput(),this._emitChange(),this._validateOnInput&&d.isConnected&&M(N()),this.querySelector(`input[type=tel]`)?.focus())}),this._bindGlobal=()=>{this._teardownGlobals?.(),this._onDocClick=e=>{m()&&!this.contains(e.target)&&x()},document.addEventListener(`click`,this._onDocClick),m()&&t(this,v)},this._teardownGlobals=()=>{this._onDocClick&&=(document.removeEventListener(`click`,this._onDocClick),null),n(this)},this._bindGlobal(),this._validateOnInput&&M(N()),b().then(e=>{if(!(!e||!d.isConnected)&&(this._national&&(d.value=S(this._country,this._national)),!this.getAttribute(`placeholder`))){let e=w(this._country);e&&(d.placeholder=e)}}),this._syncMirror()}_teardown(){this._teardownGlobals?.()}disconnectedCallback(){this._teardown()}},A=e=>String(e??``).replace(/"/g,`"`).replace(/</g,`<`);export{k as t};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import{t as e}from"./elementBase-BlsR4tqa.js";import{n as t,r as n,t as r}from"./anchorOverlay-WcDeH46q.js";var i=`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial;
|
|
4
|
+
${Object.entries({"--wui-z-tour":`1550`,"--wui-radius-sm":`8px`,"--wui-radius-lg":`14px`,"--wui-shadow-overlay":`0 8px 28px -6px rgba(7, 20, 55, 0.14)`,"--color-primary":`#4F46E5`,"--color-primary-hover":`#4338CA`,"--color-primary-ink":`#4F46E5`,"--color-primary-text":`#FFFFFF`,"--color-scrim-strong":`color-mix(in srgb, #071437 62%, transparent)`,"--color-surface":`#FFFFFF`,"--color-text":`#071437`,"--color-text-muted":`#4B5675`,"--color-border":`#EBEDF3`}).map(([e,t])=>` ${e}: ${t};`).join(`
|
|
5
|
+
`)}
|
|
6
|
+
}
|
|
7
|
+
*, *::before, *::after {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
[hidden] {
|
|
11
|
+
display: none !important;
|
|
12
|
+
}
|
|
13
|
+
.visually-hidden {
|
|
14
|
+
position: absolute !important;
|
|
15
|
+
width: 1px !important;
|
|
16
|
+
height: 1px !important;
|
|
17
|
+
padding: 0 !important;
|
|
18
|
+
margin: -1px !important;
|
|
19
|
+
overflow: hidden !important;
|
|
20
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
21
|
+
white-space: nowrap !important;
|
|
22
|
+
border: 0 !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.btn {
|
|
26
|
+
display: inline-block;
|
|
27
|
+
margin: 0;
|
|
28
|
+
padding: 0.25rem 0.5rem;
|
|
29
|
+
border: 1px solid transparent;
|
|
30
|
+
border-radius: 0.375rem;
|
|
31
|
+
background: transparent;
|
|
32
|
+
font: inherit;
|
|
33
|
+
font-size: 0.875rem;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
line-height: 1.5;
|
|
36
|
+
text-align: center;
|
|
37
|
+
text-decoration: none;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
41
|
+
.btn:focus-visible {
|
|
42
|
+
outline: 2px solid var(--color-primary);
|
|
43
|
+
outline-offset: 2px;
|
|
44
|
+
}
|
|
45
|
+
.btn-primary {
|
|
46
|
+
background: var(--color-primary);
|
|
47
|
+
border-color: var(--color-primary);
|
|
48
|
+
color: var(--color-primary-text);
|
|
49
|
+
}
|
|
50
|
+
.btn-primary:hover {
|
|
51
|
+
background: var(--color-primary-hover);
|
|
52
|
+
border-color: var(--color-primary-hover);
|
|
53
|
+
}
|
|
54
|
+
.btn-outline-secondary {
|
|
55
|
+
border-color: var(--color-text-muted);
|
|
56
|
+
color: var(--color-text-muted);
|
|
57
|
+
}
|
|
58
|
+
.btn-outline-secondary:hover {
|
|
59
|
+
background: var(--color-text-muted);
|
|
60
|
+
color: #fff;
|
|
61
|
+
}
|
|
62
|
+
.btn-link {
|
|
63
|
+
font-weight: 400;
|
|
64
|
+
color: var(--color-primary-ink);
|
|
65
|
+
text-decoration: underline;
|
|
66
|
+
}
|
|
67
|
+
.btn-link:hover {
|
|
68
|
+
color: var(--color-primary-hover);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.wui-tour-layer {
|
|
72
|
+
position: fixed;
|
|
73
|
+
inset: 0;
|
|
74
|
+
z-index: var(--wui-z-tour);
|
|
75
|
+
pointer-events: none;
|
|
76
|
+
font-family: "Webority Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
77
|
+
font-size: 16px;
|
|
78
|
+
font-weight: 400;
|
|
79
|
+
line-height: 1.5;
|
|
80
|
+
color: var(--color-text);
|
|
81
|
+
text-align: start;
|
|
82
|
+
}
|
|
83
|
+
.wui-tour-spot {
|
|
84
|
+
position: fixed;
|
|
85
|
+
border-radius: var(--wui-radius-sm);
|
|
86
|
+
box-shadow:
|
|
87
|
+
0 0 0 2px var(--color-primary),
|
|
88
|
+
0 0 0 100vmax var(--color-scrim-strong);
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
}
|
|
91
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
92
|
+
.wui-tour-spot {
|
|
93
|
+
transition:
|
|
94
|
+
top 160ms ease,
|
|
95
|
+
left 160ms ease,
|
|
96
|
+
width 160ms ease,
|
|
97
|
+
height 160ms ease;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
.wui-tour-card {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
gap: 8px;
|
|
104
|
+
width: min(360px, 100vw - 16px);
|
|
105
|
+
padding: 16px;
|
|
106
|
+
overflow-y: auto;
|
|
107
|
+
background: var(--color-surface);
|
|
108
|
+
color: var(--color-text);
|
|
109
|
+
border: 1px solid var(--color-border);
|
|
110
|
+
border-radius: var(--wui-radius-lg);
|
|
111
|
+
corner-shape: squircle;
|
|
112
|
+
box-shadow: var(--wui-shadow-overlay);
|
|
113
|
+
pointer-events: auto;
|
|
114
|
+
}
|
|
115
|
+
.wui-tour-card:focus {
|
|
116
|
+
outline: none;
|
|
117
|
+
}
|
|
118
|
+
.wui-tour-card:focus-visible {
|
|
119
|
+
outline: 2px solid var(--color-primary);
|
|
120
|
+
outline-offset: 2px;
|
|
121
|
+
}
|
|
122
|
+
.wui-tour-position {
|
|
123
|
+
margin: 0;
|
|
124
|
+
font-size: 12px;
|
|
125
|
+
color: var(--color-text-muted);
|
|
126
|
+
}
|
|
127
|
+
.wui-tour-title {
|
|
128
|
+
margin: 0;
|
|
129
|
+
font-size: 16px;
|
|
130
|
+
font-weight: 600;
|
|
131
|
+
}
|
|
132
|
+
.wui-tour-text {
|
|
133
|
+
margin: 0;
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
color: var(--color-text-muted);
|
|
136
|
+
}
|
|
137
|
+
.wui-tour-actions {
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
justify-content: space-between;
|
|
141
|
+
gap: 8px;
|
|
142
|
+
margin-top: 4px;
|
|
143
|
+
}
|
|
144
|
+
.wui-tour-nav {
|
|
145
|
+
display: flex;
|
|
146
|
+
gap: 8px;
|
|
147
|
+
}
|
|
148
|
+
.wui-tour-skip {
|
|
149
|
+
color: var(--color-text-muted);
|
|
150
|
+
}
|
|
151
|
+
.wui-tour-back,
|
|
152
|
+
.wui-tour-next {
|
|
153
|
+
min-width: 64px;
|
|
154
|
+
}
|
|
155
|
+
`,a=`wui-tour-step`,o=`wui-tour-host`,s=`wui-tour-seen:`,c={back:`Back`,next:`Next`,skip:`Skip`,done:`Done`},l={back:`back-label`,next:`next-label`,skip:`skip-label`,done:`done-label`},u=4,d=0;function f(e=s,t=globalThis.localStorage){return{isSeen:async n=>t.getItem(e+n)===`1`,markSeen:async n=>{t.setItem(e+n,`1`)}}}var p=e=>!e?.isConnected||getComputedStyle(e).visibility===`hidden`?!1:e.getClientRects().length>0,m=e=>!!e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)),h=()=>{let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e},g=null;function _(e){if(`adoptedStyleSheets`in e&&typeof CSSStyleSheet==`function`&&`replaceSync`in CSSStyleSheet.prototype){g||(g=new CSSStyleSheet,g.replaceSync(i)),e.adoptedStyleSheets=[g];return}let t=document.createElement(`style`);t.textContent=i,e.appendChild(t)}var v=class extends e{static get observedAttributes(){return[`open`]}constructor(){super(),this.seenStore=null,this.onBeforeStep=null,this._run=0,this._running=!1,this._layer=null,this._outer=null,this._shadow=null}connectedCallback(){this.hasAttribute(`open`)&&this.start()}disconnectedCallback(){this.stop()}attributeChangedCallback(e,t,n){e!==`open`||!this.isConnected||(n===null?this.stop():this.start())}get tourId(){return this.getAttribute(`tour-id`)||``}set tourId(e){e==null||e===``?this.removeAttribute(`tour-id`):this.setAttribute(`tour-id`,String(e))}get isolated(){return this.hasAttribute(`isolated`)}set isolated(e){this.toggleAttribute(`isolated`,e===!0||e===``||e===`true`)}_stepList(){return Array.from(this.querySelectorAll(`:scope > ${a}`),e=>({target:e.getAttribute(`target`)||``,title:e.getAttribute(`title`)||void 0,description:e.textContent.trim()}))}_store(){return this.seenStore?this.seenStore:this.getAttribute(`seen-store`)===`local`?f():globalThis.window?.WUI?.tour?.seenStore||null}_label(e){return this.getAttribute(l[e])||c[e]}async start(){if(this._running)return;this._running=!0;let e=++this._run;this.hasAttribute(`open`)||this.setAttribute(`open`,``);try{await this._start(e)}catch(t){throw e===this._run&&(this._running=!1),t}}async _start(e){this._steps=this._stepList();let t=this._store();if(t&&!this.tourId)throw Error(`<wui-tour> needs a tour-id to use a seen store.`);if(t&&await t.isSeen(this.tourId)){e===this._run&&this._finish(`alreadySeen`);return}this._returnFocus=document.activeElement;let n=await this._locate(0,1,e);if(e===this._run){if(!n){this._finish(`noTargets`);return}this._firstIndex=n.index,this._build(),this._show(n)}}next(){return this._move(1)}back(){return!this._current||this._current.index<=this._firstIndex?Promise.resolve():this._move(-1)}async goTo(e){if(this._current){if(!Number.isInteger(e)||e<0||e>=this._steps.length)throw RangeError(`<wui-tour> has no step ${e}; it has ${this._steps.length}.`);await this._go(e,1)}}stop(){this._running&&(this._run++,this._teardown(),this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`))}async _locate(e,t,n){let r=this._steps;for(let i=e;i>=0&&i<r.length;i+=t){let e=r[i];if(await this._beforeStep(e,i),n!==this._run)return null;if(!e.target)return{index:i,target:null};let t=document.querySelector(e.target);if(p(t))return{index:i,target:t}}return null}async _beforeStep(e,t){let n=[];this.dispatchEvent(new CustomEvent(`wui-tour:beforestep`,{bubbles:!0,detail:{step:e,index:t,wait:e=>n.push(e)}})),await Promise.all(n),typeof this.onBeforeStep==`function`&&await this.onBeforeStep(e,t)}_build(){let e=`wui-tour-${++d}`,n=document.createElement(`div`);n.className=`wui-tour-layer`,n.innerHTML=`
|
|
156
|
+
<div class="wui-tour-spot" aria-hidden="true"></div>
|
|
157
|
+
<div class="wui-tour-card" role="dialog" aria-modal="true" tabindex="-1" aria-labelledby="${e}-title" aria-describedby="${e}-text">
|
|
158
|
+
<p class="wui-tour-position"></p>
|
|
159
|
+
<h2 class="wui-tour-title" id="${e}-title"></h2>
|
|
160
|
+
<p class="wui-tour-text" id="${e}-text"></p>
|
|
161
|
+
<div class="wui-tour-actions">
|
|
162
|
+
<button type="button" class="btn btn-sm btn-link wui-tour-skip"></button>
|
|
163
|
+
<div class="wui-tour-nav">
|
|
164
|
+
<button type="button" class="btn btn-sm btn-outline-secondary wui-tour-back"></button>
|
|
165
|
+
<button type="button" class="btn btn-sm btn-primary wui-tour-next"></button>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="visually-hidden" role="status" aria-live="polite"></div>`;let r=n;this._shadow=null,this.isolated&&(r=document.createElement(o),this._shadow=r.attachShadow({mode:`open`}),_(this._shadow),this._shadow.appendChild(n)),document.body.appendChild(r),this._outer=r,this._layer=n,this._spot=n.querySelector(`.wui-tour-spot`),this._card=n.querySelector(`.wui-tour-card`),this._live=n.querySelector(`[role=status]`),this._card.querySelector(`.wui-tour-skip`).addEventListener(`click`,()=>this._close(`skipped`)),this._card.querySelector(`.wui-tour-back`).addEventListener(`click`,()=>this._move(-1)),this._card.querySelector(`.wui-tour-next`).addEventListener(`click`,()=>this._move(1)),this._shadow&&this._card.removeAttribute(`aria-modal`),this._onKey=e=>this._key(e),this._onFocusIn=e=>{this._layer&&!this._layer.contains(e.target)&&this._card.focus()},document.addEventListener(`keydown`,this._onKey,!0),this._shadow||document.addEventListener(`focusin`,this._onFocusIn),t(r,()=>this._place())}_active(){return this._shadow?this._shadow.activeElement:document.activeElement}_show(e){this._current=e;let{index:t,target:n}=e,r=this._steps[t],i=this._steps,a=t===i.length-1,o=this._card;o.querySelector(`.wui-tour-position`).textContent=`Step ${t+1} of ${i.length}`;let s=o.querySelector(`.wui-tour-title`);s.textContent=r.title||``,s.hidden=!r.title,o.querySelector(`.wui-tour-text`).textContent=r.description||``,o.querySelector(`.wui-tour-skip`).textContent=this._label(`skip`),o.querySelector(`.wui-tour-back`).textContent=this._label(`back`),o.querySelector(`.wui-tour-back`).hidden=t<=this._firstIndex,o.querySelector(`.wui-tour-next`).textContent=this._label(a?`done`:`next`),this._live.textContent=[`Step ${t+1} of ${i.length}`,r.title,r.description].filter(Boolean).join(`. `),n?.scrollIntoView?.({block:`center`,inline:`nearest`}),this._place();let c=this._active();(o.contains(c)?!c.hidden:this._shadow!==null&&m(h()))||o.focus(),this.dispatchEvent(new CustomEvent(`wui-tour:step`,{bubbles:!0,detail:{step:r,index:t}}))}_place(){if(!this._current||!this._layer)return;let e=this._spot.style,t=this._card.style;if(!this._current.target){e.top=`50%`,e.left=`50%`,e.width=`0px`,e.height=`0px`,e.boxShadow=`0 0 0 100vmax var(--color-scrim-strong)`,this._card.classList.remove(`drop-up`),t.position=`fixed`,t.top=`50%`,t.left=`50%`,t.transform=`translate(-50%, -50%)`,t.maxHeight=`calc(100vh - 16px)`;return}e.boxShadow=``,t.transform=``;let n=this._current.target.getBoundingClientRect();e.top=`${n.top-u}px`,e.left=`${n.left-u}px`,e.width=`${n.width+u*2}px`,e.height=`${n.height+u*2}px`,r(this._spot,this._card,{clampHeight:!0})}async _move(e){this._current&&await this._go(this._current.index+e,e)}async _go(e,t){if(!this._current||this._moving)return;this._moving=!0;let n=this._run;try{let r=await this._locate(e,t,n);if(n!==this._run)return;r?this._show(r):t>0&&await this._close(`finished`)}finally{this._moving=!1}}_key(e){if(!(!this._layer||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`)e.preventDefault(),e.stopPropagation(),this._close(`skipped`);else if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(this._shadow&&m(e.composedPath?.()[0]??e.target))return;e.preventDefault(),e.key===`ArrowRight`?this._move(1):this._current.index>this._firstIndex&&this._move(-1)}else if(e.key===`Tab`&&!this._shadow){let t=Array.from(this._card.querySelectorAll(`button`)).filter(e=>!e.hidden),n=t[0],r=t[t.length-1],i=this._active();!this._card.contains(i)||e.shiftKey&&(i===n||i===this._card)?(e.preventDefault(),(e.shiftKey?r:n).focus()):!e.shiftKey&&i===r&&(e.preventDefault(),n.focus())}}}_teardown(){if(!this._layer)return;document.removeEventListener(`keydown`,this._onKey,!0),document.removeEventListener(`focusin`,this._onFocusIn);let e=!this._shadow||this._shadow.activeElement!==null||!document.activeElement||document.activeElement===document.body;n(this._outer),this._outer.remove(),this._outer=null,this._shadow=null,this._layer=null,this._current=null;let t=this._returnFocus;this._returnFocus=null,e&&t?.isConnected&&t.focus?.()}async _close(e){let t=this._run;this._teardown();let n=this._store();try{n&&t===this._run&&await n.markSeen(this.tourId)}finally{this._finish(e)}}_finish(e){this._run++,this._running=!1,this.hasAttribute(`open`)&&this.removeAttribute(`open`),this.dispatchEvent(new CustomEvent(`wui-tour:close`,{bubbles:!0,detail:{reason:e}}))}};export{f as n,v as t};
|
package/dist/elements/phone.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiPhone-
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{t}from"../WuiPhone-CSUVhYSb.js";e(`wui-phone`,t);export{t as WuiPhone};
|
package/dist/elements/tour.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiTour-
|
|
1
|
+
import{n as e}from"../elementBase-BlsR4tqa.js";import{n as t,t as n}from"../WuiTour-CE7SQAso.js";e(`wui-tour`,n);export{n as WuiTour,t as createLocalSeenStore};
|