import{e,c as ti,s as J,p as Ai,u as ke,A as R,a as mt,V as Si,y as q,S as ii,T as O,a8 as Li,d as D,M as ni,k as Le,l as De,n as Me,q as Ke,z as Ge,E as Ie,aQ as si,G as zi,$ as Ti,R as _i,t as Ii,F as Mi,aR as Bi,b as Di}from"./useTitle-Ck4QBWzz.js";import{a7 as Ri,O as Pi,a3 as ji,y as $i,D as Oi,x as Fe,ah as at,ai as Rt,Y as Ni,_ as Ye,I as T,q as qe,p as He,s as Ae,g as We,h as ai,e as fe,l as ht,r as Ki,w as Be,t as oi,aj as Hi,ak as Ui,a1 as qi,al as Wi,F as Pt,u as Vi,am as Gi,a as Yi,G as jt,a9 as Zi,a8 as Xi,d as $t,an as Ji,ao as ot}from"./ScheduledAtField-CQDO0gVJ.js";function Qi({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 en=Qi();function tn(s){if(typeof s!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof s}\``);return s.replace(en,"")}const nn=new Intl.Segmenter;function Ot(s,{countAnsiEscapeCodes:t=!1}={}){if(s===""||(t||(s=tn(s)),s===""))return 0;let n=0;for(const a of nn.segment(s))n++;return n}const gt=[["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","ⵜⴰⵎⴰⵣⵉⵖⵜ"]],sn="(((?:[^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\\-_&=#\\/])?))",an="gi",Nt={source:sn,flags:an},ri=new RegExp(Nt.source,Nt.flags),on=/iPad|iPhone|iPod/.test(navigator.userAgent)&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Kt({hidden:s,disabled:t=!1,supportedMimeTypes:n,setMediaAttachments:a}){const r=on?n:n?.filter(u=>!/^image\//i.test(u));return e("input",{type:"file",hidden:s,accept:r?.join(","),capture:"environment",disabled:t,onChange:u=>{const c=u.target.files;if(!c)return;const l=Array.from(c)[0];l&&(a(p=>[...p,{file:l,type:l.type,size:l.size,url:URL.createObjectURL(l),id:null,description:null}]),u.target.value=null)}})}const Ht="capture"in document.createElement("input");function rn({maxCharacters:s=500,hidden:t}){const a=ti(J).composerCharacterCount,r=s-a;return t?e("span",{class:"char-counter",hidden:!0}):e("span",{class:"char-counter",title:`${r}/${s}`,style:{"--percentage":a/s*100},children:[e("meter",{class:`${r<=-10?"explode":r<=0?"danger":r<=20?"warning":""}`,value:a,max:s}),e("span",{class:"counter",children:r})]})}class ln{constructor(t,n,{tabInsertsSuggestions:a,defaultFirstOption:r}={}){this.input=t,this.list=n,this.tabInsertsSuggestions=a??!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=u=>cn(u,this),this.compositionEventHandler=u=>dn(u,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",Ut),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",Ut)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(rt)[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(rt)[0],a=Array.from(this.list.querySelectorAll('[role="option"]')).filter(rt),r=a.indexOf(n);if(r===a.length-1&&t===1||r===0&&t===-1){this.clearSelection(),this.input.focus();return}let u=t===1?0:a.length-1;if(n&&r>=0){const l=r+t;l>=0&&l0||s.offsetHeight>0)}function dn(s,t){t.isComposing=s.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function hn(s,t){pn(s,t)||(s.scrollTop=t.offsetTop)}function pn(s,t){const n=s.scrollTop,a=n+s.clientHeight,r=t.offsetTop,u=r+t.clientHeight;return r>=n&&u<=a}const mn=/\s|\(|\[/;function gn(s,t,n,{multiWord:a,lookBackIndex:r,lastMatchPosition:u}={multiWord:!1,lookBackIndex:0,lastMatchPosition:null}){let c=s.lastIndexOf(t,n-1);if(c===-1||c=c+t.length+1||s.lastIndexOf(` `,n-1)>c||s.lastIndexOf(".",n-1)>c)return}else if(s.lastIndexOf(" ",n-1)>c)return;const l=s[c-1];return l&&!mn.test(l)?void 0:{text:s.substring(c+t.length,n),position:c+t.length}}class fn extends Event{constructor(){super("update")}}const lt=new WeakMap;class ft 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=lt.get(t);return n||(n=new ft(t),lt.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}),lt.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 a=t.getBoundingClientRect(),r=this.#e.getBoundingClientRect();this.#l=this.#l+a.left-r.left,this.#c=this.#c+a.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 fn)})}#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 a of vn)this.#e.style[a]=n[a];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 vn=["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 Ve{#t;#s;#a;constructor(t,n=0,a=n){this.#t=t,this.#s=n,this.#a=a}static fromSelection(t){const{selectionStart:n,selectionEnd:a}=t;return new Ve(t,n??void 0,a??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 Ve(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 ft.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 Ue=new WeakMap;let bn=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 a,r;this.input!==document.activeElement&&this.input!==((r=(a=document.activeElement)===null||a===void 0?void 0:a.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 ln(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 a=new Ve(this.input,n).getBoundingClientRect(),r={left:a.left,top:a.top+a.height},u=t.getBoundingClientRect(),c={left:r.left-u.left,top:r.top-u.top};if(c.left!==0||c.top!==0){const l=getComputedStyle(t);t.style.left=l.left?`calc(${l.left} + ${c.left}px)`:`${c.left}px`,t.style.top=l.top?`calc(${l.top} + ${c.top}px)`:`${c.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 a=t;if(!(a instanceof HTMLElement)||!this.combobox)return;const r=this.match;if(!r)return;const u=this.input.value.substring(0,r.position-r.key.length),c=this.input.value.substring(r.position+r.text.length),l={item:a,key:r.key,value:null,continue:!1};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:l}))||!l.value)return;let g=(n=this.expander.getAttribute("suffix"))!==null&&n!==void 0?n:" ";l.continue&&(g="");const S=`${l.value}${g}`;this.input.value=u+S+c;const A=u.length+S.length;this.deactivate(),this.input.focus({preventScroll:!0}),this.input.selectionStart=A,this.input.selectionEnd=A,l.continue||(this.lookBackIndex=A,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:a,multiWord:r}of this.expander.keys){const u=gn(n,a,t,{multiWord:r,lookBackIndex:this.lookBackIndex,lastMatchPosition:this.match?this.match.position:null});if(u)return{text:u.text,key:a,position:u.position}}}async notifyProviders(t){const n=[],a=p=>n.push(p),r=new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:a,text:t.text,key:t.key}});return this.expander.dispatchEvent(r)?(await Promise.all(n)).filter(p=>p.matched).map(p=>p.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 Wt extends HTMLElement{get keys(){const t=this.getAttribute("keys"),n=t?t.split(" "):[],a=this.getAttribute("multiword"),r=a?a.split(" "):[],u=r.length===0&&this.hasAttribute("multiword");return n.map(c=>({key:c,multiWord:u||r.includes(c)}))}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 bn(this,t);Ue.set(this,n)}disconnectedCallback(){const t=Ue.get(this);t&&(t.destroy(),Ue.delete(this))}dismiss(){const t=Ue.get(this);t&&t.dismissMenu()}}window.customElements.get("text-expander")||(window.TextExpanderElement=Wt,window.customElements.define("text-expander",Wt));async function yn(s,t){const a=(await t.v1.customEmojis.list()).filter(u=>u.visibleInPicker),r=new Ri(a,{keys:["shortcode"],findAllMatches:!0});return[a,r]}const li=Ai(yn,{matchesArg:(s,t)=>s.instance===t.instance,maxAge:30*60*1e3}),we=document.createElement("ul");we.role="listbox";we.className="text-expander-menu";const xn=16,wn=new IntersectionObserver(s=>{s.forEach(t=>{if(t.isIntersecting){const{left:n,width:a}=t.boundingClientRect,{innerWidth:r}=window;if(n+a>r){const u=Pi()?"right":"left";we.style[u]=r-a-xn+"px"}}})});wn.observe(we);function xe(s){return s.replace(/[&<>"']/g,function(t){return"&#"+t.charCodeAt(0)+";"})}function kn({onTrigger:s=null,...t},n){const{_:a}=ke(),r=R(),{masto:u,instance:c}=mt(),l=R(),p=R(""),g=R(!1);return Si(n,()=>({setStyle:S=>{r.current&&Object.assign(r.current.style,S)},activated:()=>g.current})),q(()=>{l.current||li(c,u).then(([,S])=>{l.current=S}).catch(S=>{})},[c,u]),q(()=>{const S=r.current;if(!S)return;const A=L=>{const{key:E,provide:j,text:d}=L.detail;if(p.current=d,d===""){j(Promise.resolve({matched:!1}));return}if(E===":"){const Q=!!s,H=l.current?.search(d,{limit:5});let U="";H?.forEach(({item:w})=>{const{shortcode:k,url:M}=w;U+=`
  • ${xe(k)}
  • `}),Q&&(U+=`
  • More…
  • `),we.innerHTML=U,j(Promise.resolve({matched:(H?.length||0)>0,fragment:we}));return}const x={"@":"accounts","#":"hashtags"}[E];if(x){j(new Promise(async Q=>{try{let H;if(x==="accounts")H=await u.v1.accounts.search.list({q:d,limit:5,resolve:!1});else{const k=await u.v2.search.list({type:x,q:d,limit:5});H=k[x]||k}if(d!==p.current)return;const U=H;let w="";U.forEach(k=>{const{name:M,avatarStatic:V,displayName:ee,username:le,acct:W,emojis:re,history:ve,roles:he,url:P}=k,Y=ji(ee,re),X=$i(P);if(W)w+=`
  • ${Y||le}
    @${xe(W)} ${he?.map(te=>` `)||""}
  • `;else{const te=ve?.reduce?.((ae,ce)=>ae+ +ce.uses,0);w+=`
  • #${xe(M)} ${te?`${Oi(te)}`:""}
  • `}}),x==="accounts"&&(w+=`
  • ${a({id:"24misb"})}
  • `),we.innerHTML=w,Q({matched:U.length>0,fragment:we})}catch{Q({matched:!1})}}));return}j(Promise.resolve({matched:!1}))},v=L=>{const{key:E,item:j}=L.detail,{value:d,more:x}=j.dataset;E===":"?(L.detail.value=d?`:${d}:`:"​",x&&(L.detail.continue=!0,setTimeout(()=>{s?.({name:"custom-emojis",defaultSearchTerm:x})},300))):E==="@"?(L.detail.value=d?`@${d}`:"​",x&&(L.detail.continue=!0,setTimeout(()=>{s?.({name:"mention",defaultSearchTerm:x})},300))):L.detail.value=`${E}${d}`},m=L=>{const{input:E}=L.detail;if(E){const j=new Event("input",{bubbles:!0});E.dispatchEvent(j)}},f=()=>{g.current=!0},I=()=>{g.current=!1};return S.addEventListener("text-expander-change",A),S.addEventListener("text-expander-value",v),S.addEventListener("text-expander-committed",m),S.addEventListener("text-expander-activate",f),S.addEventListener("text-expander-deactivate",I),()=>{S.removeEventListener("text-expander-change",A),S.removeEventListener("text-expander-value",v),S.removeEventListener("text-expander-committed",m),S.removeEventListener("text-expander-activate",f),S.removeEventListener("text-expander-deactivate",I)}},[l.current,s,a,u]),e("text-expander",{ref:r,...t})}const vt=ii(kn),ci={300:Fe(5,"minute"),1800:Fe(30,"minute"),3600:Fe(1,"hour"),21600:Fe(6,"hour"),86400:Fe(1,"day"),259200:Fe(3,"day"),604800:Fe(1,"week")};function En({lang:s,poll:t,disabled:n,onInput:a=()=>{},maxOptions:r,maxExpiration:u,minExpiration:c,maxCharactersPerOption:l}){const{_:p}=ke(),{options:g,expiresIn:S,multiple:A}=t;return e("div",{class:`poll ${A?"multiple":""}`,children:[e("div",{class:"poll-choices",children:g.map((v,m)=>e("div",{class:"poll-choice",children:[e(vt,{keys:":",class:"poll-field-container",children:e("input",{required:!0,type:"text",value:v,disabled:n,maxlength:l,placeholder:p({id:"LDUSXg",values:{0:m+1}}),lang:s,spellCheck:"true",autocomplete:"off",dir:"auto","data-allow-custom-emoji":"true",onInput:f=>{const{value:I}=f.target;g[m]=I,a(t)}})}),e("button",{type:"button",class:"plain4 poll-button",disabled:n||g.length<=1,onClick:()=>{g.splice(m,1),a(t)},title:p({id:"t/YqKh"}),children:"−"})]},m))}),e("div",{class:"poll-toolbar",children:[e("button",{type:"button",class:"plain2 poll-button",disabled:n||g.length>=r,onClick:()=>{g.push(""),a(t)},title:p({id:"m16xKo"}),children:"+"})," ",e("div",{class:"poll-config",children:[e("label",{class:"multiple-choices",children:[e("input",{type:"checkbox",checked:A,disabled:n,onChange:v=>{const{checked:m}=v.target;t.multiple=m,a(t)}})," ",e(O,{id:"zytZXj"})]}),e("label",{class:"expires-in",children:[e(O,{id:"lkz6PL"})," ",e("select",{value:S,disabled:n,onChange:v=>{const{value:m}=v.target;t.expiresIn=m,a(t)},children:Object.entries(ci).filter(([v])=>v>=c&&v<=u).map(([v,m])=>e("option",{value:v,children:m()},v))})]}),e("div",{class:"spacer"}),e("button",{type:"button",class:"light danger small",disabled:n,onClick:()=>{a(null)},children:e(O,{id:"CDpQAX"})})]})]})]})}const Fn=/[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i,Cn=new RegExp(`(^|[^=\\/\\w])(@${Fn.source}(?:@[\\p{L}\\w.-]+[\\w]+)?)`,"uig"),An=new RegExp("(^|[^=\\/\\w])(#[\\p{L}\\p{N}_]+([\\p{L}\\p{N}_.]+[\\p{L}\\p{N}_]+)?)(?![\\/\\w])","iug"),Sn="[a-zA-Z0-9_]{2,}",Ln=new RegExp(`(^|[^=\\/\\w])(:${Sn}:)(?=[^A-Za-z0-9_:]|$)`,"g"),zn=new Intl.Segmenter;function Tn(s,{maxCharacters:t=1/0}){const{composerCharacterCount:n}=J;if(n>t){let a="",r="";const u=zn.segment(s);for(const{segment:c,index:l}of u)l"),at(a)+r}return at(s).replace(ri,'$2$3').replace(Cn,'$1$2').replace(An,'$1$2').replace(Ln,'$1$2')}function Vt(s){if(!s)return;const{value:t,offsetHeight:n,scrollHeight:a,clientHeight:r}=s;if(n{if(Rt){const a=await Rt.detect(s);if(a?.length)return a.slice(0,2).map(r=>r.detectedLanguage)}const{detectAll:t}=await Li(async()=>{const{detectAll:a}=await import("./tinyld.light.node-D9KYf3Y3.js");return{detectAll:a}},[],import.meta.url),n=t(s);return n?.length?n.slice(0,2).map(a=>a.lang):null},In=ii((s,t)=>{const[n,a]=D(t.current?.value||""),{maxCharacters:r,onTrigger:u=null,...c}=s,l=R();q(()=>{const v=t.current;if(!v)return;new ResizeObserver(()=>{if(l.current){const{height:f}=v.getBoundingClientRect();f&&l.current.setStyle({minHeight:f+"px"})}}).observe(v)},[]);const p=R(0),g=R(),S=Ni(v=>{if(!g.current)return;if(p.current>3){g.current.innerHTML="",g.current=null,S?.cancel?.();return}let m,f;p.current<=3&&(m=Date.now()),g.current.innerHTML=Tn(v,{maxCharacters:r})+` `,p.current<=3&&(f=Date.now()),m&&f&&f-m>50&&p.current++},500),A=Ye(()=>{const v=g.current?.cloneNode(!0);if(!v)return;v.querySelectorAll("mark").forEach(f=>{f.remove()});const m=v.innerText?.trim();m&&(async()=>{const f=await _n(m);f?.length&&u?.({name:"auto-detect-language",languages:f})})()},2e3);return e(vt,{ref:l,keys:"@ # :",class:"compose-field-container",onTrigger:u,children:[e("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...c,ref:t,name:"status",value:n,onKeyDown:v=>{const{key:m,target:f}=v,I=l.current?.activated();if(m==="Enter"&&!(v.ctrlKey||v.metaKey||I)&&!v.isComposing)try{const{value:L,selectionStart:E}=f,d=L.slice(0,E).split(` `).slice(-1)[0];if(d&&/^\s*(-|\d+\.)\s/.test(d)){const[x,Q,H,U,w]=d.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(w){v.preventDefault();const[k]=H.match(/\d+/)||[],M=k?`${+k+1}.`:"-",V=` ${Q}${M}${U}`;f.setRangeText(V,E,E);const ee=E+V.length;f.setSelectionRange(ee,ee)}else{const k=E-d.length;f.setRangeText("",k,E)}Vt(f),f.dispatchEvent(new Event("input"))}}catch{}g.current&&(g.current.scrollTop=f.scrollTop)},onInput:v=>{const{target:m}=v,f=m.value;a(f),Vt(m),s.onInput?.(v),S(f),A()},onScroll:v=>{if(g.current){const{scrollTop:m}=v.target;g.current.scrollTop=m}}}),e("div",{ref:g,class:"compose-highlight","aria-hidden":"true"})]})}),pt=100,ct=1,Gt=2,Yt=.5,ui=ni(({emoji:s,onClick:t,showCode:n})=>{const a=r=>{const c=r.currentTarget.closest("main");if(c){const l=c.getBoundingClientRect(),p=r.currentTarget.getBoundingClientRect(),g=r.currentTarget.classList;p.leftl.right-88?(g.add("edge-right"),g.remove("edge-left")):g.remove("edge-left","edge-right")}};return e("button",{type:"button",className:"plain4",onClick:t,"data-title":n?void 0:s.shortcode,onPointerEnter:a,onFocus:a,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(Le,{children:[" ",e("code",{children:s.shortcode})]})]})}),Mn=ni(({emojis:s,onSelect:t})=>{const{i18n:n}=ke(),[a,r]=D(pt),u=s.length>a;return e("section",{children:[s.slice(0,a).map(c=>e(ui,{emoji:c,onClick:()=>{t(`:${c.shortcode}:`)}},c.shortcode)),u&&e("button",{type:"button",class:"plain small",onClick:()=>r(a+pt),children:e(O,{id:"iAB71E",values:{0:n.number(s.length-a)}})})]})});function Bn({masto:s,instance:t,onClose:n=()=>{},onSelect:a=()=>{},defaultSearchTerm:r}){const{_:u}=ke(),[c,l]=D("default"),p=R([]),[g,S]=D([]),A=De(()=>Me.account.get("recentlyUsedCustomEmojis")||[]),v=R();q(()=>{l("loading"),(async()=>{try{const[w,k]=await li(t,s);v.current=k,S(w),l("default")}catch{l("error")}})()},[]);const m=De(()=>{const w={"--recent--":A.filter(M=>g.find(V=>V.shortcode===M.shortcode))},k=[];return g.forEach(M=>{if(p.current?.push?.(M),!M.category){k.push(M);return}w[M.category]||(w[M.category]=[]),w[M.category].push(M)}),k.length&&(w["--others--"]=k),w},[g]),f=R(),[I,L]=D(null),[E,j]=D(ct),d=Ke(()=>{const w=Math.max(ct,E-Yt);j(w)},[E]),x=Ke(()=>{const w=Math.min(Gt,E+Yt);j(w)},[E]),Q=Ke(w=>{const{value:k}=w.target;if(k){const M=v.current?.search(k,{limit:pt});L(M.map(V=>V.item)),f.current?.scrollTo?.(0,0)}else L(null)},[g]);q(()=>{r&&g?.length&&Q({target:{value:r}})},[r,Q,g]);const H=Ke(w=>{a?.(w),n?.(),queueMicrotask(()=>{let k=Me.account.get("recentlyUsedCustomEmojis")||[];const M=k.findIndex(V=>V.shortcode===w.shortcode);M!==-1?(k.splice(M,1),k.unshift(w)):(k.unshift(w),k=k.filter(V=>p.current?.find?.(ee=>ee.shortcode===V.shortcode)),k=k.slice(0,10)),Me.account.set("recentlyUsedCustomEmojis",k)})},[a]),U=R();return q(()=>{U.current&&(U.current.focus(),U.current.value&&(U.current.selectionStart=U.current.value.length,U.current.selectionEnd=U.current.value.length))},[]),e("div",{id:"custom-emojis-sheet",class:"sheet",style:{"--custom-emoji-size":E},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:u({id:"yz7wBu"})})}),e("header",{children:[e("div",{children:[e("b",{children:e(O,{id:"8i6Ueo"})})," ",c==="loading"?e(Ge,{}):e("small",{class:"insignificant",children:[" • ",t]})]}),e("form",{onSubmit:w=>{w.preventDefault();const k=I[0];k&&H(`:${k.shortcode}:`)},children:e("input",{ref:U,type:"search",placeholder:u({id:"EarrCe"}),onInput:Q,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",defaultValue:r||""})})]}),e("main",{ref:f,children:[I!==null?e("ul",{class:"custom-emojis-matches custom-emojis-list",children:I.map(w=>e("li",{class:"custom-emojis-match",children:e(ui,{emoji:w,onClick:()=>{H(`:${w.shortcode}:`)},showCode:!0})},w.shortcode))}):e("div",{class:"custom-emojis-list",children:[c==="error"&&e("div",{class:"ui-state",children:e("p",{children:e(O,{id:"Kzwsg2"})})}),c==="default"&&Object.entries(m).map(([w,k])=>!!k?.length&&e("div",{class:"section-container",children:[e("div",{class:"section-header",children:{"--recent--":u({id:"uabU9X"}),"--others--":u({id:"NuKR0h"})}[w]||w}),e(Mn,{emojis:k,onSelect:H})]}))]}),e("div",{class:"size-range",children:[e("button",{type:"button",class:"plain4",onClick:d,disabled:E<=ct,children:e(T,{icon:"zoom-out",size:"l",alt:u({id:"FjkaiT"})})}),e("button",{type:"button",class:"plain4",onClick:x,disabled:E>=Gt,children:e(T,{icon:"zoom-in",size:"l",alt:u({id:"AWOSPo"})})})]})]})]})}function Zt({hidden:s,supportedMimeTypes:t,maxMediaAttachments:n,mediaAttachments:a,disabled:r=!1,setMediaAttachments:u}){return e("input",{type:"file",hidden:s,accept:t?.join(","),multiple:n===void 0||n-a>=2,disabled:r,onChange:c=>{const l=c.target.files;if(!l)return;const p=Array.from(l).map(g=>({file:g,type:g.type,size:g.size,url:URL.createObjectURL(g),id:null,description:null}));a.length+p.length>n?alert(Ie._({id:"ctFhjs",values:{maxMediaAttachments:n}})):u(g=>g.concat(p)),c.target.value=""}})}const Dn="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",Rn={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:Pn}=Rn,ut=20;function jn({onClose:s=()=>{},onSelect:t=()=>{}}){const{i18n:n,_:a}=ke(),[r,u]=D("default"),[c,l]=D([]),p=R(null),g=R(null),S=R(0),A=R(null);function v({offset:f}){g.current?.value&&(u("loading"),A.current?.scrollTo?.({top:0,left:0,behavior:"smooth"}),(async()=>{try{const I={api_key:Pn,q:g.current.value,rating:"g",limit:ut,bundle:"messaging_non_clips",offset:f,lang:n.locale||"en"},L=await fetch("https://api.giphy.com/v1/gifs/search?"+new URLSearchParams(I),{referrerPolicy:"no-referrer"}).then(E=>E.json());S.current=L.pagination?.offset||0,l(L),u("results")}catch{u("error")}})())}q(()=>{g.current?.focus()},[]);const m=Ye(()=>{v({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(T,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("form",{ref:p,onSubmit:f=>{f.preventDefault(),v({offset:0})},children:[e("input",{ref:g,type:"search",name:"q",placeholder:a({id:"wxlF9B"}),required:!0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",onInput:m}),e("input",{type:"image",class:"powered-button",src:Dn,width:"86",height:"30",alt:a({id:"c1Q/eU"})})]})}),e("main",{ref:A,class:r==="loading"?"loading":"",children:[r==="default"&&e("div",{class:"ui-state",children:e("p",{class:"insignificant",children:e(O,{id:"9KEidY"})})}),r==="loading"&&!c?.data?.length&&e("div",{class:"ui-state",children:e(Ge,{abrupt:!0})}),c?.data?.length>0?e(Le,{children:[e("ul",{children:c.data.map(f=>{const{id:I,images:L,title:E,alt_text:j}=f,{fixed_height_small:d,fixed_height_downsampled:x,fixed_height:Q,original:H}=L,U=d?.url?d:x?.url?x:Q;let{url:w,webp:k,width:M,height:V}=U;+V>100&&(M=M/V*100,V=100);const ee=URL.parse(w),le=ee.origin+ee.pathname;let W;if(k){const re=URL.parse(k);W=re.origin+re.pathname}return e("li",{children:e("button",{type:"button",onClick:()=>{const{mp4:re,url:ve}=H,he=re||ve,P=URL.parse(he),Y=P.origin+P.pathname;s(),t({url:Y,type:re?"video/mp4":"image/gif",alt_text:j||E})},children:e("figure",{style:{"--figure-width":M+"px"},children:[e("picture",{children:[W&&e("source",{srcset:W,type:"image/webp"}),e("img",{src:le,width:M,height:V,loading:"lazy",decoding:"async",alt:j,referrerpolicy:"no-referrer",onLoad:re=>{re.target.style.backgroundColor="transparent"}})]}),e("figcaption",{children:j||E})]})})},I)})}),e("p",{class:"pagination",children:[c.pagination?.offset>0&&e("button",{type:"button",class:"light small",disabled:r==="loading",onClick:()=>{v({offset:c.pagination?.offset-ut})},children:[e(T,{icon:"chevron-left"}),e("span",{children:e(O,{id:"DHhJ7s"})})]}),e("span",{}),c.pagination?.offset+c.pagination?.count{v({offset:c.pagination?.offset+ut})},children:[e("span",{children:e(O,{id:"hXzOVo"})})," ",e(T,{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(O,{id:"PbFw9n"})})})]})]})}const $n={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:dt}=$n;function Xt(s,t,n,a){const r=Math.sqrt(t/s),u=Math.floor(n*r),c=Math.floor(a*r);return{newWidth:u,newHeight:c}}function On({attachment:s,disabled:t,lang:n,descriptionLimit:a=1500,onDescriptionChange:r=()=>{},onRemove:u=()=>{}}){const{i18n:c,_:l}=ke(),[p,g]=D("default"),S=qe("@mastodon/edit-media-attributes"),{type:A,id:v,file:m}=s,f=De(()=>m?URL.createObjectURL(m):s.url,[m,s.url]),I=!!m?.size,L=I?si():{},{mediaAttachments:{imageSizeLimit:E,imageMatrixLimit:j,videoSizeLimit:d,videoMatrixLimit:x,videoFrameRateLimit:Q}={}}=L||{},[H,U]=D(()=>I?A.startsWith("image")&&E&&m.size>E?{type:"imageSizeLimit",details:{imageSize:m.size,imageSizeLimit:E}}:A.startsWith("video")&&d&&m.size>d?{type:"videoSizeLimit",details:{videoSize:m.size,videoSizeLimit:d}}:null:null),[w,k]=D({});q(()=>{!I||!j||w?.matrix>j&&U({type:"imageMatrixLimit",details:{imageMatrix:w?.matrix,imageMatrixLimit:j,width:w?.width,height:w?.height}})},[w,j,I]);const[M,V]=D({});q(()=>{!I||!x||M?.matrix>x&&U({type:"videoMatrixLimit",details:{videoMatrix:M?.matrix,videoMatrixLimit:x,width:M?.width,height:M?.height}})},[M,x,I]);const[ee,le]=D(s.description),[W,re]=A.split("/"),ve=Ye(r,250);q(()=>{ve(ee)},[ee,ve]);const[he,P]=D(!1),Y=R(null);q(()=>{let $;return he&&Y.current&&($=setTimeout(()=>{Y.current.focus()},100)),()=>{clearTimeout($)}},[he]);const X=e(Le,{children:v&&!S?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:e(O,{id:"3wG7HI"})}),e("p",{title:ee,children:s.description||e("i",{children:"No description"})})]}):e("textarea",{ref:Y,value:ee||"",lang:n,placeholder:{image:l({id:"Lh8B0N"}),video:l({id:"mN4S+e"}),audio:l({id:"ieZytw"})}[W],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:t||p==="loading",class:p==="loading"?"loading":"",maxlength:a,onInput:$=>{const{value:Z}=$.target;le(Z)}})}),te=R(null);q(()=>()=>{te.current?.hideToast?.()},[]);const ae=R(null),ce=$=>{const{type:Z,details:z}=$;switch(Z){case"imageSizeLimit":{const{imageSize:se,imageSizeLimit:pe}=z;return l({id:"d83/LB",values:{0:He(se),1:He(pe)}})}case"imageMatrixLimit":{const{imageMatrix:se,imageMatrixLimit:pe,width:B,height:ie}=z,{newWidth:ne,newHeight:me}=Xt(se,pe,B,ie);return l({id:"DuvOX/",values:{0:c.number(B),1:c.number(ie),2:c.number(ne),3:c.number(me)}})}case"videoSizeLimit":{const{videoSize:se,videoSizeLimit:pe}=z;return l({id:"d83/LB",values:{0:He(se),1:He(pe)}})}case"videoMatrixLimit":{const{videoMatrix:se,videoMatrixLimit:pe,width:B,height:ie}=z,{newWidth:ne,newHeight:me}=Xt(se,pe,B,ie);return l({id:"DuvOX/",values:{0:c.number(B),1:c.number(ie),2:c.number(ne),3:c.number(me)}})}case"videoFrameRateLimit":return l({id:"S1fBwy"})}};return e(Le,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{P(!0)},children:W==="image"?e("img",{src:f,alt:"",onLoad:$=>{if(!I)return;const{naturalWidth:Z,naturalHeight:z}=$.target;k({matrix:Z*z,width:Z,height:z})}}):W==="video"||W==="gifv"?e("video",{src:f+"#t=0.1",playsinline:!0,muted:!0,disablePictureInPicture:!0,preload:"metadata",onLoadedMetadata:$=>{if(!I)return;const{videoWidth:Z,videoHeight:z}=$.target;Z&&z&&V({matrix:Z*z,width:Z,height:z})}}):W==="audio"?e("audio",{src:f,controls:!0}):null}),X,e("div",{class:"media-aside",children:[e("button",{type:"button",class:"plain close-button",disabled:t,onClick:u,children:e(T,{icon:"x",alt:l({id:"t/YqKh"})})}),!!H&&e("button",{type:"button",class:"media-error",title:ce(H),onClick:()=>{ae.current&&ae.current.hideToast(),ae.current=Ae({text:ce(H),duration:1e4})},children:e(T,{icon:"alert",alt:l({id:"SlfejT"})})})]})]}),he&&e(We,{onClose:()=>{P(!1)},children:e("div",{id:"media-sheet",class:"sheet sheet-max",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>{P(!1)},children:e(T,{icon:"x",alt:l({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:{image:l({id:"oMslIB"}),video:l({id:"WZw+zB"}),audio:l({id:"KMtgtM"})}[W]})}),e("main",{tabIndex:"-1",children:[e("div",{class:"media-preview",children:W==="image"?e("img",{src:f,alt:""}):W==="video"||W==="gifv"?e("video",{src:f,playsinline:!0,controls:!0}):W==="audio"?e("audio",{src:f,controls:!0}):null}),e("div",{class:"media-form",children:[X,e("footer",{children:[W==="image"&&/^(png|jpe?g|gif|webp)$/i.test(re)&&!!J.settings.mediaAltGenerator&&!!dt&&e(ai,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:l({id:"2FYpfJ"})})}),children:[e(fe,{disabled:p==="loading",onClick:()=>{g("loading"),te.current=Ae({text:l({id:"8zsp51"}),duration:-1}),async function(){try{const $=new FormData;$.append("image",m);const Z=await fetch(dt,{method:"POST",body:$}).then(z=>z.json());if(Z.error)throw new Error(Z.error);le(Z.description)}catch($){Ae($.message?l({id:"wy0Iwj",values:{0:$.message}}):l({id:"xhYfVj"}))}finally{g("default"),te.current?.hideToast?.()}}()},children:[e(T,{icon:"sparkles2"}),n&&n!=="en"?e("small",{children:[e(O,{id:"o5sTJw"}),e("br",{}),"(English)"]}):e("span",{children:e(O,{id:"o5sTJw"})})]}),!!n&&n!=="en"&&e(fe,{disabled:p==="loading",onClick:()=>{g("loading"),te.current=Ae({text:l({id:"8zsp51"}),duration:-1}),async function(){try{const $=new FormData;$.append("image",m);const Z=`?lang=${n}`,z=await fetch(dt+Z,{method:"POST",body:$}).then(se=>se.json());if(z.error)throw new Error(z.error);le(z.description)}catch($){Ae(l({id:"eNTGfp",values:{0:$?.message?`: ${$.message}`:""}}))}finally{g("default"),te.current?.hideToast?.()}}()},children:[e(T,{icon:"sparkles2"}),e("small",{children:[e(O,{id:"o5sTJw"}),e("br",{}),e(O,{id:"m+pAEQ",values:{0:ht(n)},components:{0:e("span",{class:"more-insignificant"})}})]})]})]}),e("button",{type:"button",class:"light block",onClick:()=>{P(!1)},disabled:p==="loading",children:e(O,{id:"DPfwMq"})})]})]})]})]})})]})}function Nn({onClose:s=()=>{},onSelect:t=()=>{},defaultSearchTerm:n}){const{_:a}=ke(),{masto:r}=mt(),[u,c]=D("default"),[l,p]=D([]),[g,S]=D({}),[A,v]=D(0),m=async d=>{if(!d?.length)return;const x=await Ki(d,g);x&&S({...g,...x})},f=d=>{d&&(c("loading"),(async()=>{try{const x=await r.v1.accounts.search.list({q:d,limit:40,resolve:!1});p(x),m(x),c("default")}catch{c("error")}})())},I=Ye(f,1e3);q(()=>{f()},[f]);const L=R();q(()=>{L.current&&(L.current.focus(),L.current.value&&(L.current.selectionStart=L.current.value.length,L.current.selectionEnd=L.current.value.length))},[]),q(()=>{n&&f(n)},[n]);const E=d=>{const x=d.acct;t(x),s()};Be("enter",()=>{const d=l[A];d&&E(d)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:d=>d.metaKey||d.ctrlKey||d.altKey||d.shiftKey});const j=R();return Be("down",()=>{A{const d=j.current.querySelector(".selected");d&&d.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:d=>d.metaKey||d.ctrlKey||d.altKey||d.shiftKey}),Be("up",()=>{A>0?v(A-1):v(l.length-1),setTimeout(()=>{const d=j.current.querySelector(".selected");d&&d.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:d=>d.metaKey||d.ctrlKey||d.altKey||d.shiftKey}),e("div",{id:"mention-sheet",class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("form",{onSubmit:d=>{d.preventDefault(),I.flush?.()},children:e("input",{ref:L,required:!0,type:"search",class:"block",placeholder:a({id:"eH1bqp"}),onInput:d=>{const{value:x}=d.target;I(x)},autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",defaultValue:n||""})})}),e("main",{children:l?.length>0?e("ul",{ref:j,class:`accounts-list ${u==="loading"?"loading":""}`,children:l.map((d,x)=>{const Q=g[d.id];return e("li",{class:x===A?"selected":"",children:[e(oi,{avatarSize:"xxl",account:d,relationship:Q,showStats:!0,showActivity:!0}),e("button",{type:"button",class:"plain2",onClick:()=>{E(d)},children:e(T,{icon:"plus",size:"xl",alt:a({id:"m16xKo"})})})]},d.id)})}):u==="loading"?e("div",{class:"ui-state",children:e(Ge,{abrupt:!0})}):u==="error"?e("div",{class:"ui-state",children:e("p",{children:e(O,{id:"AThL/k"})})}):null})]})}const Kn=gt.reduce((s,t)=>{const[n,a,r]=t;return s[n]={common:a,native:r},s},{}),Hn=Object.keys(ci),Jt=24*60*60,Qt=s=>{if(!s)return Jt;const t=(Date.parse(s)-Date.now())/1e3;return Hn.find(n=>n>=t)||Jt},Ce=zi([new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages],gt.map(s=>s[0]),"en"),Un=/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/gi,qn="$2xxxxxxxxxxxxxxxxxxxxxxx";function Wn(s){return s.replace(ri,qn).replace(Un,"$1@$3")}const Vn=Ti(s=>new Intl.ListFormat(s||void 0)),oe={camera:{id:"TbrCz2"},media:{id:"MfJ43d"},customEmoji:{id:"ggiJLM"},gif:{id:"Fm6c4W"},poll:{id:"cZJ92q"},sensitive:{id:"x/s2/O"},scheduledPost:{id:"sX3iLV"}},Gn=Math.max(10*60*1e3,Hi);function Jn({onClose:s,replyToStatus:t,editStatus:n,draftStatus:a,standalone:r,hasOpener:u}){const{i18n:c,_:l,_:p}=ke(),g=Ui(c.locale),S=Vn(c.locale),{masto:A,instance:v}=mt(),[m,f]=D("default"),I=R(a?.uid||qi()),L=_i(),E=L.info,j=si(),{statuses:{maxCharacters:d,maxMediaAttachments:x,charactersReservedPerUrl:Q}={},mediaAttachments:{supportedMimeTypes:H,imageSizeLimit:U,imageMatrixLimit:w,videoSizeLimit:k,videoMatrixLimit:M,videoFrameRateLimit:V,descriptionLimit:ee}={},polls:{maxOptions:le,maxCharactersPerOption:W,maxExpiration:re,minExpiration:ve}={}}=j||{},he=H?.filter(o=>/^(image|video)/i.test(o)),P=R(),Y=R(),[X,te]=D("public"),[ae,ce]=D(!1),[$,Z]=D(!1),[z,se]=D(Me.session.get("currentLanguage")||Ce),pe=R(z),[B,ie]=D([]),[ne,me]=D(null),[be,Re]=D(null),ue=Ii(),Ze=()=>{P.current&&P.current.dispatchEvent(new Event("input"))},ze=()=>{setTimeout(()=>{P.current&&(/^\n|\s/.test(a?.status)&&(P.current.selectionStart=0,P.current.selectionEnd=0),P.current?.focus())},300)},bt=({targetElement:o,text:h})=>{if(!o)return;const{selectionStart:F,selectionEnd:b,value:_}=o;let C=_.slice(0,F);C=C.replace(/\u200B$/,"");const y=C?/[\s\t\n\r]$/.test(C)?"":" ":"",N=_.slice(b),K=/^[\s\t\n\r]/.test(N)?"":" ",G=C+y+h+K+N;o.value=G,o.selectionStart=o.selectionEnd=b+h.length+K.length,o.focus(),o.dispatchEvent(new Event("input"))},Pe=R(null),je=R(null),Te=()=>{setTimeout(()=>{Pe.current&&Pe.current.focus()},0)},$e=R(null);q(()=>{const o=F=>{$e.current.classList.toggle("focused",F.type==="focusin");const b=F.target;b.hasAttribute("data-allow-custom-emoji")&&(je.current=b),["INPUT","BUTTON","SELECT","TEXTAREA"].includes(b.tagName)&&(Pe.current=b)},h=$e.current;return h&&(h.addEventListener("focusin",o),h.addEventListener("focusout",o)),()=>{h&&(h.removeEventListener("focusin",o),h.removeEventListener("focusout",o))}},[]),q(()=>{if(t){const{spoilerText:o,visibility:h,language:F,sensitive:b}=t;o&&Y.current&&(Y.current.value=o);const C=[...new Set([t.account.acct,...t.mentions.map(y=>y.acct)])].filter(y=>y!==E.acct);C.length>0&&(P.current.value=`${C.map(y=>`@${y}`).join(" ")} `,Ze()),ze(),te(h==="public"&&ue["posting:default:visibility"]?ue["posting:default:visibility"].toLowerCase():h),se(F||ue["posting:default:language"]?.toLowerCase()||Ce),ce(!!o)}else if(n){const{visibility:o,language:h,sensitive:F,poll:b,mediaAttachments:_}=n,C=!!b?.options&&{...b,options:b.options.map(y=>y?.title||y),expiresIn:b?.expiresIn||Qt(b.expiresAt)};f("loading"),(async()=>{try{const y=await A.v1.statuses.$select(n.id).source.fetch(),{text:N,spoilerText:K}=y;P.current.value=N,P.current.dataset.source=N,Ze(),ze(),Y.current.value=K,te(o),se(h||ue["posting:default:language"]?.toLowerCase()||Ce),ce(F),C&&me(C),ie(_),f("default")}catch(y){alert(y?.reason||y),f("error")}})()}else ze(),ue["posting:default:visibility"]&&te(ue["posting:default:visibility"].toLowerCase()),ue["posting:default:language"]&&se(ue["posting:default:language"].toLowerCase()),ue["posting:default:sensitive"]&&ce(!!ue["posting:default:sensitive"]);if(a){const{status:o,spoilerText:h,visibility:F,language:b,sensitive:_,sensitiveMedia:C,poll:y,mediaAttachments:N,scheduledAt:K}=a,G=!!y?.options&&{...y,options:y.options.map(de=>de?.title||de),expiresIn:y?.expiresIn||Qt(y.expiresAt)};P.current.value=o,Ze(),ze(),h&&(Y.current.value=h),F&&te(F),se(b||ue["posting:default:language"]?.toLowerCase()||Ce),C!==null&&Z(C),_!==null&&ce(_),G&&me(G),N&&ie(N),K&&Re(K)}},[a,n,t]);const yt=ti(J);q(()=>{yt.composerState.minimized||ze()},[yt.composerState.minimized]);const xt=R(),wt=p({id:"hR9gtK"}),Xe=()=>{const{value:o,dataset:h}=P.current;if(m==="loading")return!1;const F=(o||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),b=B.length>0;if(!F&&!b||B.length>0&&B.every(K=>K.id))return!0;const C=t?.account.id===E.id,y=t&&o.trim()===`@${t.account.acct}`;return!!(!C&&y||o===h?.source)},Je=()=>Xe()?!0:confirm(wt);q(()=>{const o=h=>{Xe()||(h.preventDefault(),h.returnValue=wt)};return window.addEventListener("beforeunload",o,{capture:!0}),()=>window.removeEventListener("beforeunload",o,{capture:!0})},[]);const di=()=>{const{value:o}=P.current,{value:h}=Y.current;return Ot(Wn(o))+Ot(h)},Qe=()=>{const o=di();J.composerCharacterCount=o};q(Qe,[]);const kt=window.CloseWatcher,et=R(!1);Be("esc",()=>{et.current=!0},{enabled:!kt,enableOnFormTags:!0,useKey:!0,ignoreEventWhen:o=>o.metaKey||o.ctrlKey||o.altKey||o.shiftKey}),Be("esc",()=>{!r&&et.current&&Je()&&s(),et.current=!1},{enabled:!kt,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:o=>{const h=document.querySelectorAll("#modal-container > *"),F=!!h,b=h.length===1&&h[0].querySelector("#compose-container");return F&&!b||o.metaKey||o.ctrlKey||o.altKey||o.shiftKey},useKey:!0}),Wi(()=>{!r&&Je()&&s()},[]);const Et=R({}),Ft=()=>`${Mi()}#${I.current}`,tt=()=>{if(n||J.composerState.minimized)return;const o=Ft(),h={key:o,replyTo:t?{id:t.id,account:{id:t.account.id,username:t.account.username,acct:t.account.acct}}:null,draftStatus:{uid:I.current,status:P.current.value,spoilerText:Y.current.value,visibility:X,language:z,sensitive:ae,sensitiveMedia:$,poll:ne,mediaAttachments:B,scheduledAt:be}};!Bi(h,Et.current)&&!Xe()&&(Pt.drafts.set(o,{...h,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(F=>{}),Et.current=structuredClone(h))};Vi(tt,5e3),q(()=>(tt(),()=>{Pt.drafts.del(Ft())}),[]),q(()=>{const o=F=>{const{items:b}=F.clipboardData||F.dataTransfer,_=[],C=[];for(let y=0;y0&&alert(Ie._({id:"rpXAF6",values:{0:C.length,1:C[0].name,2:S.format(C.map(y=>y.name))}})),_.length>0&&B.length>=x){alert(Ie._({id:"ctFhjs",values:{maxMediaAttachments:x}}));return}if(_.length>0){F.preventDefault(),F.stopPropagation();let y=_;if(x!==void 0){const K=x-B.length;if(y=y.slice(0,K),y.length<=0){alert(Ie._({id:"ctFhjs",values:{maxMediaAttachments:x}}));return}}const N=y.map(K=>({file:K,type:K.type,size:K.size,url:URL.createObjectURL(K),id:null,description:null}));ie([...B,...N])}};window.addEventListener("paste",o);const h=F=>{F.dataTransfer.items.length>0&&(F.preventDefault(),F.stopPropagation())};return window.addEventListener("dragover",h),window.addEventListener("drop",o),()=>{window.removeEventListener("paste",o),window.removeEventListener("dragover",h),window.removeEventListener("drop",o)}},[B]);const[Ct,it]=D(!1),[nt,Se]=D(!1),[hi,Oe]=D(!1),[_e,pi]=D(null),[mi,gi]=De(()=>{const o=[],h=[],{contentTranslationHideLanguages:F=[]}=J.settings;return gt.forEach(b=>{const[_]=b;_===z||_===pe.current||_===Ce||F.includes(_)||_e?.length&&_e.includes(_)?o.push(b):h.push(b)}),o.sort(([b,_],[C,y])=>b===z?-1:C===z?1:_.localeCompare(y)),h.sort(([b,_],[C,y])=>_.localeCompare(y)),[o,h]},[z,_e]),At=De(()=>!!t?.createdAt&&Math.floor((Date.now()-Date.parse(t.createdAt))/(1e3*60*60*24*30)),[t]),fi=()=>{tt(),J.composerState.minimized=!0},ye=m==="loading"||x!==void 0&&B.length>=x||!!ne,St=m==="loading"||!!ae,Lt=()=>{ce(!0),setTimeout(()=>{Y.current?.focus()},0)},zt=le==null||le>1,Tt=m==="loading"||!!ne||!!B.length,_t=()=>{me({options:["",""],expiresIn:24*60*60,multiple:!1}),setTimeout(()=>{$e.current?.querySelector('.poll-choice input[type="text"]')?.focus()},0)},vi=z!==pe.current||_e?.length&&!_e.includes(z),bi=X!=="public",Ne=R(),[yi,xi]=D(!0),wi=42;Gi({ref:Ne,box:"border-box",onResize:({width:o})=>{const{scrollWidth:h}=Ne.current,F=h>o,b=o{const o=new Date(Date.now()+Gn);Re(o)};return e("div",{id:"compose-container-outer",ref:$e,children:[e("div",{id:"compose-container",tabIndex:-1,class:r?"standalone":"",children:[e("div",{class:"compose-top",children:[E?.avatarStatic&&e(oi,{account:E,accountInstance:L.instanceURL,hideDisplayName:!0,useAvatarStatic:!0}),r?u&&e("button",{type:"button",class:"light pop-button",disabled:m==="loading",onClick:()=>{if(!window.opener){alert(p({id:"qiPXgY"}));return}if(window.opener.__STATES__.showCompose){if(window.opener.__STATES__.composerState?.publishing){alert(p({id:"Z2l5Bt"}));return}let o=p({id:"AB/GtR"});if(!confirm(o))return}s({fn:()=>{const o={editStatus:n,replyToStatus:t,draftStatus:{uid:I.current,status:P.current.value,spoilerText:Y.current.value,visibility:X,language:z,sensitive:ae,sensitiveMedia:$,poll:ne,mediaAttachments:B,scheduledAt:be}};window.opener.__COMPOSE__=o,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(T,{icon:"popin",alt:p({id:"/5ZKeE"})})}):e("span",{class:"compose-controls",children:[e("button",{type:"button",class:"plain4 pop-button",disabled:m==="loading",onClick:()=>{Yi({editStatus:n,replyToStatus:t,draftStatus:{uid:I.current,status:P.current.value,spoilerText:Y.current.value,visibility:X,language:z,sensitive:ae,poll:ne,mediaAttachments:B,scheduledAt:be}})&&s()},children:e(T,{icon:"popout",alt:p({id:"JsU2En"})})}),e("button",{type:"button",class:"plain4 min-button",onClick:fi,children:e(T,{icon:"minimize",alt:p({id:"3TSz9S"})})})," ",e("button",{type:"button",class:"plain4 close-button",disabled:m==="loading",onClick:()=>{Je()&&s()},children:e(T,{icon:"x",alt:p({id:"yz7wBu"})})})]})]}),!!t&&e("div",{class:"status-preview",children:[e(jt,{status:t,size:"s",previewMode:!0}),e("div",{class:"status-preview-legend reply-to",children:At>0?e(O,{id:"Q1Huya",values:{0:t.account.acct||t.account.username,1:g.format(-At,"month")},components:{0:e("strong",{})}}):e(O,{id:"dwLCPZ",values:{0:t.account.acct||t.account.username}})})]}),!!n&&e("div",{class:"status-preview",children:[e(jt,{status:n,size:"s",previewMode:!0}),e("div",{class:"status-preview-legend",children:e(O,{id:"wKtOLH"})})]}),e("form",{ref:xt,class:`form-visibility-${X}`,style:{pointerEvents:m==="loading"?"none":"auto",opacity:m==="loading"?.5:1},onClick:()=>{setTimeout(()=>{document.activeElement||Pe.current?.focus?.()},10)},onKeyDown:o=>{o.key==="Enter"&&(o.ctrlKey||o.metaKey)&&xt.current.dispatchEvent(new Event("submit",{cancelable:!0}))},onSubmit:o=>{o.preventDefault();const h=new FormData(o.target),F=Object.fromEntries(h.entries());let{status:b,visibility:_,sensitive:C,sensitiveMedia:y,spoilerText:N,scheduledAt:K}=F;if(C=C==="on",y=y==="on",K=K?new Date(K).toISOString():void 0,ne){if(ne.options.length<2){alert(p({id:"zhrMYj"}));return}if(ne.options.some(G=>G==="")){alert(p({id:"uNVxXX"}));return}}B.length>0&&B.some(de=>!de.description?.trim?.())&&!confirm(p({id:"MQYucx"}))||(N=C&&N||void 0,b=b===""?void 0:b,J.composerState.publishing=!0,f("loading"),(async()=>{try{if(B.length>0){const Ee=B.map(ge=>{const{file:ki,description:Ei,id:Fi}=ge;if(Fi)return ge;{const Ci=ei({file:ki,description:Ei});return A.v2.media.create(Ci).then(st=>(st.id&&(ge.id=st.id),st))}}),Dt=await Promise.allSettled(Ee);if(Dt.some(ge=>ge.status==="rejected"||!ge.value?.id)){J.composerState.publishing=!1,J.composerState.publishingError=!0,f("error"),Dt.forEach(ge=>{ge.status==="rejected"&&alert(ge.reason||p({id:"eIiurD",values:{i}}))});return}}let G={status:b,spoiler_text:N,language:z,sensitive:C||y,poll:ne,media_ids:B.map(Ee=>Ee.id)};n&&qe("@mastodon/edit-media-attributes")?G.media_attributes=B.map(Ee=>({id:Ee.id,description:Ee.description})):n||(G.visibility=_,G.in_reply_to_id=t?.id||void 0,G.scheduled_at=K),G=ei(G);let de;if(n)de=await A.v1.statuses.$select(n.id).update(G),Di(de,v,{skipThreading:!0});else try{de=await A.v1.statuses.create(G,{requestInit:{headers:{"Idempotency-Key":I.current}}})}catch{de=await A.v1.statuses.create(G)}J.composerState.minimized=!1,J.composerState.publishing=!1,f("default"),s({type:n?"edit":t?"reply":"post",newStatus:de,instance:v,scheduledAt:K})}catch(G){J.composerState.publishing=!1,J.composerState.publishingError=!0,alert(G?.reason||G),f("error")}})())},children:[e("div",{children:[e("div",{class:`compose-cw-container ${ae?"":"collapsed"}`,children:[e("input",{type:"hidden",name:"sensitive",value:ae?"on":"off"}),e(vt,{keys:":",class:"spoiler-text-field-container",onTrigger:o=>{o?.name==="custom-emojis"&&Se({targetElement:Y,defaultSearchTerm:o?.defaultSearchTerm||null})},children:e("input",{ref:Y,type:"text",name:"spoilerText",placeholder:p({id:"gnKo7f"}),"data-allow-custom-emoji":"true",disabled:m==="loading",class:"spoiler-text-field",lang:z,spellCheck:"true",autocomplete:"off",dir:"auto",onInput:()=>{Qe()}})}),e("button",{type:"button",class:"close-button plain4 small",onClick:()=>{ce(!1),P.current.focus()},children:e(T,{icon:"x",alt:p({id:"dEgA5A"})})})]}),e(In,{ref:P,"data-allow-custom-emoji":"true",placeholder:p(t?{id:"Sjj+EN"}:n?{id:"qzVesX"}:ne?{id:"/fY1js"}:{id:"owpNF1"}),required:B?.length===0,disabled:m==="loading",lang:z,onInput:()=>{Qe()},maxCharacters:d,onTrigger:o=>{o?.name==="custom-emojis"?Se({targetElement:je,defaultSearchTerm:o?.defaultSearchTerm||null}):o?.name==="mention"?it({defaultSearchTerm:o?.defaultSearchTerm||null}):o?.name==="auto-detect-language"&&o?.languages&&pi(o.languages)}})]}),B?.length>0&&e("div",{class:"media-attachments",children:[B.map((o,h)=>{const{id:F,file:b}=o,_=b?.size+b?.type+b?.name;return e(On,{attachment:o,disabled:m==="loading",lang:z,descriptionLimit:ee,onDescriptionChange:C=>{ie(y=>{const N=[...y];return N[h]={...N[h],description:C},N})},onRemove:()=>{ie(C=>C.filter((y,N)=>N!==h))}},F||_||h)}),e("label",{class:"media-sensitive",children:[e("input",{name:"sensitiveMedia",type:"checkbox",checked:$,disabled:m==="loading",onChange:o=>{const h=o.target.checked;Z(h)}})," ",e("span",{children:e(O,{id:"jER18a"})})," ",e(T,{icon:`eye-${$?"close":"open"}`})]})]}),!!ne&&e(En,{lang:z,maxOptions:le,maxExpiration:re,minExpiration:ve,maxCharactersPerOption:W,poll:ne,disabled:m==="loading",onInput:o=>{if(o){const h={...o};me(h)}else me(null),Te()}}),be&&e("div",{class:"toolbar scheduled-at",children:[e("span",{children:[e("label",{children:e(O,{id:"GKuKcZ",components:{0:e(Zi,{scheduledAt:be,setScheduledAt:Re})}})})," ",e("small",{class:"tag insignificant",children:Xi()})]}),e("button",{type:"button",class:"plain4 close-button small",onClick:()=>{Re(null),Te()},children:e(T,{icon:"x",alt:p({id:"dEgA5A"})})})]}),e("div",{class:"toolbar compose-footer",children:[e("span",{class:"add-toolbar-button-group spacer",children:[yi&&e(ai,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},menuButton:({open:o})=>e("button",{type:"button",class:`toolbar-button add-button ${o?"active":""}`,children:e(T,{icon:"plus",title:p({id:"m16xKo"})})}),children:[Ht&&e(fe,{disabled:ye,className:"compose-menu-add-media",children:[e("label",{class:"compose-menu-add-media-field",children:e(Kt,{hidden:!0,supportedMimeTypes:he,disabled:ye,setMediaAttachments:ie})}),e(T,{icon:"camera"})," ",e("span",{children:l(oe.camera)})]}),e(fe,{disabled:ye,className:"compose-menu-add-media",children:[e("label",{class:"compose-menu-add-media-field",children:e(Zt,{hidden:!0,supportedMimeTypes:H,maxMediaAttachments:x,mediaAttachments:B,disabled:ye,setMediaAttachments:ie})}),e(T,{icon:"media"})," ",e("span",{children:l(oe.media)})]}),e(fe,{disabled:St,onClick:Lt,children:[e(T,{icon:`eye-${ae?"close":"open"}`})," ",e("span",{children:l(oe.sensitive)})]}),zt&&e(fe,{disabled:Tt,onClick:_t,children:[e(T,{icon:"poll"})," ",e("span",{children:l(oe.poll)})]}),e($t,{}),e(fe,{onClick:()=>{Se({targetElement:je})},children:[e(T,{icon:"emoji2"})," ",e("span",{children:l(oe.customEmoji)})]}),!!J.settings.composerGIFPicker&&e(fe,{disabled:ye,onClick:()=>{Oe(!0)},children:[e("span",{class:"icon icon-gif",role:"img"}),e("span",{children:l(oe.gif)})]}),It&&e(Le,{children:[e($t,{}),e(fe,{disabled:Mt,onClick:Bt,children:[e(T,{icon:"schedule"})," ",e("span",{children:l(oe.scheduledPost)})]})]})]}),e("span",{class:"add-sub-toolbar-button-group",ref:Ne,hidden:!0,children:[Ht&&e("label",{class:"toolbar-button",children:[e(Kt,{supportedMimeTypes:he,mediaAttachments:B,disabled:ye,setMediaAttachments:ie}),e(T,{icon:"camera",alt:l(oe.camera)})]}),e("label",{class:"toolbar-button",children:[e(Zt,{supportedMimeTypes:H,maxMediaAttachments:x,mediaAttachments:B,disabled:ye,setMediaAttachments:ie}),e(T,{icon:"media",alt:l(oe.media)})]}),e("button",{type:"button",class:"toolbar-button",disabled:St,onClick:Lt,children:e(T,{icon:`eye-${ae?"close":"open"}`,alt:l(oe.sensitive)})}),zt&&e("button",{type:"button",class:"toolbar-button",disabled:Tt,onClick:_t,children:e(T,{icon:"poll",alt:l(oe.poll)})}),e("div",{class:"toolbar-divider"}),e("button",{type:"button",class:"toolbar-button",disabled:m==="loading",onClick:()=>{Se({targetElement:je})},children:e(T,{icon:"emoji2",alt:l(oe.customEmoji)})}),!!J.settings.composerGIFPicker&&e("button",{type:"button",class:"toolbar-button gif-picker-button",disabled:ye,onClick:()=>{Oe(!0)},children:e("span",{class:"icon icon-gif","aria-label":l(oe.gif)})}),It&&e(Le,{children:[e("div",{class:"toolbar-divider"}),e("button",{type:"button",class:`toolbar-button ${be?"highlight":""}`,disabled:Mt,onClick:Bt,children:e(T,{icon:"schedule",alt:l(oe.scheduledPost)})})]})]})]}),m==="loading"?e(Ge,{abrupt:!0}):e(rn,{maxCharacters:d,hidden:m==="loading"}),e("label",{class:`toolbar-button ${vi?"highlight":""}`,children:[e("span",{class:"icon-text",children:Kn[z]?.native}),e("select",{name:"language",value:z,onChange:o=>{const{value:h}=o.target;se(h||Ce),Me.session.set("currentLanguage",h||Ce)},disabled:m==="loading",dir:"auto",children:[mi.map(([o,h,F])=>{const b=ht({code:o,fallback:h});return e("option",{value:o,children:b!==F?`${F} - ${b}`:b},o)}),e("hr",{}),gi.map(([o,h,F])=>{const b=ht({code:o,fallback:h});return e("option",{value:o,children:b!==F?`${F} - ${b}`:b},o)})]})]})," ",e("label",{class:`toolbar-button ${bi?"highlight":""}`,title:l(ot[X]),children:[X==="public"||X==="direct"?e(T,{icon:Ji[X],alt:l(ot[X])}):e("span",{class:"icon-text",children:l(ot[X])}),e("select",{name:"visibility",value:X,onChange:o=>{te(o.target.value)},disabled:m==="loading"||!!n,dir:"auto",children:[e("option",{value:"public",children:e(O,{id:"7d1a0d"})}),(qe("@pleroma/local-visibility-post")||qe("@akkoma/local-visibility-post"))&&e("option",{value:"local",children:e(O,{id:"d5zxa4"})}),e("option",{value:"unlisted",children:e(O,{id:"pPYeIN"})}),e("option",{value:"private",children:e(O,{id:"x5LEuB"})}),e("option",{value:"direct",children:e(O,{id:"IV4QaU"})})]})]})," ",e("button",{type:"submit",disabled:m==="loading",children:p(be?{id:"gmB6oO"}:t?{id:"ImOQa9"}:n?{id:"EkH9pt"}:{id:"GMe2XV"})})]})]})]}),Ct&&e(We,{onClose:()=>{it(!1),Te()},children:e(Nn,{masto:A,instance:v,onClose:()=>{it(!1)},defaultSearchTerm:Ct?.defaultSearchTerm,onSelect:o=>{const h=P.current;h&&bt({targetElement:h,text:"@"+o})}})}),nt&&e(We,{onClose:()=>{Se(!1),Te()},children:e(Bn,{masto:A,instance:v,onClose:()=>{Se(!1)},defaultSearchTerm:nt?.defaultSearchTerm,onSelect:o=>{const h=nt?.targetElement?.current||P.current;h&&bt({targetElement:h,text:o})}})}),hi&&e(We,{onClose:()=>{Oe(!1),Te()},children:e(jn,{onClose:()=>Oe(!1),onSelect:({url:o,type:h,alt_text:F})=>{if(B.length>=x){alert(Ie._({id:"ctFhjs",values:{maxMediaAttachments:x}}));return}(async()=>{let b;try{b=Ae({text:p({id:"/Cw4Tx"}),duration:-1});const _=await fetch(o,{referrerPolicy:"no-referrer"}).then(N=>N.blob()),C=new File([_],h==="video/mp4"?"video.mp4":"image.gif",{type:h}),y=[...B,{file:C,type:h,size:C.size,id:null,description:F||""}];ie(y),b?.hideToast?.()}catch{b?.hideToast?.(),Ae(p({id:"VKDnAx"}))}})()}})})]})}function ei(s){for(let t in s)(s[t]===null||s[t]===void 0)&&delete s[t];return s}export{Jn as default}; //# sourceMappingURL=compose-BAFFp8_Z.js.map