32 lines
88 KiB
JavaScript
32 lines
88 KiB
JavaScript
import{e,c as hi,s as X,p as Ki,u as Le,A as $,a as At,X as Hi,y as Z,F as qi,V as pi,T,aa as Ui,d as I,M as mi,k as Re,m as De,l as fe,q as Xe,B as at,G as He,aV as gi,I as Vi,$ as Wi,U as Gi,t as Yi,aM as Zi,H as Qi,aW as Xi,b as Ji}from"./pwa-viewport-cDxGxYgG.js";import{a6 as en,K as tn,a2 as nn,B as sn,x as _e,af as vt,ag as Gt,ah as fi,X as an,Z as ot,I as S,q as tt,p as Je,s as Ie,g as it,h as vi,d as we,l as Et,r as on,w as qe,t as bi,F as nt,ai as rn,aj as ln,ak as cn,a0 as un,m as Pe,al as dn,am as hn,D as Yt,u as pn,a as mn,a8 as gn,a7 as fn,c as Zt,an as bt,ao as vn}from"./ScheduledAtField-O5kh-u-d.js";import"./ICONS-BLqAe1AS.js";function bn({onlyFirst:s=!1}={}){const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,s?void 0:"g")}const yn=bn();function xn(s){if(typeof s!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof s}\``);return s.replace(yn,"")}const wn=new Intl.Segmenter;function Qt(s,{countAnsiEscapeCodes:t=!1}={}){if(s===""||(t||(s=xn(s)),s===""))return 0;let n=0;for(const o of wn.segment(s))n++;return n}const Ct=[["aa","Afar","Afaraf"],["ab","Abkhaz","аҧсуа бызшәа"],["ae","Avestan","avesta"],["af","Afrikaans","Afrikaans"],["ak","Akan","Akan"],["am","Amharic","አማርኛ"],["an","Aragonese","aragonés"],["ar","Arabic","اللغة العربية"],["as","Assamese","অসমীয়া"],["av","Avaric","авар мацӀ"],["ay","Aymara","aymar aru"],["az","Azerbaijani","azərbaycan dili"],["ba","Bashkir","башҡорт теле"],["be","Belarusian","беларуская мова"],["bg","Bulgarian","български език"],["bh","Bihari","भोजपुरी"],["bi","Bislama","Bislama"],["bm","Bambara","bamanankan"],["bn","Bengali","বাংলা"],["bo","Tibetan","བོད་ཡིག"],["br","Breton","brezhoneg"],["bs","Bosnian","bosanski jezik"],["ca","Catalan","Català"],["ce","Chechen","нохчийн мотт"],["ch","Chamorro","Chamoru"],["co","Corsican","corsu"],["cr","Cree","ᓀᐦᐃᔭᐍᐏᐣ"],["cs","Czech","čeština"],["cu","Old Church Slavonic","ѩзыкъ словѣньскъ"],["cv","Chuvash","чӑваш чӗлхи"],["cy","Welsh","Cymraeg"],["da","Danish","dansk"],["de","German","Deutsch"],["dv","Divehi","Dhivehi"],["dz","Dzongkha","རྫོང་ཁ"],["ee","Ewe","Eʋegbe"],["el","Greek","Ελληνικά"],["en","English","English"],["eo","Esperanto","Esperanto"],["es","Spanish","Español"],["et","Estonian","eesti"],["eu","Basque","euskara"],["fa","Persian","فارسی"],["ff","Fula","Fulfulde"],["fi","Finnish","suomi"],["fj","Fijian","Vakaviti"],["fo","Faroese","føroyskt"],["fr","French","Français"],["fy","Western Frisian","Frysk"],["ga","Irish","Gaeilge"],["gd","Scottish Gaelic","Gàidhlig"],["gl","Galician","galego"],["gu","Gujarati","ગુજરાતી"],["gv","Manx","Gaelg"],["ha","Hausa","هَوُسَ"],["he","Hebrew","עברית"],["hi","Hindi","हिन्दी"],["ho","Hiri Motu","Hiri Motu"],["hr","Croatian","Hrvatski"],["ht","Haitian","Kreyòl ayisyen"],["hu","Hungarian","magyar"],["hy","Armenian","Հայերեն"],["hz","Herero","Otjiherero"],["ia","Interlingua","Interlingua"],["id","Indonesian","Bahasa Indonesia"],["ie","Interlingue","Interlingue"],["ig","Igbo","Asụsụ Igbo"],["ii","Nuosu","ꆈꌠ꒿ Nuosuhxop"],["ik","Inupiaq","Iñupiaq"],["io","Ido","Ido"],["is","Icelandic","Íslenska"],["it","Italian","Italiano"],["iu","Inuktitut","ᐃᓄᒃᑎᑐᑦ"],["ja","Japanese","日本語"],["jv","Javanese","basa Jawa"],["ka","Georgian","ქართული"],["kg","Kongo","Kikongo"],["ki","Kikuyu","Gĩkũyũ"],["kj","Kwanyama","Kuanyama"],["kk","Kazakh","қазақ тілі"],["kl","Kalaallisut","kalaallisut"],["km","Khmer","ខេមរភាសា"],["kn","Kannada","ಕನ್ನಡ"],["ko","Korean","한국어"],["kr","Kanuri","Kanuri"],["ks","Kashmiri","कश्मीरी"],["ku","Kurmanji (Kurdish)","Kurmancî"],["kv","Komi","коми кыв"],["kw","Cornish","Kernewek"],["ky","Kyrgyz","Кыргызча"],["la","Latin","latine"],["lb","Luxembourgish","Lëtzebuergesch"],["lg","Ganda","Luganda"],["li","Limburgish","Limburgs"],["ln","Lingala","Lingála"],["lo","Lao","ລາວ"],["lt","Lithuanian","lietuvių kalba"],["lu","Luba-Katanga","Tshiluba"],["lv","Latvian","latviešu valoda"],["mg","Malagasy","fiteny malagasy"],["mh","Marshallese","Kajin M̧ajeļ"],["mi","Māori","te reo Māori"],["mk","Macedonian","македонски јазик"],["ml","Malayalam","മലയാളം"],["mn","Mongolian","Монгол хэл"],["mr","Marathi","मराठी"],["ms","Malay","Bahasa Melayu"],["ms-Arab","Jawi Malay","بهاس ملايو"],["mt","Maltese","Malti"],["my","Burmese","ဗမာစာ"],["na","Nauru","Ekakairũ Naoero"],["nb","Norwegian Bokmål","Norsk bokmål"],["nd","Northern Ndebele","isiNdebele"],["ne","Nepali","नेपाली"],["ng","Ndonga","Owambo"],["nl","Dutch","Nederlands"],["nn","Norwegian Nynorsk","Norsk Nynorsk"],["no","Norwegian","Norsk"],["nr","Southern Ndebele","isiNdebele"],["nv","Navajo","Diné bizaad"],["ny","Chichewa","chiCheŵa"],["oc","Occitan","occitan"],["oj","Ojibwe","ᐊᓂᔑᓈᐯᒧᐎᓐ"],["om","Oromo","Afaan Oromoo"],["or","Oriya","ଓଡ଼ିଆ"],["os","Ossetian","ирон æвзаг"],["pa","Punjabi","ਪੰਜਾਬੀ"],["pi","Pāli","पाऴि"],["pl","Polish","Polski"],["ps","Pashto","پښتو"],["pt","Portuguese","Português"],["qu","Quechua","Runa Simi"],["rm","Romansh","rumantsch grischun"],["rn","Kirundi","Ikirundi"],["ro","Romanian","Română"],["ru","Russian","Русский"],["rw","Kinyarwanda","Ikinyarwanda"],["sa","Sanskrit","संस्कृतम्"],["sc","Sardinian","sardu"],["sd","Sindhi","सिन्धी"],["se","Northern Sami","Davvisámegiella"],["sg","Sango","yângâ tî sängö"],["si","Sinhala","සිංහල"],["sk","Slovak","slovenčina"],["sl","Slovenian","slovenščina"],["sn","Shona","chiShona"],["so","Somali","Soomaaliga"],["sq","Albanian","Shqip"],["sr","Serbian","српски језик"],["ss","Swati","SiSwati"],["st","Southern Sotho","Sesotho"],["su","Sundanese","Basa Sunda"],["sv","Swedish","Svenska"],["sw","Swahili","Kiswahili"],["ta","Tamil","தமிழ்"],["te","Telugu","తెలుగు"],["tg","Tajik","тоҷикӣ"],["th","Thai","ไทย"],["ti","Tigrinya","ትግርኛ"],["tk","Turkmen","Türkmen"],["tl","Tagalog","Tagalog"],["tn","Tswana","Setswana"],["to","Tonga","faka Tonga"],["tr","Turkish","Türkçe"],["ts","Tsonga","Xitsonga"],["tt","Tatar","татар теле"],["tw","Twi","Twi"],["ty","Tahitian","Reo Tahiti"],["ug","Uyghur","ئۇيغۇرچە"],["uk","Ukrainian","Українська"],["ur","Urdu","اردو"],["uz","Uzbek","Ўзбек"],["ve","Venda","Tshivenḓa"],["vi","Vietnamese","Tiếng Việt"],["vo","Volapük","Volapük"],["wa","Walloon","walon"],["wo","Wolof","Wollof"],["xh","Xhosa","isiXhosa"],["yi","Yiddish","ייִדיש"],["yo","Yoruba","Yorùbá"],["za","Zhuang","Saɯ cueŋƅ"],["zh","Chinese","中文"],["zu","Zulu","isiZulu"],["zh-CN","Chinese (China)","简体中文"],["zh-HK","Chinese (Hong Kong)","繁體中文(香港)"],["zh-TW","Chinese (Taiwan)","繁體中文(臺灣)"],["zh-YUE","Cantonese","廣東話"],["ast","Asturian","Asturianu"],["chr","Cherokee","ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ"],["ckb","Sorani (Kurdish)","سۆرانی"],["cnr","Montenegrin","crnogorski"],["csb","Kashubian","Kaszëbsczi"],["gsw","Swiss German","Schwiizertütsch"],["jbo","Lojban","la .lojban."],["kab","Kabyle","Taqbaylit"],["ldn","Láadan","Láadan"],["lfn","Lingua Franca Nova","lingua franca nova"],["moh","Mohawk","Kanienʼkéha"],["nds","Low German","Plattdüütsch"],["pdc","Pennsylvania Dutch","Pennsilfaani-Deitsch"],["sco","Scots","Scots"],["sma","Southern Sami","Åarjelsaemien Gïele"],["smj","Lule Sami","Julevsámegiella"],["szl","Silesian","ślůnsko godka"],["tok","Toki Pona","toki pona"],["vai","Vai","ꕙꔤ"],["xal","Kalmyk","Хальмг келн"],["zba","Balaibalan","باليبلن"],["zgh","Standard Moroccan Tamazight","ⵜⴰⵎⴰⵣⵉⵖⵜ"]],kn="(((?:[^A-Za-z0-9@@$##\\uFFFE\\uFEFF\\uFFFF]|[\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069]|^))((https?:\\/\\/)((?:(?:(?:[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/](?:[_-]|[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/])*)?[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/]\\.)*(?:(?:[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/](?:-|[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/])*)?[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/]\\.)(?:(?:(?:삼성|닷컴|닷넷|香格里拉|餐厅|食品|飞利浦|電訊盈科|集团|通販|购物|谷歌|诺基亚|联通|网络|网站|网店|网址|组织机构|移动|珠宝|点看|游戏|淡马锡|机构|書籍|时尚|新闻|政府|政务|招聘|手表|手机|我爱你|慈善|微博|广东|工行|家電|娱乐|天主教|大拿|大众汽车|在线|嘉里大酒店|嘉里|商标|商店|商城|公益|公司|八卦|健康|信息|佛山|企业|中文网|中信|世界|ポイント|ファッション|セール|ストア|コム|グーグル|クラウド|みんな|คอม|संगठन|नेट|कॉम|همراه|موقع|موبايلي|كوم|كاثوليك|عرب|شبكة|بيتك|بازار|العليان|ارامكو|اتصالات|ابوظبي|קום|сайт|рус|орг|онлайн|москва|ком|католик|дети|zuerich|zone|zippo|zip|zero|zara|zappos|yun|youtube|you|yokohama|yoga|yodobashi|yandex|yamaxun|yahoo|yachts|xyz|xxx|xperia|xin|xihuan|xfinity|xerox|xbox|wtf|wtc|wow|world|works|work|woodside|wolterskluwer|wme|winners|wine|windows|win|williamhill|wiki|wien|whoswho|weir|weibo|wedding|wed|website|weber|webcam|weatherchannel|weather|watches|watch|warman|wanggou|wang|walter|walmart|wales|vuelos|voyage|voto|voting|vote|volvo|volkswagen|vodka|vlaanderen|vivo|viva|vistaprint|vista|vision|visa|virgin|vip|vin|villas|viking|vig|video|viajes|vet|versicherung|vermögensberatung|vermögensberater|verisign|ventures|vegas|vanguard|vana|vacations|ups|uol|uno|university|unicom|uconnect|ubs|ubank|tvs|tushu|tunes|tui|tube|trv|trust|travelersinsurance|travelers|travelchannel|travel|training|trading|trade|toys|toyota|town|tours|total|toshiba|toray|top|tools|tokyo|today|tmall|tkmaxx|tjx|tjmaxx|tirol|tires|tips|tiffany|tienda|tickets|tiaa|theatre|theater|thd|teva|tennis|temasek|telefonica|telecity|tel|technology|tech|team|tdk|tci|taxi|tax|tattoo|tatar|tatamotors|target|taobao|talk|taipei|tab|systems|symantec|sydney|swiss|swiftcover|swatch|suzuki|surgery|surf|support|supply|supplies|sucks|style|study|studio|stream|store|storage|stockholm|stcgroup|stc|statoil|statefarm|statebank|starhub|star|staples|stada|srt|srl|spreadbetting|spot|sport|spiegel|space|soy|sony|song|solutions|solar|sohu|software|softbank|social|soccer|sncf|smile|smart|sling|skype|sky|skin|ski|site|singles|sina|silk|shriram|showtime|show|shouji|shopping|shop|shoes|shiksha|shia|shell|shaw|sharp|shangrila|sfr|sexy|sex|sew|seven|ses|services|sener|select|seek|security|secure|seat|search|scot|scor|scjohnson|science|schwarz|schule|school|scholarships|schmidt|schaeffler|scb|sca|sbs|sbi|saxo|save|sas|sarl|sapo|sap|sanofi|sandvikcoromant|sandvik|samsung|samsclub|salon|sale|sakura|safety|safe|saarland|ryukyu|rwe|run|ruhr|rugby|rsvp|room|rogers|rodeo|rocks|rocher|rmit|rip|rio|ril|rightathome|ricoh|richardli|rich|rexroth|reviews|review|restaurant|rest|republican|report|repair|rentals|rent|ren|reliance|reit|reisen|reise|rehab|redumbrella|redstone|red|recipes|realty|realtor|realestate|read|raid|radio|racing|qvc|quest|quebec|qpon|pwc|pub|prudential|pru|protection|property|properties|promo|progressive|prof|productions|prod|pro|prime|press|praxi|pramerica|post|porn|politie|poker|pohl|pnc|plus|plumbing|playstation|play|place|pizza|pioneer|pink|ping|pin|pid|pictures|pictet|pics|piaget|physio|photos|photography|photo|phone|philips|phd|pharmacy|pfizer|pet|pccw|pay|passagens|party|parts|partners|pars|paris|panerai|panasonic|pamperedchef|page|ovh|ott|otsuka|osaka|origins|orientexpress|organic|org|orange|oracle|open|ooo|onyourside|online|onl|ong|one|omega|ollo|oldnavy|olayangroup|olayan|okinawa|office|off|observer|obi|nyc|ntt|nrw|nra|nowtv|nowruz|now|norton|northwesternmutual|nokia|nissay|nissan|ninja|nikon|nike|nico|nhk|ngo|nfl|nexus|nextdirect|next|news|newholland|new|neustar|network|netflix|netbank|net|nec|nba|navy|natura|nationwide|name|nagoya|nadex|nab|mutuelle|mutual|museum|mtr|mtpc|mtn|msd|movistar|movie|mov|motorcycles|moto|moscow|mortgage|mormon|mopar|montblanc|monster|money|monash|mom|moi|moe|moda|mobily|mobile|mobi|mma|mls|mlb|mitsubishi|mit|mint|mini|mil|microsoft|miami|metlife|merckmsd|meo|menu|men|memorial|meme|melbourne|meet|media|med|mckinsey|mcdonalds|mcd|mba|mattel|maserati|marshalls|marriott|markets|marketing|market|map|mango|management|man|makeup|maison|maif|madrid|macys|luxury|luxe|lupin|lundbeck|ltda|ltd|lplfinancial|lpl|love|lotto|lotte|london|lol|loft|locus|locker|loans|loan|llp|llc|lixil|living|live|lipsy|link|linde|lincoln|limo|limited|lilly|like|lighting|lifestyle|lifeinsurance|life|lidl|liaison|lgbt|lexus|lego|legal|lefrak|leclerc|lease|lds|lawyer|law|latrobe|latino|lat|lasalle|lanxess|landrover|land|lancome|lancia|lancaster|lamer|lamborghini|ladbrokes|lacaixa|kyoto|kuokgroup|kred|krd|kpn|kpmg|kosher|komatsu|koeln|kiwi|kitchen|kindle|kinder|kim|kia|kfh|kerryproperties|kerrylogistics|kerryhotels|kddi|kaufen|juniper|juegos|jprs|jpmorgan|joy|jot|joburg|jobs|jnj|jmp|jll|jlc|jio|jewelry|jetzt|jeep|jcp|jcb|java|jaguar|iwc|iveco|itv|itau|istanbul|ist|ismaili|iselect|irish|ipiranga|investments|intuit|international|intel|int|insure|insurance|institute|ink|ing|info|infiniti|industries|inc|immobilien|immo|imdb|imamat|ikano|iinet|ifm|ieee|icu|ice|icbc|ibm|hyundai|hyatt|hughes|htc|hsbc|how|house|hotmail|hotels|hoteles|hot|hosting|host|hospital|horse|honeywell|honda|homesense|homes|homegoods|homedepot|holiday|holdings|hockey|hkt|hiv|hitachi|hisamitsu|hiphop|hgtv|hermes|here|helsinki|help|healthcare|health|hdfcbank|hdfc|hbo|haus|hangout|hamburg|hair|guru|guitars|guide|guge|gucci|guardian|group|grocery|gripe|green|gratis|graphics|grainger|gov|got|gop|google|goog|goodyear|goodhands|goo|golf|goldpoint|gold|godaddy|gmx|gmo|gmbh|gmail|globo|global|gle|glass|glade|giving|gives|gifts|gift|ggee|george|genting|gent|gea|gdn|gbiz|gay|garden|gap|games|game|gallup|gallo|gallery|gal|fyi|futbol|furniture|fund|fun|fujixerox|fujitsu|ftr|frontier|frontdoor|frogans|frl|fresenius|free|fox|foundation|forum|forsale|forex|ford|football|foodnetwork|food|foo|fly|flsmidth|flowers|florist|flir|flights|flickr|fitness|fit|fishing|fish|firmdale|firestone|fire|financial|finance|final|film|fido|fidelity|fiat|ferrero|ferrari|feedback|fedex|fast|fashion|farmers|farm|fans|fan|family|faith|fairwinds|fail|fage|extraspace|express|exposed|expert|exchange|everbank|events|eus|eurovision|etisalat|esurance|estate|esq|erni|ericsson|equipment|epson|epost|enterprises|engineering|engineer|energy|emerck|email|education|edu|edeka|eco|eat|earth|dvr|dvag|durban|dupont|duns|dunlop|duck|dubai|dtv|drive|download|dot|doosan|domains|doha|dog|dodge|doctor|docs|dnp|diy|dish|discover|discount|directory|direct|digital|diet|diamonds|dhl|dev|design|desi|dentist|dental|democrat|delta|deloitte|dell|delivery|degree|deals|dealer|deal|dds|dclk|day|datsun|dating|date|data|dance|dad|dabur|cyou|cymru|cuisinella|csc|cruises|cruise|crs|crown|cricket|creditunion|creditcard|credit|cpa|courses|coupons|coupon|country|corsica|coop|cool|cookingchannel|cooking|contractors|contact|consulting|construction|condos|comsec|computer|compare|company|community|commbank|comcast|com|cologne|college|coffee|codes|coach|clubmed|club|cloud|clothing|clinique|clinic|click|cleaning|claims|cityeats|city|citic|citi|citadel|cisco|circle|cipriani|church|chrysler|chrome|christmas|chloe|chintai|cheap|chat|chase|charity|channel|chanel|cfd|cfa|cern|ceo|center|ceb|cbs|cbre|cbn|cba|catholic|catering|cat|casino|cash|caseih|case|casa|cartier|cars|careers|career|care|cards|caravan|car|capitalone|capital|capetown|canon|cancerresearch|camp|camera|cam|calvinklein|call|cal|cafe|cab|bzh|buzz|buy|business|builders|build|bugatti|budapest|brussels|brother|broker|broadway|bridgestone|bradesco|box|boutique|bot|boston|bostik|bosch|boots|booking|book|boo|bond|bom|bofa|boehringer|boats|bnpparibas|bnl|bmw|bms|blue|bloomberg|blog|blockbuster|blanco|blackfriday|black|biz|bio|bingo|bing|bike|bid|bible|bharti|bet|bestbuy|best|berlin|bentley|beer|beauty|beats|bcn|bcg|bbva|bbt|bbc|bayern|bauhaus|basketball|baseball|bargains|barefoot|barclays|barclaycard|barcelona|bar|bank|band|bananarepublic|banamex|baidu|baby|azure|axa|aws|avianca|autos|auto|author|auspost|audio|audible|audi|auction|attorney|athleta|associates|asia|asda|arte|art|arpa|army|archi|aramco|arab|aquarelle|apple|app|apartments|aol|anz|anquan|android|analytics|amsterdam|amica|amfam|amex|americanfamily|americanexpress|alstom|alsace|ally|allstate|allfinanz|alipay|alibaba|alfaromeo|akdn|airtel|airforce|airbus|aigo|aig|agency|agakhan|africa|afl|afamilycompany|aetna|aero|aeg|adult|ads|adac|actor|active|aco|accountants|accountant|accenture|academy|abudhabi|abogado|able|abc|abbvie|abbott|abb|abarth|aarp|aaa|onion)(?=[^0-9a-zA-Z@+-]|$))|(?:(?:한국|香港|澳門|新加坡|台灣|台湾|中國|中国|გე|ລາວ|ไทย|ලංකා|ഭാരതം|ಭಾರತ|భారత్|சிங்கப்பூர்|இலங்கை|இந்தியா|ଭାରତ|ભારત|ਭਾਰਤ|ভাৰত|ভারত|বাংলা|भारोत|भारतम्|भारत|ڀارت|پاکستان|موريتانيا|مليسيا|مصر|قطر|فلسطين|عمان|عراق|سورية|سودان|تونس|بھارت|بارت|ایران|امارات|المغرب|السعودية|الجزائر|البحرين|الاردن|հայ|қаз|укр|срб|рф|мон|мкд|ею|бел|бг|ευ|ελ|zw|zm|za|yt|ye|ws|wf|vu|vn|vi|vg|ve|vc|va|uz|uy|us|um|uk|ug|ua|tz|tw|tv|tt|tr|tp|to|tn|tm|tl|tk|tj|th|tg|tf|td|tc|sz|sy|sx|sv|su|st|ss|sr|so|sn|sm|sl|sk|sj|si|sh|sg|se|sd|sc|sb|sa|rw|ru|rs|ro|re|qa|py|pw|pt|ps|pr|pn|pm|pl|pk|ph|pg|pf|pe|pa|om|nz|nu|nr|np|no|nl|ni|ng|nf|ne|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|mn|mm|ml|mk|mh|mg|mf|me|md|mc|ma|ly|lv|lu|lt|ls|lr|lk|li|lc|lb|la|kz|ky|kw|kr|kp|kn|km|ki|kh|kg|ke|jp|jo|jm|je|it|is|ir|iq|io|in|im|il|ie|id|hu|ht|hr|hn|hm|hk|gy|gw|gu|gt|gs|gr|gq|gp|gn|gm|gl|gi|gh|gg|gf|ge|gd|gb|ga|fr|fo|fm|fk|fj|fi|eu|et|es|er|eh|eg|ee|ec|dz|do|dm|dk|dj|de|cz|cy|cx|cw|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|bz|by|bw|bv|bt|bs|br|bq|bo|bn|bm|bl|bj|bi|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ar|aq|ao|an|am|al|ai|ag|af|ae|ad|ac)(?=[^0-9a-zA-Z@+-]|$))|(?:xn--[\\-0-9a-z]+))))(?::([0-9]+))?(\\/(?:(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*(?:\\((?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+|(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*\\([a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*))\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*)*[\\+\\-a-z\\u0400-\\u04FF0-9=_#\\/\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]|(?:\\((?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+|(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*\\([a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*))\\)))|(?:@[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\/))*)?(\\?[a-z0-9!?\\*'@\\(\\);:&=\\+\\$\\/%#\\[\\]\\-_\\.,~|]*[a-z0-9\\-_&=#\\/])?))",En="gi",Xt={source:kn,flags:En},yi=new RegExp(Xt.source,Xt.flags),Fn=/iPad|iPhone|iPod/.test(navigator.userAgent)&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Jt({hidden:s,disabled:t=!1,supportedMimeTypes:n,setMediaAttachments:o}){const r=Fn?n:n?.filter(d=>!/^image\//i.test(d));return e("input",{type:"file",hidden:s,accept:r?.join(","),capture:"environment",disabled:t,onChange:d=>{const u=d.target.files;if(!u)return;const p=Array.from(u)[0];p&&(o(h=>[...h,{file:p,type:p.type,size:p.size,url:URL.createObjectURL(p),id:null,description:null}]),d.target.value=null)}})}const ei="capture"in document.createElement("input");function An({maxCharacters:s=500,hidden:t}){const o=hi(X).composerCharacterCount,r=s-o;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${r}/${s}`,style:{"--percentage":o/s*100},children:[e("meter",{class:`${r<=-10?"explode":r<=0?"danger":r<=20?"warning":""}`,value:o,max:s}),e("span",{class:"counter",children:r})]})}class Cn{constructor(t,n,{tabInsertsSuggestions:o,defaultFirstOption:r}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=o??!0,this.defaultFirstOption=r??!1,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=d=>Sn(d,this),this.compositionEventHandler=d=>zn(d,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",n.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",ti),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",ti)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(yt)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const n=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(yt)[0],o=Array.from(this.list.querySelectorAll('[role="option"]')).filter(yt),r=o.indexOf(n);if(r===o.length-1&&t===1||r===0&&t===-1){this.clearSelection(),this.input.focus();return}let d=t===1?0:o.length-1;if(n&&r>=0){const p=r+t;p>=0&&p<o.length&&(d=p)}const u=o[d];if(u)for(const p of o)p.removeAttribute("data-combobox-option-default"),u===p?(this.input.setAttribute("aria-activedescendant",u.id),u.setAttribute("aria-selected","true"),_n(this.list,u)):p.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Sn(s,t){if(!(s.shiftKey||s.metaKey||s.altKey)&&!(!t.ctrlBindings&&s.ctrlKey)&&!t.isComposing)switch(s.key){case"Enter":ii(t.input,t.list)&&s.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&ii(t.input,t.list)&&s.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),s.preventDefault();break;case"ArrowUp":t.navigate(-1),s.preventDefault();break;case"n":t.ctrlBindings&&s.ctrlKey&&(t.navigate(1),s.preventDefault());break;case"p":t.ctrlBindings&&s.ctrlKey&&(t.navigate(-1),s.preventDefault());break;default:if(s.ctrlKey)break;t.clearSelection()}}function ti(s){if(!(s.target instanceof Element))return;const t=s.target.closest('[role="option"]');t&&t.getAttribute("aria-disabled")!=="true"&&Ln(t)}function ii(s,t){const n=t.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return n?(n.getAttribute("aria-disabled")==="true"||n.click(),!0):!1}function Ln(s){s.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}function yt(s){return!s.hidden&&!(s instanceof HTMLInputElement&&s.type==="hidden")&&(s.offsetWidth>0||s.offsetHeight>0)}function zn(s,t){t.isComposing=s.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function _n(s,t){Tn(s,t)||(s.scrollTop=t.offsetTop)}function Tn(s,t){const n=s.scrollTop,o=n+s.clientHeight,r=t.offsetTop,d=r+t.clientHeight;return r>=n&&d<=o}const In=/\s|\(|\[/;function Mn(s,t,n,{multiWord:o,lookBackIndex:r,lastMatchPosition:d}={multiWord:!1,lookBackIndex:0,lastMatchPosition:null}){let u=s.lastIndexOf(t,n-1);if(u===-1||u<r)return;if(o){if(d!=null){if(d===u)return;u=d-t.length}if(s[u+1]===" "&&n>=u+t.length+1||s.lastIndexOf(`
|
||
`,n-1)>u||s.lastIndexOf(".",n-1)>u)return}else if(s.lastIndexOf(" ",n-1)>u)return;const p=s[u-1];return p&&!In.test(p)?void 0:{text:s.substring(u+t.length,n),position:u+t.length}}class Bn extends Event{constructor(){super("update")}}const xt=new WeakMap;class St extends EventTarget{#t=new MutationObserver(()=>this.#h());#s=new ResizeObserver(()=>this.#d());#a;#i=document.createElement("div");#e=document.createElement("div");static for(t){let n=xt.get(t);return n||(n=new St(t),xt.set(t,n)),n}constructor(t){super(),this.#a=new WeakRef(t),this.#i.style.position="absolute",this.#i.style.pointerEvents="none",this.#i.setAttribute("aria-hidden","true"),this.#i.appendChild(this.#e),this.#e.style.pointerEvents="none",this.#e.style.userSelect="none",this.#e.style.overflow="hidden",this.#e.style.display="block",this.#e.style.visibility="hidden",t instanceof HTMLTextAreaElement?(this.#e.style.whiteSpace="pre-wrap",this.#e.style.wordWrap="break-word"):(this.#e.style.whiteSpace="nowrap",this.#e.style.display="table-cell",this.#e.style.verticalAlign="middle"),t.after(this.#i),this.#h(),this.#p(),this.#t.observe(t,{attributeFilter:["style","dir"]}),this.#s.observe(t),document.addEventListener("scroll",this.#r,{capture:!0}),window.addEventListener("resize",this.#r,{capture:!0}),t.addEventListener("input",this.#g,{capture:!0})}get element(){return this.#e}forceUpdate(){this.#h(),this.#p()}disconnect(){this.#i?.remove(),this.#t.disconnect(),this.#s.disconnect(),document.removeEventListener("scroll",this.#r,{capture:!0}),window.removeEventListener("resize",this.#r,{capture:!0});const t=this.#o;t&&(t.removeEventListener("input",this.#g,{capture:!0}),xt.delete(t))}get#o(){return this.#a?.deref()}#n(t){const n=this.#o;return n?t(n):this.disconnect()}#l=0;#c=0;#m(){this.#n(t=>{const n=window.getComputedStyle(t);this.#e.style.height=n.height,this.#e.style.width=n.width,t.clientHeight!==this.#e.clientHeight&&(this.#e.style.height=`calc(${n.height} + ${t.clientHeight-this.#e.clientHeight}px)`),t.clientWidth!==this.#e.clientWidth&&(this.#e.style.width=`calc(${n.width} + ${t.clientWidth-this.#e.clientWidth}px)`);const o=t.getBoundingClientRect(),r=this.#e.getBoundingClientRect();this.#l=this.#l+o.left-r.left,this.#c=this.#c+o.top-r.top,this.#e.style.transform=`translate(${this.#l}px, ${this.#c}px)`,this.#e.scrollTop=t.scrollTop,this.#e.scrollLeft=t.scrollLeft,this.dispatchEvent(new Bn)})}#u=!1;#d(){this.#u||(this.#u=!0,requestAnimationFrame(()=>{this.#m(),this.#u=!1}))}#h(){this.#n(t=>{const n=window.getComputedStyle(t);for(const o of Pn)this.#e.style[o]=n[o];this.#d()})}#p(){this.#n(t=>{this.#e.textContent=t.value,this.#m()})}#g=()=>this.#p();#r=t=>{this.#n(n=>{(t.target===document||t.target===window||t.target instanceof Node&&t.target.contains(n))&&this.#d()})}}const Pn=["direction","writingMode","unicodeBidi","textOrientation","boxSizing","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"];class st{#t;#s;#a;constructor(t,n=0,o=n){this.#t=t,this.#s=n,this.#a=o}static fromSelection(t){const{selectionStart:n,selectionEnd:o}=t;return new st(t,n??void 0,o??void 0)}get collapsed(){return this.startOffset===this.endOffset}get commonAncestorContainer(){return this.#t}get endContainer(){return this.#t}get startContainer(){return this.#t}get startOffset(){return this.#s}get endOffset(){return this.#a}setStartOffset(t){this.#s=this.#o(t)}setEndOffset(t){this.#a=this.#o(t)}collapse(t=!1){t?this.setEndOffset(this.startOffset):this.setStartOffset(this.endOffset)}cloneContents(){return this.#n().cloneContents()}cloneRange(){return new st(this.#t,this.startOffset,this.endOffset)}getBoundingClientRect(){return this.#n().getBoundingClientRect()}getClientRects(){return this.#n().getClientRects()}toString(){return this.#n().toString()}getStyleClone(){return this.#i}get#i(){return St.for(this.#t)}get#e(){return this.#i}#o(t){return Math.max(0,Math.min(t,this.#t.value.length))}#n(){const t=document.createRange(),n=this.#e.element.childNodes[0];return n&&(t.setStart(n,this.startOffset),t.setEnd(n,this.endOffset)),t}}const et=new WeakMap;let Dn=class{constructor(t,n){this.expander=t,this.input=n,this.combobox=null,this.menu=null,this.match=null,this.justPasted=!1,this.lookBackIndex=0,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithList=!1,n.addEventListener("paste",this.onpaste),n.addEventListener("input",this.oninput),n.addEventListener("keydown",this.onkeydown),n.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}dismissMenu(){this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex)}activate(t,n){var o,r;this.input!==document.activeElement&&this.input!==((r=(o=document.activeElement)===null||o===void 0?void 0:o.shadowRoot)===null||r===void 0?void 0:r.activeElement)||(this.deactivate(),this.menu=n,n.id||(n.id=`text-expander-${Math.floor(Math.random()*1e5).toString()}`),this.expander.append(n),this.combobox=new Cn(this.input,n),this.expander.dispatchEvent(new Event("text-expander-activate")),this.positionMenu(n,t.position),this.combobox.start(),n.addEventListener("combobox-commit",this.oncommit),n.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1))}positionMenu(t,n){const o=new st(this.input,n).getBoundingClientRect(),r={left:o.left,top:o.top+o.height},d=t.getBoundingClientRect(),u={left:r.left-d.left,top:r.top-d.top};if(u.left!==0||u.top!==0){const p=getComputedStyle(t);t.style.left=p.left?`calc(${p.left} + ${u.left}px)`:`${u.left}px`,t.style.top=p.top?`calc(${p.top} + ${u.top}px)`:`${u.top}px`}}deactivate(){const t=this.menu;return!t||!this.combobox?!1:(this.expander.dispatchEvent(new Event("text-expander-deactivate")),this.menu=null,t.removeEventListener("combobox-commit",this.oncommit),t.removeEventListener("mousedown",this.onmousedown),this.combobox.destroy(),this.combobox=null,t.remove(),!0)}onCommit({target:t}){var n;const o=t;if(!(o instanceof HTMLElement)||!this.combobox)return;const r=this.match;if(!r)return;const d=this.input.value.substring(0,r.position-r.key.length),u=this.input.value.substring(r.position+r.text.length),p={item:o,key:r.key,value:null,continue:!1};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:p}))||!p.value)return;let l=(n=this.expander.getAttribute("suffix"))!==null&&n!==void 0?n:" ";p.continue&&(l="");const C=`${p.value}${l}`;this.input.value=d+C+u;const q=d.length+C.length;this.deactivate(),this.input.focus({preventScroll:!0}),this.input.selectionStart=q,this.input.selectionEnd=q,p.continue||(this.lookBackIndex=q,this.match=null),this.expander.dispatchEvent(new CustomEvent("text-expander-committed",{cancelable:!1,detail:{input:this.input}}))}onBlur(){if(this.interactingWithList){this.interactingWithList=!1;return}this.deactivate()}onPaste(){this.justPasted=!0}async onInput(){if(this.justPasted){this.justPasted=!1;return}const t=this.findMatch();if(t){this.match=t;const n=await this.notifyProviders(t);if(!this.match)return;n?this.activate(t,n):this.deactivate()}else this.match=null,this.deactivate()}findMatch(){const t=this.input.selectionEnd||0,n=this.input.value;t<=this.lookBackIndex&&(this.lookBackIndex=t-1);for(const{key:o,multiWord:r}of this.expander.keys){const d=Mn(n,o,t,{multiWord:r,lookBackIndex:this.lookBackIndex,lastMatchPosition:this.match?this.match.position:null});if(d)return{text:d.text,key:o,position:d.position}}}async notifyProviders(t){const n=[],o=h=>n.push(h),r=new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:o,text:t.text,key:t.key}});return this.expander.dispatchEvent(r)?(await Promise.all(n)).filter(h=>h.matched).map(h=>h.fragment)[0]:void 0}onMousedown(){this.interactingWithList=!0}onKeydown(t){t.key==="Escape"&&(this.match=null,this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex,t.stopImmediatePropagation(),t.preventDefault()))}};class ni extends HTMLElement{get keys(){const t=this.getAttribute("keys"),n=t?t.split(" "):[],o=this.getAttribute("multiword"),r=o?o.split(" "):[],d=r.length===0&&this.hasAttribute("multiword");return n.map(u=>({key:u,multiWord:d||r.includes(u)}))}set keys(t){this.setAttribute("keys",t)}connectedCallback(){const t=this.querySelector('input[type="text"], textarea');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=new Dn(this,t);et.set(this,n)}disconnectedCallback(){const t=et.get(this);t&&(t.destroy(),et.delete(this))}dismiss(){const t=et.get(this);t&&t.dismissMenu()}}window.customElements.get("text-expander")||(window.TextExpanderElement=ni,window.customElements.define("text-expander",ni));async function Rn(s,t){const o=(await t.v1.customEmojis.list()).filter(d=>d.visibleInPicker),r=new en(o,{keys:["shortcode"],findAllMatches:!0});return[o,r]}const xi=Ki(Rn,{matchesArg:(s,t)=>s.instance===t.instance,maxAge:30*60*1e3}),Se=document.createElement("ul");Se.role="listbox";Se.className="text-expander-menu";const jn=16,$n=new IntersectionObserver(s=>{s.forEach(t=>{if(t.isIntersecting){const{left:n,width:o}=t.boundingClientRect,{innerWidth:r}=window;if(n+o>r){const d=tn()?"right":"left";Se.style[d]=r-o-jn+"px"}}})});$n.observe(Se);function Ce(s){return s.replace(/[&<>"']/g,function(t){return"&#"+t.charCodeAt(0)+";"})}function On({onTrigger:s=null,...t},n){const{_:o}=Le(),r=$(),{masto:d,instance:u}=At(),p=$(),h=$(""),l=$(!1);return Hi(n,()=>({setStyle:C=>{r.current&&Object.assign(r.current.style,C)},activated:()=>l.current})),Z(()=>{p.current||xi(u,d).then(([,C])=>{p.current=C}).catch(C=>{})},[u,d]),Z(()=>{const C=r.current;if(!C)return;const q=k=>{const{key:L,provide:D,text:g}=k.detail;if(h.current=g,g===""){D(Promise.resolve({matched:!1}));return}if(L===":"){const R=!!s,J=p.current?.search(g,{limit:5});let O="";J?.forEach(({item:y})=>{const{shortcode:x,url:N}=y;O+=`
|
||
<li role="option" data-value="${Ce(x)}">
|
||
<img src="${Ce(N)}" width="16" height="16" alt="" loading="lazy" />
|
||
${Ce(x)}
|
||
</li>`}),R&&(O+=`<li role="option" data-value="" data-more="${g}">More…</li>`),Se.innerHTML=O,D(Promise.resolve({matched:(J?.length||0)>0,fragment:Se}));return}const _={"@":"accounts","#":"hashtags"}[L];if(_){D(new Promise(async R=>{try{let J;if(_==="accounts")J=await d.v1.accounts.search.list({q:g,limit:5,resolve:!1});else{const x=await d.v2.search.list({type:_,q:g,limit:5});J=x[_]||x}if(g!==h.current)return;const O=J;let y="";O.forEach(x=>{const{name:N,avatarStatic:V,displayName:oe,username:he,acct:ie,emojis:U,history:ke,roles:Ee,url:pe}=x,j=nn(oe,U),Q=qi(pe);if(ie)y+=`
|
||
<li role="option" data-value="${Ce(ie)}">
|
||
<span class="avatar">
|
||
<img src="${Ce(V)}" width="16" height="16" alt="" loading="lazy" />
|
||
</span>
|
||
<span>
|
||
<b>${j||he}</b>
|
||
<br><span class="bidi-isolate">@${Ce(ie)}</span>
|
||
${Ee?.map(W=>` <span class="tag collapsed">
|
||
${W.name}
|
||
${!!Q&&`<span class="more-insignificant">
|
||
${Q}
|
||
</span>`}
|
||
</span>`)||""}
|
||
</span>
|
||
</li>
|
||
`;else{const W=ke?.reduce?.((le,me)=>le+ +me.uses,0);y+=`
|
||
<li role="option" data-value="${Ce(N)}">
|
||
<span class="grow">#<b>${Ce(N)}</b></span>
|
||
${W?`<span class="count">${sn(W)}</span>`:""}
|
||
</li>
|
||
`}}),_==="accounts"&&(y+=`<li role="option" data-value="" data-more="${g}">${o({id:"24misb"})}</li>`),Se.innerHTML=y,R({matched:O.length>0,fragment:Se})}catch{R({matched:!1})}}));return}D(Promise.resolve({matched:!1}))},f=k=>{const{key:L,item:D}=k.detail,{value:g,more:_}=D.dataset;L===":"?(k.detail.value=g?`:${g}:`:"",_&&(k.detail.continue=!0,setTimeout(()=>{s?.({name:"custom-emojis",defaultSearchTerm:_})},300))):L==="@"?(k.detail.value=g?`@${g}`:"",_&&(k.detail.continue=!0,setTimeout(()=>{s?.({name:"mention",defaultSearchTerm:_})},300))):k.detail.value=`${L}${g}`},w=k=>{const{input:L}=k.detail;if(L){const D=new Event("input",{bubbles:!0});L.dispatchEvent(D)}},m=()=>{l.current=!0},M=()=>{l.current=!1};return C.addEventListener("text-expander-change",q),C.addEventListener("text-expander-value",f),C.addEventListener("text-expander-committed",w),C.addEventListener("text-expander-activate",m),C.addEventListener("text-expander-deactivate",M),()=>{C.removeEventListener("text-expander-change",q),C.removeEventListener("text-expander-value",f),C.removeEventListener("text-expander-committed",w),C.removeEventListener("text-expander-activate",m),C.removeEventListener("text-expander-deactivate",M)}},[p.current,s,o,d]),e("text-expander",{ref:r,...t})}const Lt=pi(On),wi={300:_e(5,"minute"),1800:_e(30,"minute"),3600:_e(1,"hour"),21600:_e(6,"hour"),86400:_e(1,"day"),259200:_e(3,"day"),604800:_e(1,"week")};function Nn({lang:s,poll:t,disabled:n,onInput:o=()=>{},maxOptions:r,maxExpiration:d,minExpiration:u,maxCharactersPerOption:p}){const{_:h}=Le(),{options:l,expiresIn:C,multiple:q}=t;return e("div",{class:`poll ${q?"multiple":""}`,children:[e("div",{class:"poll-choices",children:l.map((f,w)=>e("div",{class:"poll-choice",children:[e(Lt,{keys:":",class:"poll-field-container",children:e("input",{required:!0,type:"text",value:f,disabled:n,maxlength:p,placeholder:h({id:"LDUSXg",values:{0:w+1}}),lang:s,spellCheck:"true",autocomplete:"off",dir:"auto","data-allow-custom-emoji":"true",onInput:m=>{const{value:M}=m.target;l[w]=M,o(t)}})}),e("button",{type:"button",class:"plain4 poll-button",disabled:n||l.length<=1,onClick:()=>{l.splice(w,1),o(t)},title:h({id:"t/YqKh"}),children:"−"})]},w))}),e("div",{class:"poll-toolbar",children:[e("button",{type:"button",class:"plain2 poll-button",disabled:n||l.length>=r,onClick:()=>{l.push(""),o(t)},title:h({id:"m16xKo"}),children:"+"})," ",e("div",{class:"poll-config",children:[e("label",{class:"multiple-choices",children:[e("input",{type:"checkbox",checked:q,disabled:n,onChange:f=>{const{checked:w}=f.target;t.multiple=w,o(t)}})," ",e(T,{id:"zytZXj"})]}),e("label",{class:"expires-in",children:[e(T,{id:"lkz6PL"})," ",e("select",{value:C,disabled:n,onChange:f=>{const{value:w}=f.target;t.expiresIn=w,o(t)},children:Object.entries(wi).filter(([f])=>f>=u&&f<=d).map(([f,w])=>e("option",{value:f,children:w()},f))})]}),e("div",{class:"spacer"}),e("button",{type:"button",class:"light danger small",disabled:n,onClick:()=>{o(null)},children:e(T,{id:"CDpQAX"})})]})]})]})}const Kn=/[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i,Hn=new RegExp(`(^|[^=\\/\\w])(@${Kn.source}(?:@[\\p{L}\\w.-]+[\\w]+)?)`,"uig"),qn=new RegExp("(^|[^=\\/\\w])(#[\\p{L}\\p{N}_]+([\\p{L}\\p{N}_.]+[\\p{L}\\p{N}_]+)?)(?![\\/\\w])","iug"),Un="[a-zA-Z0-9_]{2,}",Vn=new RegExp(`(^|[^=\\/\\w])(:${Un}:)(?=[^A-Za-z0-9_:]|$)`,"g"),Wn=new Intl.Segmenter;function Gn(s,{maxCharacters:t=1/0}){const{composerCharacterCount:n}=X;if(n>t){let o="",r="";const d=Wn.segment(s);for(const{segment:u,index:p}of d)p<t?o+=u:r+=u;return r&&(r='<mark class="compose-highlight-exceeded">'+vt(r)+"</mark>"),vt(o)+r}return vt(s).replace(yi,'$2<mark class="compose-highlight-url">$3</mark>').replace(Hn,'$1<mark class="compose-highlight-mention">$2</mark>').replace(qn,'$1<mark class="compose-highlight-hashtag">$2</mark>').replace(Vn,'$1<mark class="compose-highlight-emoji-shortcode">$2</mark>')}function si(s){if(!s)return;const{value:t,offsetHeight:n,scrollHeight:o,clientHeight:r}=s;if(n<window.innerHeight){const d=n-r,u=t?o+d+"px":null;s.style.height=u}}const Yn=async s=>{if(Gt){const o=await Gt.detect(s);if(o?.length)return o.slice(0,2).map(r=>r.detectedLanguage)}const{detectAll:t}=await Ui(async()=>{const{detectAll:o}=await import("./tinyld.light.node-D9KYf3Y3.js");return{detectAll:o}},[],import.meta.url),n=t(s);return n?.length?n.slice(0,2).map(o=>o.lang):null},Zn=pi((s,t)=>{const[n,o]=I(t.current?.value||""),{maxCharacters:r,onTrigger:d=null,...u}=s,p=$();fi({ref:t,onResize:()=>{if(p.current&&t.current){const{height:f}=t.current.getBoundingClientRect();f&&p.current.setStyle({minHeight:f+"px"})}}});const h=$(0),l=$(),C=an(f=>{if(!l.current)return;if(h.current>3){l.current.innerHTML="",l.current=null,C?.cancel?.();return}let w,m;h.current<=3&&(w=Date.now()),l.current.innerHTML=Gn(f,{maxCharacters:r})+`
|
||
`,h.current<=3&&(m=Date.now()),w&&m&&m-w>50&&h.current++},500),q=ot(()=>{const f=l.current?.cloneNode(!0);if(!f)return;f.querySelectorAll("mark").forEach(m=>{m.remove()});const w=f.innerText?.trim();w&&(async()=>{const m=await Yn(w);m?.length&&d?.({name:"auto-detect-language",languages:m})})()},2e3);return e(Lt,{ref:p,keys:"@ # :",class:"compose-field-container",onTrigger:d,children:[e("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...u,ref:t,name:"status",value:n,onKeyDown:f=>{const{key:w,target:m}=f,M=p.current?.activated();if(w==="Enter"&&!(f.ctrlKey||f.metaKey||M)&&!f.isComposing)try{const{value:k,selectionStart:L}=m,g=k.slice(0,L).split(`
|
||
`).slice(-1)[0];if(g&&/^\s*(-|\d+\.)\s/.test(g)){const[_,R,J,O,y]=g.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(y){f.preventDefault();const[x]=J.match(/\d+/)||[],N=x?`${+x+1}.`:"-",V=`
|
||
${R}${N}${O}`;m.setRangeText(V,L,L);const oe=L+V.length;m.setSelectionRange(oe,oe)}else{const x=L-g.length;m.setRangeText("",x,L)}si(m),m.dispatchEvent(new Event("input"))}}catch{}l.current&&(l.current.scrollTop=m.scrollTop)},onInput:f=>{const{target:w}=f,m=w.value;o(m),si(w),s.onInput?.(f),C(m),q()},onScroll:f=>{if(l.current){const{scrollTop:w}=f.target;l.current.scrollTop=w}},onPaste:f=>{try{const w=f.clipboardData.getData("text").trim();w&&d?.({name:"pasted-link",url:w})}catch{}}}),e("div",{ref:l,class:"compose-highlight","aria-hidden":"true"})]})}),Ft=100,Ne=1,ai=2,oi=.5,ki=mi(({emoji:s,onClick:t,showCode:n})=>{const o=r=>{const u=r.currentTarget.closest("main");if(u){const p=u.getBoundingClientRect(),h=r.currentTarget.getBoundingClientRect(),l=r.currentTarget.classList;h.left<p.left+88?(l.add("edge-left"),l.remove("edge-right")):h.right>p.right-88?(l.add("edge-right"),l.remove("edge-left")):l.remove("edge-left","edge-right")}};return e("button",{type:"button",className:"plain4",onClick:t,"data-title":n?void 0:s.shortcode,onPointerEnter:o,onFocus:o,children:[e("picture",{children:[!!s.staticUrl&&e("source",{srcSet:s.staticUrl,media:"(prefers-reduced-motion: reduce)"}),e("img",{className:"shortcode-emoji",src:s.url||s.staticUrl,alt:s.shortcode,width:"24",height:"24",loading:"lazy",decoding:"async"})]}),n&&e(Re,{children:[" ",e("code",{children:s.shortcode})]})]})}),Qn=mi(({emojis:s,onSelect:t})=>{const{i18n:n}=Le(),[o,r]=I(Ft),d=s.length>o;return e("section",{children:[s.slice(0,o).map(u=>e(ki,{emoji:u,onClick:()=>{t(`:${u.shortcode}:`)}},u.shortcode)),d&&e("button",{type:"button",class:"plain small",onClick:()=>r(o+Ft),children:e(T,{id:"iAB71E",values:{0:n.number(s.length-o)}})})]})}),Ke="composer-customEmojiSize";function Xn({masto:s,instance:t,onClose:n=()=>{},onSelect:o=()=>{},defaultSearchTerm:r}){const{_:d}=Le(),[u,p]=I("default"),h=$([]),[l,C]=I([]),q=De(()=>fe.account.get("recentlyUsedCustomEmojis")||[]),f=$();Z(()=>{p("loading"),(async()=>{try{const[y,x]=await xi(t,s);f.current=x,C(y),p("default")}catch{p("error")}})()},[]);const w=De(()=>{const y={"--recent--":q.filter(N=>l.find(V=>V.shortcode===N.shortcode))},x=[];return l.forEach(N=>{if(h.current?.push?.(N),!N.category){x.push(N);return}y[N.category]||(y[N.category]=[]),y[N.category].push(N)}),x.length&&(y["--others--"]=x),y},[l]),m=$(),[M,k]=I(null),[L,D]=I(fe.local.get(Ke)||Ne),g=Xe(()=>{const y=Math.max(Ne,L-oi);D(y),y===Ne?fe.local.del(Ke):fe.local.set(Ke,y)},[L]),_=Xe(()=>{const y=Math.min(ai,L+oi);D(y),y===Ne?fe.local.del(Ke):fe.local.set(Ke,y)},[L]),R=Xe(y=>{const{value:x}=y.target;if(x){const N=f.current?.search(x,{limit:Ft});k(N.map(V=>V.item)),m.current?.scrollTo?.(0,0)}else k(null)},[l]);Z(()=>{r&&l?.length&&R({target:{value:r}})},[r,R,l]);const J=Xe(y=>{o?.(y),n?.(),queueMicrotask(()=>{let x=fe.account.get("recentlyUsedCustomEmojis")||[];const N=x.findIndex(V=>V.shortcode===y.shortcode);N!==-1?(x.splice(N,1),x.unshift(y)):(x.unshift(y),x=x.filter(V=>h.current?.find?.(oe=>oe.shortcode===V.shortcode)),x=x.slice(0,10)),fe.account.set("recentlyUsedCustomEmojis",x)})},[o]),O=$();return Z(()=>{O.current&&(O.current.focus(),O.current.value&&(O.current.selectionStart=O.current.value.length,O.current.selectionEnd=O.current.value.length))},[]),e("div",{id:"custom-emojis-sheet",class:"sheet",style:{"--custom-emoji-size":L},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(S,{icon:"x",alt:d({id:"yz7wBu"})})}),e("header",{children:[e("div",{children:[e("b",{children:e(T,{id:"8i6Ueo"})})," ",u==="loading"?e(at,{}):e("small",{class:"insignificant",children:[" • ",t]})]}),e("form",{onSubmit:y=>{y.preventDefault();const x=M[0];x&&J(`:${x.shortcode}:`)},children:e("input",{ref:O,type:"search",placeholder:d({id:"EarrCe"}),onInput:R,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",defaultValue:r||""})})]}),e("main",{ref:m,children:[M!==null?e("ul",{class:"custom-emojis-matches custom-emojis-list",children:M.map(y=>e("li",{class:"custom-emojis-match",children:e(ki,{emoji:y,onClick:()=>{J(`:${y.shortcode}:`)},showCode:!0})},y.shortcode))}):e("div",{class:"custom-emojis-list",children:[u==="error"&&e("div",{class:"ui-state",children:e("p",{children:e(T,{id:"Kzwsg2"})})}),u==="default"&&Object.entries(w).map(([y,x])=>!!x?.length&&e("div",{class:"section-container",children:[e("div",{class:"section-header",children:{"--recent--":d({id:"uabU9X"}),"--others--":d({id:"NuKR0h"})}[y]||y}),e(Qn,{emojis:x,onSelect:J})]}))]}),e("div",{class:"size-range",children:[e("button",{type:"button",class:"plain4",onClick:g,disabled:L<=Ne,children:e(S,{icon:"zoom-out",size:"l",alt:d({id:"FjkaiT"})})}),e("button",{type:"button",class:"plain4",onClick:_,disabled:L>=ai,children:e(S,{icon:"zoom-in",size:"l",alt:d({id:"AWOSPo"})})})]})]})]})}function ri({hidden:s,supportedMimeTypes:t,maxMediaAttachments:n,mediaAttachments:o,disabled:r=!1,setMediaAttachments:d}){return e("input",{type:"file",hidden:s,accept:t?.join(","),multiple:n===void 0||n-o>=2,disabled:r,onChange:u=>{const p=u.target.files;if(!p)return;const h=Array.from(p).map(l=>({file:l,type:l.type,size:l.size,url:URL.createObjectURL(l),id:null,description:null}));o.length+h.length>n?alert(He._({id:"ctFhjs",values:{maxMediaAttachments:n}})):d(l=>l.concat(h)),u.target.value=""}})}const Jn="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20version='1.0'%20viewBox='0%200%20641%20223'%3e%3cpath%20fill='%23aaa'%20d='M86%20214c-9-1-17-4-24-8l-6-3-5-5-5-4-4-6-4-6-3-8-2-8v-27l2-9%203-9%204-6%204-6%205-5%205-5%207-3%206-4%207-2%207-2%2012-1h12l7%201%208%202%207%204%207%203%205%205%205%204-10%2010-10%209-4-3-10-5-5-1H88l-5%202-6%203-3%204-4%204-2%205-2%206v6l-1%207%201%207%202%207%203%205%202%204%204%203%204%203%205%202%206%202h9l10-1%205-2%206-3v-16H91v-27h59v54l-1%203-2%203-5%204-4%204-5%203-5%202-8%202-8%202-10%201H92l-6-1zm266-62V91h34v46h44V91h34v121h-34v-46h-44v46h-34v-61zm-182-1V90h34v121h-34v-60zm59-1V90h35l36%201%205%202c3%200%208%202%2010%204l5%202%204%205%205%204%203%207%203%207%201%2013v13l-4%206-3%207-4%204-5%205-5%202-5%203-6%202-5%201-18%201h-18v32h-34v-61zm67-2%203-2%202-4%202-5v-5l-2-4-2-4-3-2-3-3h-30v31h30l3-2zm226%2039v-24l-8-12-18-28a1751%201751%200%200%200-20-31v-2h39l7%2012%2012%2021%206%209%2013-21%2013-21h38v2l-41%2061-7%2010v48h-34v-24zM109%2066l-4-1-5-5-5-4-1-5-3-9v-5l1-5c2-7%203-10%208-15l4-4%207-2%207-2h7l6%201%205%202%205%202%203%204%204%203%202%206%202%205v13l-2%205-2%206-4%204-3%203-5%202-4%202-9%201h-9l-5-2zm22-11%204-2%203-4%202-5V34l-2-4-2-4-3-2-4-3-5-1h-6l-4%202-5%202-2%204-3%205-1%203v4l1%205%202%205%202%202%205%203%204%202h10l4-2zM37%2039V11h33l3%201%203%202%204%203%203%203%201%205%201%204v5l-1%204-3%204-3%205-4%201-3%202-11%201H49v16H37V39zm31%200%203-2%201-2%201-2v-4l-1-3-3-2-2-2H49v18h15l4-1zm107%2025a512%20512%200%200%200-19-53h14l4%2014%206%2019%201%204%201-1%207-19%205-17h9l6%2019%207%2018v-1l2-6%205-17%204-13h14v1l-4%2012-16%2041v2h-5l-5-1-6-15-6-15-1%201-3%207-6%2015-2%208h-11l-1-3zm74-25V11h42v11h-29v2l-1%205v4h29v11h-28v11h2l15%201h13v11h-43V39zm55%200V11h33l5%203%205%202%202%204%202%205v10l-2%203-1%204-5%203-5%203%205%205%208%2010%203%204h-14l-7-9-8-10h-9v19h-12V39zm33-3%202-3v-6l-3-3-2-3h-18v16h1v1h17l2-2zm26%203V11h42v11h-29l-1%206v5h29v11h-28v5l-1%205%201%201v1h30v11h-43V39zm54%200V11h17l18%201%204%202%205%203%202%204%203%204%202%206%201%206v5c-1%206-3%2012-6%2015l-3%204-5%203-5%202-17%201h-16V39zm33%2014%205-5%202-3v-6l-1-6-1-3-1-3-4-3-3-2h-5l-6-1-3%201h-3v34h9l8-1%203-2zm50-14V11h34l5%202%204%202%202%203%202%203v9l-2%202-3%204-1%201%203%203%203%204%201%203%201%204-1%204-1%204-3%203-3%203-5%201-5%201h-31V39zm34%2015%202-1v-6l-2-2-2-2h-20v13h20l2-2zm-3-22%204-2v-6l-2-1-2-2h-19v12h16l4-1zm42%2024V45l-6-9-11-17-5-8h15l4%208%207%2011%202%203%207-11%207-11h14l-11%2016-11%2017v23h-12V56z'/%3e%3c/svg%3e",es={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_GIPHY_API_KEY:ts}=es,wt=20;function is({onClose:s=()=>{},onSelect:t=()=>{}}){const{i18n:n,_:o}=Le(),[r,d]=I("default"),[u,p]=I([]),h=$(null),l=$(null),C=$(0),q=$(null);function f({offset:m}){l.current?.value&&(d("loading"),q.current?.scrollTo?.({top:0,left:0,behavior:"smooth"}),(async()=>{try{const M={api_key:ts,q:l.current.value,rating:"g",limit:wt,bundle:"messaging_non_clips",offset:m,lang:n.locale||"en"},k=await fetch("https://api.giphy.com/v1/gifs/search?"+new URLSearchParams(M),{referrerPolicy:"no-referrer"}).then(L=>L.json());C.current=k.pagination?.offset||0,p(k),d("results")}catch{d("error")}})())}Z(()=>{l.current?.focus()},[]);const w=ot(()=>{f({offset:0})},1e3);return e("div",{id:"gif-picker-sheet",class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(S,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("form",{ref:h,onSubmit:m=>{m.preventDefault(),f({offset:0})},children:[e("input",{ref:l,type:"search",name:"q",placeholder:o({id:"wxlF9B"}),required:!0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",onInput:w}),e("input",{type:"image",class:"powered-button",src:Jn,width:"86",height:"30",alt:o({id:"c1Q/eU"})})]})}),e("main",{ref:q,class:r==="loading"?"loading":"",children:[r==="default"&&e("div",{class:"ui-state",children:e("p",{class:"insignificant",children:e(T,{id:"9KEidY"})})}),r==="loading"&&!u?.data?.length&&e("div",{class:"ui-state",children:e(at,{abrupt:!0})}),u?.data?.length>0?e(Re,{children:[e("ul",{children:u.data.map(m=>{const{id:M,images:k,title:L,alt_text:D}=m,{fixed_height_small:g,fixed_height_downsampled:_,fixed_height:R,original:J}=k,O=g?.url?g:_?.url?_:R;let{url:y,webp:x,width:N,height:V}=O;+V>100&&(N=N/V*100,V=100);const oe=URL.parse(y),he=oe.origin+oe.pathname;let ie;if(x){const U=URL.parse(x);ie=U.origin+U.pathname}return e("li",{children:e("button",{type:"button",onClick:()=>{const{mp4:U,url:ke}=J,Ee=U||ke,pe=URL.parse(Ee),j=pe.origin+pe.pathname;s(),t({url:j,type:U?"video/mp4":"image/gif",alt_text:D||L})},children:e("figure",{style:{"--figure-width":N+"px"},children:[e("picture",{children:[ie&&e("source",{srcset:ie,type:"image/webp"}),e("img",{src:he,width:N,height:V,loading:"lazy",decoding:"async",alt:D,referrerpolicy:"no-referrer",onLoad:U=>{U.target.style.backgroundColor="transparent"}})]}),e("figcaption",{children:D||L})]})})},M)})}),e("p",{class:"pagination",children:[u.pagination?.offset>0&&e("button",{type:"button",class:"light small",disabled:r==="loading",onClick:()=>{f({offset:u.pagination?.offset-wt})},children:[e(S,{icon:"chevron-left"}),e("span",{children:e(T,{id:"DHhJ7s"})})]}),e("span",{}),u.pagination?.offset+u.pagination?.count<u.pagination?.total_count&&e("button",{type:"button",class:"light small",disabled:r==="loading",onClick:()=>{f({offset:u.pagination?.offset+wt})},children:[e("span",{children:e(T,{id:"hXzOVo"})})," ",e(S,{icon:"chevron-right"})]})]})]}):r==="results"&&e("div",{class:"ui-state",children:e("p",{children:"No results"})}),r==="error"&&e("div",{class:"ui-state",children:e("p",{children:e(T,{id:"PbFw9n"})})})]})]})}const ns={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:kt}=ns;function li(s,t,n,o){const r=Math.sqrt(t/s),d=Math.floor(n*r),u=Math.floor(o*r);return{newWidth:d,newHeight:u}}function ss({attachment:s,disabled:t,lang:n,supportedMimeTypes:o,descriptionLimit:r=1500,onDescriptionChange:d=()=>{},onRemove:u=()=>{}}){const{i18n:p,_:h}=Le(),[l,C]=I("default"),q=tt("@mastodon/edit-media-attributes"),{type:f,id:w,file:m}=s,M=De(()=>m?URL.createObjectURL(m):s.url,[m,s.url]),k=!!m?.size,L=k?gi():{},{mediaAttachments:{imageSizeLimit:D,imageMatrixLimit:g,videoSizeLimit:_,videoMatrixLimit:R,videoFrameRateLimit:J}={}}=L||{},[O,y]=I(()=>k?f.startsWith("image")&&D&&m.size>D?{type:"imageSizeLimit",details:{imageSize:m.size,imageSizeLimit:D}}:f.startsWith("video")&&_&&m.size>_?{type:"videoSizeLimit",details:{videoSize:m.size,videoSizeLimit:_}}:null:null),[x,N]=I({});Z(()=>{!k||!g||x?.matrix>g&&y({type:"imageMatrixLimit",details:{imageMatrix:x?.matrix,imageMatrixLimit:g,width:x?.width,height:x?.height}})},[x,g,k]);const[V,oe]=I({});Z(()=>{!k||!R||V?.matrix>R&&y({type:"videoMatrixLimit",details:{videoMatrix:V?.matrix,videoMatrixLimit:R,width:V?.width,height:V?.height}})},[V,R,k]);const[he,ie]=I(s.description);let[U,ke]=f.split("/");const Ee=new Set,pe={};o?.length&&o.forEach(K=>{const[Y,z]=K.split("/");pe[z]=Y,Ee.add(Y)}),Ee.has(U)||(U=pe[ke]);const j=ot(d,250);Z(()=>{j(he)},[he,j]);const[Q,W]=I(!1),le=$(null);Z(()=>{let K;return Q&&le.current&&(K=setTimeout(()=>{le.current.focus()},100)),()=>{clearTimeout(K)}},[Q]);const me=e(Re,{children:w&&!q?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(T,{id:"3wG7HI"})}),e("p",{title:he,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:le,value:he||"",lang:n,placeholder:{image:h({id:"Lh8B0N"}),video:h({id:"mN4S+e"}),audio:h({id:"ieZytw"})}[U],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||l==="loading",class:l==="loading"?"loading":"",maxlength:r,onInput:K=>{const{value:Y}=K.target;ie(Y)}})}),ce=$(null);Z(()=>()=>{ce.current?.hideToast?.()},[]);const re=$(null),ve=K=>{const{type:Y,details:z}=K;switch(Y){case"imageSizeLimit":{const{imageSize:ne,imageSizeLimit:ge}=z;return h({id:"d83/LB",values:{0:Je(ne),1:Je(ge)}})}case"imageMatrixLimit":{const{imageMatrix:ne,imageMatrixLimit:ge,width:B,height:te}=z,{newWidth:ee,newHeight:be}=li(ne,ge,B,te);return h({id:"DuvOX/",values:{0:p.number(B),1:p.number(te),2:p.number(ee),3:p.number(be)}})}case"videoSizeLimit":{const{videoSize:ne,videoSizeLimit:ge}=z;return h({id:"d83/LB",values:{0:Je(ne),1:Je(ge)}})}case"videoMatrixLimit":{const{videoMatrix:ne,videoMatrixLimit:ge,width:B,height:te}=z,{newWidth:ee,newHeight:be}=li(ne,ge,B,te);return h({id:"DuvOX/",values:{0:p.number(B),1:p.number(te),2:p.number(ee),3:p.number(be)}})}case"videoFrameRateLimit":return h({id:"S1fBwy"})}};return e(Re,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{W(!0)},children:U==="image"?e("img",{src:M,alt:"",onLoad:K=>{if(!k)return;const{naturalWidth:Y,naturalHeight:z}=K.target;N({matrix:Y*z,width:Y,height:z})}}):U==="video"||U==="gifv"?e("video",{src:M+"#t=0.1",playsinline:!0,muted:!0,disablePictureInPicture:!0,preload:"metadata",onLoadedMetadata:K=>{if(!k)return;const{videoWidth:Y,videoHeight:z}=K.target;Y&&z&&oe({matrix:Y*z,width:Y,height:z})}}):U==="audio"?e("audio",{src:M,controls:!0}):null}),me,e("div",{class:"media-aside",children:[e("button",{type:"button",class:"plain close-button",disabled:t,onClick:u,children:e(S,{icon:"x",alt:h({id:"t/YqKh"})})}),!!O&&e("button",{type:"button",class:"media-error",title:ve(O),onClick:()=>{re.current&&re.current.hideToast(),re.current=Ie({text:ve(O),duration:1e4})},children:e(S,{icon:"alert",alt:h({id:"SlfejT"})})})]})]}),Q&&e(it,{onClose:()=>{W(!1)},children:e("div",{id:"media-sheet",class:"sheet sheet-max",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>{W(!1)},children:e(S,{icon:"x",alt:h({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:{image:h({id:"oMslIB"}),video:h({id:"WZw+zB"}),audio:h({id:"KMtgtM"})}[U]})}),e("main",{tabIndex:"-1",children:[e("div",{class:"media-preview",children:U==="image"?e("img",{src:M,alt:""}):U==="video"||U==="gifv"?e("video",{src:M,playsinline:!0,controls:!0}):U==="audio"?e("audio",{src:M,controls:!0}):null}),e("div",{class:"media-form",children:[me,e("footer",{children:[U==="image"&&/^(png|jpe?g|gif|webp)$/i.test(ke)&&!!X.settings.mediaAltGenerator&&!!kt&&e(vi,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:e(S,{icon:"more",size:"l",alt:h({id:"2FYpfJ"})})}),children:[e(we,{disabled:l==="loading",onClick:()=>{C("loading"),ce.current=Ie({text:h({id:"8zsp51"}),duration:-1}),async function(){try{const K=new FormData;K.append("image",m);const Y=await fetch(kt,{method:"POST",body:K}).then(z=>z.json());if(Y.error)throw new Error(Y.error);ie(Y.description)}catch(K){Ie(K.message?h({id:"wy0Iwj",values:{0:K.message}}):h({id:"xhYfVj"}))}finally{C("default"),ce.current?.hideToast?.()}}()},children:[e(S,{icon:"sparkles2"}),n&&n!=="en"?e("small",{children:[e(T,{id:"o5sTJw"}),e("br",{}),"(English)"]}):e("span",{children:e(T,{id:"o5sTJw"})})]}),!!n&&n!=="en"&&e(we,{disabled:l==="loading",onClick:()=>{C("loading"),ce.current=Ie({text:h({id:"8zsp51"}),duration:-1}),async function(){try{const K=new FormData;K.append("image",m);const Y=`?lang=${n}`,z=await fetch(kt+Y,{method:"POST",body:K}).then(ne=>ne.json());if(z.error)throw new Error(z.error);ie(z.description)}catch(K){Ie(h({id:"eNTGfp",values:{0:K?.message?`: ${K.message}`:""}}))}finally{C("default"),ce.current?.hideToast?.()}}()},children:[e(S,{icon:"sparkles2"}),e("small",{children:[e(T,{id:"o5sTJw"}),e("br",{}),e(T,{id:"m+pAEQ",values:{0:Et(n)},components:{0:e("span",{class:"more-insignificant"})}})]})]})]}),e("button",{type:"button",class:"light block",onClick:()=>{W(!1)},disabled:l==="loading",children:e(T,{id:"DPfwMq"})})]})]})]})]})})]})}function as({onClose:s=()=>{},onSelect:t=()=>{},defaultSearchTerm:n}){const{_:o}=Le(),{masto:r}=At(),[d,u]=I("default"),[p,h]=I([]),[l,C]=I({}),[q,f]=I(0),w=async g=>{if(!g?.length)return;const _=await on(g,l);_&&C({...l,..._})},m=g=>{g&&(u("loading"),(async()=>{try{const _=await r.v1.accounts.search.list({q:g,limit:40,resolve:!1});h(_),w(_),u("default")}catch{u("error")}})())},M=ot(m,1e3);Z(()=>{m()},[m]);const k=$();Z(()=>{k.current&&(k.current.focus(),k.current.value&&(k.current.selectionStart=k.current.value.length,k.current.selectionEnd=k.current.value.length))},[]),Z(()=>{n&&m(n)},[n]);const L=g=>{const _=g.acct;t(_),s()};qe("enter",()=>{const g=p[q];g&&L(g)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey});const D=$();return qe("down",()=>{q<p.length-1?f(q+1):f(0),setTimeout(()=>{const g=D.current.querySelector(".selected");g&&g.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey}),qe("up",()=>{q>0?f(q-1):f(p.length-1),setTimeout(()=>{const g=D.current.querySelector(".selected");g&&g.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey}),e("div",{id:"mention-sheet",class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(S,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("form",{onSubmit:g=>{g.preventDefault(),M.flush?.()},children:e("input",{ref:k,required:!0,type:"search",class:"block",placeholder:o({id:"eH1bqp"}),onInput:g=>{const{value:_}=g.target;M(_)},autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",defaultValue:n||""})})}),e("main",{children:p?.length>0?e("ul",{ref:D,class:`accounts-list ${d==="loading"?"loading":""}`,children:p.map((g,_)=>{const R=l[g.id];return e("li",{class:_===q?"selected":"",children:[e(bi,{avatarSize:"xxl",account:g,relationship:R,showStats:!0,showActivity:!0}),e("button",{type:"button",class:"plain2",onClick:()=>{L(g)},children:e(S,{icon:"plus",size:"xl",alt:o({id:"m16xKo"})})})]},g.id)})}):d==="loading"?e("div",{class:"ui-state",children:e(at,{abrupt:!0})}):d==="error"?e("div",{class:"ui-state",children:e("p",{children:e(T,{id:"AThL/k"})})}):null})]})}function os({quoteSuggestion:s,hasCurrentQuoteStatus:t,onAccept:n,onCancel:o}){return s?e("div",{class:"quote-suggestion",children:[e("div",{class:"quote-suggestion-header",children:[e("b",{children:e(T,{id:"UefSZg"})}),e("div",{class:"quote-suggestion-url",children:s.url})]}),e("div",{class:"quote-status",children:e(nt,{status:s.status,instance:s.instance,size:"s",readOnly:!0})}),e("div",{class:"quote-suggestion-actions",children:[e("span",{class:"spacer"}),e("button",{type:"button",class:"plain",onClick:o,children:t?e(T,{id:"dEgA5A"}):e(T,{id:"nc+Oa+"})}),e("button",{type:"button",class:"plain6",onClick:n,children:t?e(T,{id:"UYZxOy"}):e(T,{id:"vuFeUI"})})]})]}):null}const rs=Ct.reduce((s,t)=>{const[n,o,r]=t;return s[n]={common:o,native:r},s},{}),ls=Object.keys(wi),ci=24*60*60,ui=s=>{if(!s)return ci;const t=(Date.parse(s)-Date.now())/1e3;return ls.find(n=>n>=t)||ci},Te=Vi([rn(),...navigator.languages],Ct.map(s=>s[0]),"en"),cs=/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/gi,us="$2xxxxxxxxxxxxxxxxxxxxxxx";function ds(s){return s.replace(yi,us).replace(cs,"$1@$3")}const hs=Wi(s=>new Intl.ListFormat(s||void 0)),ae={camera:{id:"TbrCz2"},media:{id:"MfJ43d"},customEmoji:{id:"ggiJLM"},gif:{id:"Fm6c4W"},poll:{id:"cZJ92q"},sensitive:{id:"x/s2/O"},scheduledPost:{id:"sX3iLV"}},ps=Math.max(10*60*1e3,ln);function bs({onClose:s,replyToStatus:t,editStatus:n,draftStatus:o,quoteStatus:r,standalone:d,hasOpener:u}){const{i18n:p,_:h,_:l}=Le(),C=cn(p.locale),q=hs(p.locale),{masto:f,instance:w}=At(),[m,M]=I("default"),k=$(o?.uid||un()),L=De(Gi,[]),D=L.info,g=gi(),{statuses:{maxCharacters:_,maxMediaAttachments:R,charactersReservedPerUrl:J}={},mediaAttachments:{supportedMimeTypes:O,imageSizeLimit:y,imageMatrixLimit:x,videoSizeLimit:N,videoMatrixLimit:V,videoFrameRateLimit:oe,descriptionLimit:he}={},polls:{maxOptions:ie,maxCharactersPerOption:U,maxExpiration:ke,minExpiration:Ee}={}}=g||{},pe=O?.filter(a=>/^(image|video)/i.test(a)),j=$(),Q=$(),[W,le]=I("public"),[me,ce]=I("public"),[re,ve]=I(!1),[K,Y]=I(!1),[z,ne]=I(fe.session.get("currentLanguage")||Te),ge=$(z),[B,te]=I([]),[ee,be]=I(null),[Fe,Ue]=I(null),[Ve,je]=I(null),[Ei,rt]=I(r),se=Yi(),ue=Ei||r,Fi=a=>{if(!Pe())return!1;const{visibility:c,quoteApproval:b,account:v}=a,A=D&&D.id===v.id,F=["public","unlisted"].includes(c),E=A&&c==="private",P=b?.currentUser==="automatic"&&(F||E),H=b?.currentUser==="manual"&&(F||E);return!F&&!A?!1:P?!0:!!H},Ai=async a=>{if(Pe()){if(B.length>0||ee||n)return;try{const c=await Zi(w,a);if(c?.id){const b=X.statuses[`${c.instance}/${c.id}`];if(b&&Fi(b)){if(ue?.id===b.id)return;je({status:b,instance:c.instance,url:c.originalURL})}}}catch{}}},lt=()=>{j.current&&j.current.dispatchEvent(new Event("input"))},Me=()=>{setTimeout(()=>{j.current&&(/^\n|\s/.test(o?.status)&&(j.current.selectionStart=0,j.current.selectionEnd=0),j.current?.focus())},300)},zt=({targetElement:a,text:c})=>{if(!a)return;const{selectionStart:b,selectionEnd:v,value:A}=a;let F=A.slice(0,b);F=F.replace(/\u200B$/,"");const E=F?/[\s\t\n\r]$/.test(F)?"":" ":"",P=A.slice(v),H=/^[\s\t\n\r]/.test(P)?"":" ",ye=F+E+c+H+P;a.value=ye,a.selectionStart=a.selectionEnd=v+c.length+H.length,a.focus(),a.dispatchEvent(new Event("input"))},We=$(null),Ge=$(null),$e=()=>{setTimeout(()=>{We.current&&We.current.focus()},0)},Ye=$(null);Z(()=>{const a=b=>{Ye.current.classList.toggle("focused",b.type==="focusin");const v=b.target;v.hasAttribute("data-allow-custom-emoji")&&(Ge.current=v),["INPUT","BUTTON","SELECT","TEXTAREA"].includes(v.tagName)&&(We.current=v)},c=Ye.current;return c&&(c.addEventListener("focusin",a),c.addEventListener("focusout",a)),()=>{c&&(c.removeEventListener("focusin",a),c.removeEventListener("focusout",a))}},[]),Z(()=>{if(t){const{spoilerText:a,visibility:c,language:b,sensitive:v}=t;a&&Q.current&&(Q.current.value=a);const F=[...new Set([t.account.acct,...t.mentions.map(E=>E.acct)])].filter(E=>E!==D.acct);F.length>0&&(j.current.value=`${F.map(E=>`@${E}`).join(" ")} `,lt()),Me(),le(c==="public"&&se["posting:default:visibility"]?se["posting:default:visibility"].toLowerCase():c),ne(b||se["posting:default:language"]?.toLowerCase()||Te),ve(!!a)}else if(n){const{visibility:a,language:c,sensitive:b,poll:v,mediaAttachments:A,quoteApproval:F}=n,E=!!v?.options&&{...v,options:v.options.map(P=>P?.title||P),expiresIn:v?.expiresIn||ui(v.expiresAt)};M("loading"),(async()=>{try{const P=await f.v1.statuses.$select(n.id).source.fetch(),{text:H,spoilerText:ye}=P;if(j.current.value=H,j.current.dataset.source=H,lt(),Me(),Q.current.value=ye,le(a),ne(c||se["posting:default:language"]?.toLowerCase()||Te),Pe()){const G=dn(F);ce(G)}ve(b),E&&be(E),te(A),M("default")}catch(P){alert(P?.reason||P),M("error")}})()}else if(Me(),se["posting:default:visibility"]&&le(se["posting:default:visibility"].toLowerCase()),se["posting:default:language"]&&ne(se["posting:default:language"].toLowerCase()),se["posting:default:sensitive"]&&ve(!!se["posting:default:sensitive"]),se["posting:default:quote_policy"]){let a=se["posting:default:quote_policy"].toLowerCase();if(se["posting:default:visibility"]){const c=se["posting:default:visibility"].toLowerCase();(c==="private"||c==="direct")&&(a="nobody")}ce(a)}if(o){const{status:a,spoilerText:c,visibility:b,language:v,sensitive:A,sensitiveMedia:F,poll:E,mediaAttachments:P,scheduledAt:H,quoteApprovalPolicy:ye}=o,G=!!E?.options&&{...E,options:E.options.map(de=>de?.title||de),expiresIn:E?.expiresIn||ui(E.expiresAt)};j.current.value=a,lt(),Me(),c&&(Q.current.value=c),b&&le(b),ne(v||se["posting:default:language"]?.toLowerCase()||Te),F!==null&&Y(F),A!==null&&ve(A),G&&be(G),P&&te(P),H&&Ue(H),ye&&ce(ye)}},[o,n,t]);const _t=hi(X);Z(()=>{_t.composerState.minimized||Me()},[_t.composerState.minimized]);const Tt=$(),It=l({id:"hR9gtK"}),ct=()=>{const{value:a,dataset:c}=j.current;if(m==="loading")return!1;const b=(a||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),v=B.length>0;if(!b&&!v||B.length>0&&B.every(H=>H.id))return!0;const F=t?.account.id===D.id,E=t&&a.trim()===`@${t.account.acct}`;return!!(!F&&E||a===c?.source)},ut=()=>ct()?!0:confirm(It);Z(()=>{const a=c=>{ct()||(c.preventDefault(),c.returnValue=It)};return window.addEventListener("beforeunload",a,{capture:!0}),()=>window.removeEventListener("beforeunload",a,{capture:!0})},[]);const Ci=()=>{const{value:a}=j.current,{value:c}=Q.current;return Qt(ds(a))+Qt(c)},dt=()=>{const a=Ci();X.composerCharacterCount=a};Z(dt,[]);const Mt=window.CloseWatcher,ht=$(!1);qe("esc",()=>{ht.current=!0},{enabled:!Mt,enableOnFormTags:!0,useKey:!0,ignoreEventWhen:a=>a.metaKey||a.ctrlKey||a.altKey||a.shiftKey}),qe("esc",()=>{!d&&ht.current&&ut()&&s(),ht.current=!1},{enabled:!Mt,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:a=>{const c=document.querySelectorAll("#modal-container > *"),b=!!c,v=c.length===1&&c[0].querySelector("#compose-container");return b&&!v||a.metaKey||a.ctrlKey||a.altKey||a.shiftKey},useKey:!0}),hn(()=>{!d&&ut()&&s()},[]);const Bt=$({}),Pt=()=>`${Qi()}#${k.current}`,pt=()=>{if(n||X.composerState.minimized)return;const a=Pt(),c={key:a,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:k.current,status:j.current.value,spoilerText:Q.current.value,visibility:W,language:z,sensitive:re,sensitiveMedia:K,poll:ee,mediaAttachments:B,scheduledAt:Fe,quoteApprovalPolicy:me},quote:ue?.id?{id:ue.id}:null};!Xi(c,Bt.current)&&!ct()&&(Yt.drafts.set(a,{...c,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(b=>{}),Bt.current=structuredClone(c))};pn(pt,5e3),Z(()=>(pt(),()=>{Yt.drafts.del(Pt())}),[]),Z(()=>{const a=b=>{const{items:v}=b.clipboardData||b.dataTransfer,A=[],F=[];for(let E=0;E<v.length;E++){const P=v[E];if(P.kind==="file"){const H=P.getAsFile();O!==void 0&&!O.includes(H.type)?F.push(H):A.push(H)}}if(F.length>0&&alert(He._({id:"rpXAF6",values:{0:F.length,1:F[0].name,2:q.format(F.map(E=>E.name))}})),A.length>0&&B.length>=R){alert(He._({id:"ctFhjs",values:{maxMediaAttachments:R}}));return}if(A.length>0){b.preventDefault(),b.stopPropagation();let E=A;if(R!==void 0){const H=R-B.length;if(E=E.slice(0,H),E.length<=0){alert(He._({id:"ctFhjs",values:{maxMediaAttachments:R}}));return}}const P=E.map(H=>({file:H,type:H.type,size:H.size,url:URL.createObjectURL(H),id:null,description:null}));te([...B,...P])}};window.addEventListener("paste",a);const c=b=>{b.dataTransfer.items.length>0&&(b.preventDefault(),b.stopPropagation())};return window.addEventListener("dragover",c),window.addEventListener("drop",a),()=>{window.removeEventListener("paste",a),window.removeEventListener("dragover",c),window.removeEventListener("drop",a)}},[B]);const[Dt,mt]=I(!1),[gt,Be]=I(!1),[Si,Ze]=I(!1),[Oe,Li]=I(null),[zi,_i]=De(()=>{const a=[],c=[],{contentTranslationHideLanguages:b=[]}=X.settings;return Ct.forEach(v=>{const[A]=v;A===z||A===ge.current||A===Te||b.includes(A)||Oe?.length&&Oe.includes(A)?a.push(v):c.push(v)}),a.sort(([v,A],[F,E])=>v===z?-1:F===z?1:A.localeCompare(E)),c.sort(([v,A],[F,E])=>A.localeCompare(E)),[a,c]},[z,Oe]),Rt=De(()=>!!t?.createdAt&&Math.floor((Date.now()-Date.parse(t.createdAt))/(1e3*60*60*24*30)),[t]),Ti=()=>{pt(),X.composerState.minimized=!0},Ae=m==="loading"||R!==void 0&&B.length>=R||!!ee,jt=m==="loading"||!!re,$t=()=>{ve(!0),setTimeout(()=>{Q.current?.focus()},0)},Ot=ie==null||ie>1,Nt=m==="loading"||!!ee||!!B.length,Kt=()=>{be({options:["",""],expiresIn:24*60*60,multiple:!1}),setTimeout(()=>{Ye.current?.querySelector('.poll-choice input[type="text"]')?.focus()},0)},Ii=z!==ge.current||Oe?.length&&!Oe.includes(z),Mi=W!=="public",Bi=me!=="public",Ht=W==="private"||W==="direct",Qe=$(),[Pi,Di]=I(!0),Ri=42;fi({ref:Qe,box:"border-box",onResize:({width:a})=>{const{scrollWidth:c}=Qe.current,b=c>a,v=a<Ri*4;Di(v||b),Qe.current.hidden=v}});const qt=!n,Ut=m==="loading"||!!Fe,Vt=()=>{const a=new Date(Date.now()+ps);Ue(a)};return e("div",{id:"compose-container-outer",ref:Ye,children:[e("div",{id:"compose-container",tabIndex:-1,class:d?"standalone":"",children:[e("div",{class:"compose-top",children:[D?.avatarStatic&&e(bi,{account:D,accountInstance:L.instanceURL,hideDisplayName:!0,useAvatarStatic:!0}),d?u&&e("button",{type:"button",class:"light pop-button",disabled:m==="loading",onClick:()=>{if(!window.opener){alert(l({id:"qiPXgY"}));return}if(window.opener.__STATES__.showCompose){if(window.opener.__STATES__.composerState?.publishing){alert(l({id:"Z2l5Bt"}));return}let a=l({id:"AB/GtR"});if(!confirm(a))return}s({fn:()=>{const a={editStatus:n,replyToStatus:t,draftStatus:{uid:k.current,status:j.current.value,spoilerText:Q.current.value,visibility:W,language:z,sensitive:re,sensitiveMedia:K,poll:ee,mediaAttachments:B,scheduledAt:Fe},quoteStatus:ue};window.opener.__COMPOSE__=a,window.opener.__STATES__.showCompose?(window.opener.__STATES__.showCompose=!1,setTimeout(()=>{window.opener.__STATES__.showCompose=!0},10)):window.opener.__STATES__.showCompose=!0,window.opener.__STATES__.composerState.minimized&&(window.opener.__STATES__.composerState.minimized=!1)}})},children:e(S,{icon:"popin",alt:l({id:"/5ZKeE"})})}):e("span",{class:"compose-controls",children:[e("button",{type:"button",class:"plain4 pop-button",disabled:m==="loading",onClick:()=>{mn({editStatus:n,replyToStatus:t,draftStatus:{uid:k.current,status:j.current.value,spoilerText:Q.current.value,visibility:W,language:z,sensitive:re,poll:ee,mediaAttachments:B,scheduledAt:Fe},quoteStatus:ue})&&s()},children:e(S,{icon:"popout",alt:l({id:"JsU2En"})})}),e("button",{type:"button",class:"plain4 min-button",onClick:Ti,children:e(S,{icon:"minimize",alt:l({id:"3TSz9S"})})})," ",e("button",{type:"button",class:"plain4 close-button",disabled:m==="loading",onClick:()=>{ut()&&s()},children:e(S,{icon:"x",alt:l({id:"yz7wBu"})})})]})]}),!!t&&e("details",{class:"status-preview",open:!0,children:[e(nt,{status:t,size:"s",previewMode:!0}),e("summary",{class:"status-preview-legend reply-to",children:Rt>0?e(T,{id:"Q1Huya",values:{0:t.account.acct||t.account.username,1:C.format(-Rt,"month")},components:{0:e("strong",{})}}):e(T,{id:"dwLCPZ",values:{0:t.account.acct||t.account.username}})})]}),!!n&&e("details",{class:"status-preview",children:[e(nt,{status:n,size:"s",previewMode:!0}),e("summary",{class:"status-preview-legend",children:e(T,{id:"wKtOLH"})})]}),e("form",{ref:Tt,class:`form-visibility-${W}`,style:{pointerEvents:m==="loading"?"none":"auto",opacity:m==="loading"?.5:1},onClick:()=>{setTimeout(()=>{document.activeElement||We.current?.focus?.()},10)},onKeyDown:a=>{a.key==="Enter"&&(a.ctrlKey||a.metaKey)&&Tt.current.dispatchEvent(new Event("submit",{cancelable:!0}))},onSubmit:a=>{a.preventDefault();const c=new FormData(a.target),b=Object.fromEntries(c.entries());let{status:v,visibility:A,sensitive:F,sensitiveMedia:E,spoilerText:P,scheduledAt:H,quoteApprovalPolicy:ye}=b;if(F=F==="on",E=E==="on",H=H?new Date(H).toISOString():void 0,ee){if(ee.options.length<2){alert(l({id:"zhrMYj"}));return}if(ee.options.some(G=>G==="")){alert(l({id:"uNVxXX"}));return}}B.length>0&&B.some(de=>!de.description?.trim?.())&&!confirm(l({id:"MQYucx"}))||(P=F&&P||void 0,v=v===""?void 0:v,X.composerState.publishing=!0,M("loading"),(async()=>{try{if(B.length>0){const ze=B.map(xe=>{const{file:ji,description:$i,id:Oi}=xe;if(Oi)return xe;{const Ni=di({file:ji,description:$i});return f.v2.media.create(Ni).then(ft=>(ft.id&&(xe.id=ft.id),ft))}}),Wt=await Promise.allSettled(ze);if(Wt.some(xe=>xe.status==="rejected"||!xe.value?.id)){X.composerState.publishing=!1,X.composerState.publishingError=!0,M("error"),Wt.forEach(xe=>{xe.status==="rejected"&&alert(xe.reason||l({id:"eIiurD",values:{i}}))});return}}let G={status:v,spoiler_text:P,language:z,sensitive:F||E,poll:ee,media_ids:B.map(ze=>ze.id)};n?(Pe()&&(G.quote_approval_policy=ye),tt("@mastodon/edit-media-attributes")&&(G.media_attributes=B.map(ze=>({id:ze.id,description:ze.description})))):(Pe()&&ue?.id&&(G.quoted_status_id=ue.id,G.quote_approval_policy=ye),G.visibility=A,G.in_reply_to_id=t?.id||void 0,G.scheduled_at=H),G=di(G);let de;if(n)de=await f.v1.statuses.$select(n.id).update(G),Ji(de,w,{skipThreading:!0});else try{de=await f.v1.statuses.create(G,{requestInit:{headers:{"Idempotency-Key":k.current}}})}catch{de=await f.v1.statuses.create(G)}X.composerState.minimized=!1,X.composerState.publishing=!1,M("default"),s({type:n?"edit":t?"reply":"post",newStatus:de,instance:w,scheduledAt:H})}catch(G){X.composerState.publishing=!1,X.composerState.publishingError=!0,alert(G?.reason||G),M("error")}})())},children:[e("div",{children:[e("div",{class:`compose-cw-container ${re?"":"collapsed"}`,children:[e("input",{type:"hidden",name:"sensitive",value:re?"on":"off"}),e(Lt,{keys:":",class:"spoiler-text-field-container",onTrigger:a=>{a?.name==="custom-emojis"&&Be({targetElement:Q,defaultSearchTerm:a?.defaultSearchTerm||null})},children:e("input",{ref:Q,type:"text",name:"spoilerText",placeholder:l({id:"gnKo7f"}),"data-allow-custom-emoji":"true",disabled:m==="loading",class:"spoiler-text-field",lang:z,spellCheck:"true",autocomplete:"off",dir:"auto",onInput:()=>{dt()}})}),e("button",{type:"button",class:"close-button plain4 small",onClick:()=>{ve(!1),j.current.focus()},children:e(S,{icon:"x",alt:l({id:"dEgA5A"})})})]}),e(Zn,{ref:j,"data-allow-custom-emoji":"true",placeholder:l(t?{id:"Sjj+EN"}:n?{id:"qzVesX"}:ee?{id:"/fY1js"}:{id:"owpNF1"}),required:B?.length===0,disabled:m==="loading",lang:z,onInput:()=>{dt()},maxCharacters:_,onTrigger:a=>{a?.name==="custom-emojis"?Be({targetElement:Ge,defaultSearchTerm:a?.defaultSearchTerm||null}):a?.name==="mention"?mt({defaultSearchTerm:a?.defaultSearchTerm||null}):a?.name==="auto-detect-language"&&a?.languages?Li(a.languages):a?.name==="pasted-link"&&a?.url&&Ai(a.url)}})]}),B?.length>0&&e("div",{class:"media-attachments",children:[B.map((a,c)=>{const{id:b,file:v}=a,A=v?.size+v?.type+v?.name;return e(ss,{attachment:a,disabled:m==="loading",lang:z,supportedMimeTypes:O,descriptionLimit:he,onDescriptionChange:F=>{te(E=>{const P=[...E];return P[c]={...P[c],description:F},P})},onRemove:()=>{te(F=>F.filter((E,P)=>P!==c))}},b||A||c)}),e("label",{class:"media-sensitive",children:[e("input",{name:"sensitiveMedia",type:"checkbox",checked:K,disabled:m==="loading",onChange:a=>{const c=a.target.checked;Y(c)}})," ",e("span",{children:e(T,{id:"jER18a"})})," ",e(S,{icon:`eye-${K?"close":"open"}`})]})]}),!!ee&&e(Nn,{lang:z,maxOptions:ie,maxExpiration:ke,minExpiration:Ee,maxCharactersPerOption:U,poll:ee,disabled:m==="loading",onInput:a=>{if(a){const c={...a};be(c)}else be(null),$e()}}),!!ue?.id&&e("div",{class:"quote-status",children:e(nt,{status:ue,instance:w,size:"s",readOnly:!0})}),Fe&&e("div",{class:"toolbar scheduled-at",children:[e("span",{children:[e("label",{children:e(T,{id:"GKuKcZ",components:{0:e(gn,{scheduledAt:Fe,setScheduledAt:Ue})}})})," ",e("small",{class:"tag insignificant",children:fn()})]}),e("button",{type:"button",class:"plain4 close-button small",onClick:()=>{Ue(null),$e()},children:e(S,{icon:"x",alt:l({id:"dEgA5A"})})})]}),e(os,{quoteSuggestion:Ve,hasCurrentQuoteStatus:!!ue?.id,onAccept:()=>{const{status:a}=Ve,c=j.current?.value||"",b=j.current?.selectionStart||0,v=c.lastIndexOf(Ve.url,b),A=c.slice(0,v)+c.slice(v+Ve.url.length);j.current&&(j.current.value=A,j.current.dispatchEvent(new Event("input"))),!!ue?.id?(je(null),rt(a)):document.startViewTransition?document.startViewTransition(()=>{je(null),rt(a)}):(je(null),rt(a)),Me()},onCancel:()=>je(null)}),e("div",{class:"toolbar compose-footer",children:[e("span",{class:"add-toolbar-button-group spacer",children:[Pi&&e(vi,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},menuButton:({open:a})=>e("button",{type:"button",class:`toolbar-button add-button ${a?"active":""}`,children:e(S,{icon:"plus",title:l({id:"m16xKo"})})}),children:[ei&&e(we,{disabled:Ae,className:"compose-menu-add-media",children:[e("label",{class:"compose-menu-add-media-field",children:e(Jt,{hidden:!0,supportedMimeTypes:pe,disabled:Ae,setMediaAttachments:te})}),e(S,{icon:"camera"})," ",e("span",{children:h(ae.camera)})]}),e(we,{disabled:Ae,className:"compose-menu-add-media",children:[e("label",{class:"compose-menu-add-media-field",children:e(ri,{hidden:!0,supportedMimeTypes:O,maxMediaAttachments:R,mediaAttachments:B,disabled:Ae,setMediaAttachments:te})}),e(S,{icon:"media"})," ",e("span",{children:h(ae.media)})]}),e(we,{disabled:jt,onClick:$t,children:[e(S,{icon:`eye-${re?"close":"open"}`})," ",e("span",{children:h(ae.sensitive)})]}),Ot&&e(we,{disabled:Nt,onClick:Kt,children:[e(S,{icon:"poll"})," ",e("span",{children:h(ae.poll)})]}),e(Zt,{}),e(we,{onClick:()=>{Be({targetElement:Ge})},children:[e(S,{icon:"emoji2"})," ",e("span",{children:h(ae.customEmoji)})]}),!!X.settings.composerGIFPicker&&e(we,{disabled:Ae,onClick:()=>{Ze(!0)},children:[e("span",{class:"icon icon-gif",role:"img"}),e("span",{children:h(ae.gif)})]}),qt&&e(Re,{children:[e(Zt,{}),e(we,{disabled:Ut,onClick:Vt,children:[e(S,{icon:"schedule"})," ",e("span",{children:h(ae.scheduledPost)})]})]})]}),e("span",{class:"add-sub-toolbar-button-group",ref:Qe,hidden:!0,children:[ei&&e("label",{class:"toolbar-button",children:[e(Jt,{supportedMimeTypes:pe,mediaAttachments:B,disabled:Ae,setMediaAttachments:te}),e(S,{icon:"camera",alt:h(ae.camera)})]}),e("label",{class:"toolbar-button",children:[e(ri,{supportedMimeTypes:O,maxMediaAttachments:R,mediaAttachments:B,disabled:Ae,setMediaAttachments:te}),e(S,{icon:"media",alt:h(ae.media)})]}),e("button",{type:"button",class:"toolbar-button",disabled:jt,onClick:$t,children:e(S,{icon:`eye-${re?"close":"open"}`,alt:h(ae.sensitive)})}),Ot&&e("button",{type:"button",class:"toolbar-button",disabled:Nt,onClick:Kt,children:e(S,{icon:"poll",alt:h(ae.poll)})}),e("div",{class:"toolbar-divider"}),e("button",{type:"button",class:"toolbar-button",disabled:m==="loading",onClick:()=>{Be({targetElement:Ge})},children:e(S,{icon:"emoji2",alt:h(ae.customEmoji)})}),!!X.settings.composerGIFPicker&&e("button",{type:"button",class:"toolbar-button gif-picker-button",disabled:Ae,onClick:()=>{Ze(!0)},children:e("span",{class:"icon icon-gif","aria-label":h(ae.gif)})}),qt&&e(Re,{children:[e("div",{class:"toolbar-divider"}),e("button",{type:"button",class:`toolbar-button ${Fe?"highlight":""}`,disabled:Ut,onClick:Vt,children:e(S,{icon:"schedule",alt:h(ae.scheduledPost)})})]})]})]}),m==="loading"?e(at,{abrupt:!0}):e(An,{maxCharacters:_,hidden:m==="loading"}),Pe()&&e("label",{class:`toolbar-button ${Bi?"highlight":""}`,children:[e(S,{icon:"quote2",alt:"Quote settings"}),me==="followers"&&e(S,{icon:"group",class:"insignificant"}),me==="nobody"&&e(S,{icon:"block",class:"insignificant"}),e("select",{name:"quoteApprovalPolicy",value:me,onChange:a=>{ce(a.target.value)},disabled:m==="loading",dir:"auto",children:[e("option",{value:"public",disabled:Ht,children:e(T,{id:"hDWXuG"})}),e("option",{value:"followers",disabled:Ht,children:e(T,{id:"9Ko+Xp"})}),e("option",{value:"nobody",children:e(T,{id:"+bAQ3S"})})]})]}),e("label",{class:`toolbar-button ${Mi?"highlight":""}`,title:h(bt[W]),children:[W==="public"||W==="direct"?e(S,{icon:vn[W],alt:h(bt[W])}):e("span",{class:"icon-text",children:h(bt[W])}),e("select",{name:"visibility",value:W,onChange:a=>{le(a.target.value),(a.target.value==="private"||a.target.value==="direct")&&ce("nobody")},disabled:m==="loading"||!!n,dir:"auto",children:[e("option",{value:"public",children:e(T,{id:"7d1a0d"})}),(tt("@pleroma/local-visibility-post")||tt("@akkoma/local-visibility-post"))&&e("option",{value:"local",children:e(T,{id:"d5zxa4"})}),e("option",{value:"unlisted",children:e(T,{id:"pPYeIN"})}),e("option",{value:"private",children:e(T,{id:"x5LEuB"})}),e("option",{value:"direct",children:e(T,{id:"IV4QaU"})})]})]})," ",e("label",{class:`toolbar-button ${Ii?"highlight":""}`,children:[e("span",{class:"icon-text",children:rs[z]?.native}),e("select",{name:"language",value:z,onChange:a=>{const{value:c}=a.target;ne(c||Te),fe.session.set("currentLanguage",c||Te)},disabled:m==="loading",dir:"auto",children:[zi.map(([a,c,b])=>{const v=Et({code:a,fallback:c});return e("option",{value:a,children:v!==b?`${b} - ${v}`:v},a)}),e("hr",{}),_i.map(([a,c,b])=>{const v=Et({code:a,fallback:c});return e("option",{value:a,children:v!==b?`${b} - ${v}`:v},a)})]})]})," ",e("button",{type:"submit",disabled:m==="loading",children:l(Fe?{id:"gmB6oO"}:t?{id:"ImOQa9"}:n?{id:"EkH9pt"}:{id:"GMe2XV"})})]})]})]}),Dt&&e(it,{onClose:()=>{mt(!1),$e()},children:e(as,{masto:f,instance:w,onClose:()=>{mt(!1)},defaultSearchTerm:Dt?.defaultSearchTerm,onSelect:a=>{const c=j.current;c&&zt({targetElement:c,text:"@"+a})}})}),gt&&e(it,{onClose:()=>{Be(!1),$e()},children:e(Xn,{masto:f,instance:w,onClose:()=>{Be(!1)},defaultSearchTerm:gt?.defaultSearchTerm,onSelect:a=>{const c=gt?.targetElement?.current||j.current;c&&zt({targetElement:c,text:a})}})}),Si&&e(it,{onClose:()=>{Ze(!1),$e()},children:e(is,{onClose:()=>Ze(!1),onSelect:({url:a,type:c,alt_text:b})=>{if(B.length>=R){alert(He._({id:"ctFhjs",values:{maxMediaAttachments:R}}));return}(async()=>{let v;try{v=Ie({text:l({id:"/Cw4Tx"}),duration:-1});const A=await fetch(a,{referrerPolicy:"no-referrer"}).then(P=>P.blob()),F=new File([A],c==="video/mp4"?"video.mp4":"image.gif",{type:c}),E=[...B,{file:F,type:c,size:F.size,id:null,description:b||""}];te(E),v?.hideToast?.()}catch{v?.hideToast?.(),Ie(l({id:"VKDnAx"}))}})()}})})]})}function di(s){for(let t in s)(s[t]===null||s[t]===void 0)&&delete s[t];return s}export{bs as default};
|
||
//# sourceMappingURL=compose-DPEmvLj7.js.map
|