Files
phanpy-cz/assets/compose-6wkLWCrG.js
2026-02-07 19:49:28 +01:00

39 lines
149 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{u as r,e as ma,s as Oe,p as bo,a as Lt,A as ce,b as Ji,$ as yo,y as Ae,G as xo,Y as va,T as ie,K as wo,d as oe,M as ba,k as Kt,m as hn,l as mt,q as ni,B as ui,H as Pn,aV as ko,O as Eo,aW as ya,J as Ao,a1 as So,V as To,t as Co,aO as Fo,I as Io,aX as Po,c as Lo}from"./pwa-viewport-7HQOd5MC.js";import{a7 as Oo,O as _o,a3 as Ro,D as zo,y as Gt,ah as Gi,ai as Jr,aj as xa,Y as Mo,_ as ci,I as te,t as fn,r as ii,s as It,h as ai,i as wa,e as kt,l as Yi,v as jo,d as On,w as ka,G as oi,ak as Uo,al as Do,am as Bo,a1 as No,p as dn,an as Go,ao as $o,F as Zr,u as Ko,a as Ho,a9 as Vo,a8 as qo,c as Qr,ap as $i,aq as Wo}from"./ScheduledAtField-B9b7q7O5.js";import{_ as Yo}from"./__vite-browser-external-D7Ct-6yo.js";import"./ICONS-C5h6VnP9.js";const Zi=[["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","ⵜⴰⵎⴰⵣⵉⵖⵜ"]],Xo=new Intl.Segmenter;function ea(m){if(m==="")return 0;let u=0;for(const g of Xo.segment(m))u++;return u}const Jo="(((?:[^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\\-_&=#\\/])?))",Zo="gi",ta={source:Jo,flags:Zo},Ea=new RegExp(ta.source,ta.flags),Qo=/iPad|iPhone|iPod/.test(navigator.userAgent)&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function na({hidden:m,disabled:u=!1,supportedMimeTypes:g,setMediaAttachments:b}){const y=Qo?g:g?.filter(F=>!/^image\//i.test(F));return r("input",{type:"file",hidden:m,accept:y?.join(","),capture:"environment",disabled:u,onChange:F=>{const A=F.target.files;if(!A)return;const S=Array.from(A)[0];S&&(b(P=>[...P,{file:S,type:S.type,size:S.size,url:URL.createObjectURL(S),id:null,description:null}]),F.target.value=null)}})}const ia="capture"in document.createElement("input");function es({maxCharacters:m=500,hidden:u}){const b=ma(Oe).composerCharacterCount,y=m-b;return u?r("span",{class:"char-counter",hidden:!0}):r("span",{class:"char-counter",title:`${y}/${m}`,style:{"--percentage":b/m*100},children:[r("meter",{class:`${y<=-10?"explode":y<=0?"danger":y<=20?"warning":""}`,value:b,max:m}),r("span",{class:"counter",children:y})]})}class ts{constructor(u,g,{tabInsertsSuggestions:b,defaultFirstOption:y,scrollIntoViewOptions:F}={}){this.input=u,this.list=g,this.tabInsertsSuggestions=b??!0,this.defaultFirstOption=y??!1,this.scrollIntoViewOptions=F??{block:"nearest",inline:"nearest"},this.isComposing=!1,g.id||(g.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=A=>ns(A,this),this.compositionEventHandler=A=>as(A,this),this.inputHandler=this.clearSelection.bind(this),u.setAttribute("role","combobox"),u.setAttribute("aria-controls",g.id),u.setAttribute("aria-expanded","false"),u.setAttribute("aria-autocomplete","list"),u.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",ra),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",ra)}indicateDefaultOption(){var u;this.defaultFirstOption&&((u=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Ki)[0])===null||u===void 0||u.setAttribute("data-combobox-option-default","true"))}navigate(u=1){const g=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Ki)[0],b=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Ki),y=b.indexOf(g);if(y===b.length-1&&u===1||y===0&&u===-1){this.clearSelection(),this.input.focus();return}let F=u===1?0:b.length-1;if(g&&y>=0){const S=y+u;S>=0&&S<b.length&&(F=S)}const A=b[F];if(A)for(const S of b)S.removeAttribute("data-combobox-option-default"),A===S?(this.input.setAttribute("aria-activedescendant",A.id),A.setAttribute("aria-selected","true"),rs(A),A.scrollIntoView(this.scrollIntoViewOptions)):S.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const u of this.list.querySelectorAll('[aria-selected="true"]'))u.removeAttribute("aria-selected");this.indicateDefaultOption()}}function ns(m,u){if(!(m.shiftKey||m.metaKey||m.altKey)&&!(!u.ctrlBindings&&m.ctrlKey)&&!u.isComposing)switch(m.key){case"Enter":aa(u.input,u.list)&&m.preventDefault();break;case"Tab":u.tabInsertsSuggestions&&aa(u.input,u.list)&&m.preventDefault();break;case"Escape":u.clearSelection();break;case"ArrowDown":u.navigate(1),m.preventDefault();break;case"ArrowUp":u.navigate(-1),m.preventDefault();break;case"n":u.ctrlBindings&&m.ctrlKey&&(u.navigate(1),m.preventDefault());break;case"p":u.ctrlBindings&&m.ctrlKey&&(u.navigate(-1),m.preventDefault());break;default:if(m.ctrlKey)break;u.clearSelection()}}function ra(m){if(!(m.target instanceof Element))return;const u=m.target.closest('[role="option"]');u&&u.getAttribute("aria-disabled")!=="true"&&is(u,{event:m})}function aa(m,u){const g=u.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return g?(g.getAttribute("aria-disabled")==="true"||g.click(),!0):!1}function is(m,u){m.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:u}))}function rs(m){m.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function Ki(m){return!m.hidden&&!(m instanceof HTMLInputElement&&m.type==="hidden")&&(m.offsetWidth>0||m.offsetHeight>0)}function as(m,u){u.isComposing=m.type==="compositionstart",document.getElementById(u.input.getAttribute("aria-controls")||"")&&u.clearSelection()}const os=/\s|\(|\[/;function ss(m,u,g,{multiWord:b,lookBackIndex:y,lastMatchPosition:F}={multiWord:!1,lookBackIndex:0,lastMatchPosition:null}){let A=m.lastIndexOf(u,g-1);if(A===-1||A<y)return;if(b){if(F!=null){if(F===A)return;A=F-u.length}if(m[A+1]===" "&&g>=A+u.length+1||m.lastIndexOf(`
`,g-1)>A||m.lastIndexOf(".",g-1)>A)return}else if(m.lastIndexOf(" ",g-1)>A)return;const S=m[A-1];return S&&!os.test(S)?void 0:{text:m.substring(A+u.length,g),position:A+u.length}}class us extends Event{constructor(){super("update")}}const Hi=new WeakMap;class Qi extends EventTarget{#t=new MutationObserver(()=>this.#f());#r=new ResizeObserver(()=>this.#d());#a;#n=document.createElement("div");#e=document.createElement("div");static for(u){let g=Hi.get(u);return g||(g=new Qi(u),Hi.set(u,g)),g}constructor(u){super(),this.#a=new WeakRef(u),this.#n.style.position="absolute",this.#n.style.pointerEvents="none",this.#n.setAttribute("aria-hidden","true"),this.#n.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",u 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"),u.after(this.#n),this.#f(),this.#h(),this.#t.observe(u,{attributeFilter:["style","dir"]}),this.#r.observe(u),document.addEventListener("scroll",this.#s,{capture:!0}),window.addEventListener("resize",this.#s,{capture:!0}),u.addEventListener("input",this.#g,{capture:!0})}get element(){return this.#e}forceUpdate(){this.#f(),this.#h()}disconnect(){this.#n?.remove(),this.#t.disconnect(),this.#r.disconnect(),document.removeEventListener("scroll",this.#s,{capture:!0}),window.removeEventListener("resize",this.#s,{capture:!0});const u=this.#o;u&&(u.removeEventListener("input",this.#g,{capture:!0}),Hi.delete(u))}get#o(){return this.#a?.deref()}#i(u){const g=this.#o;return g?u(g):this.disconnect()}#u=0;#c=0;#p(){this.#i(u=>{const g=window.getComputedStyle(u);this.#e.style.height=g.height,this.#e.style.width=g.width,u.clientHeight!==this.#e.clientHeight&&(this.#e.style.height=`calc(${g.height} + ${u.clientHeight-this.#e.clientHeight}px)`),u.clientWidth!==this.#e.clientWidth&&(this.#e.style.width=`calc(${g.width} + ${u.clientWidth-this.#e.clientWidth}px)`);const b=u.getBoundingClientRect(),y=this.#e.getBoundingClientRect();this.#u=this.#u+b.left-y.left,this.#c=this.#c+b.top-y.top,this.#e.style.transform=`translate(${this.#u}px, ${this.#c}px)`,this.#e.scrollTop=u.scrollTop,this.#e.scrollLeft=u.scrollLeft,this.dispatchEvent(new us)})}#l=!1;#d(){this.#l||(this.#l=!0,requestAnimationFrame(()=>{this.#p(),this.#l=!1}))}#f(){this.#i(u=>{const g=window.getComputedStyle(u);for(const b of cs)this.#e.style[b]=g[b];this.#d()})}#h(){this.#i(u=>{this.#e.textContent=u.value,this.#p()})}#g=()=>this.#h();#s=u=>{this.#i(g=>{(u.target===document||u.target===window||u.target instanceof Node&&u.target.contains(g))&&this.#d()})}}const cs=["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 si{#t;#r;#a;constructor(u,g=0,b=g){this.#t=u,this.#r=g,this.#a=b}static fromSelection(u){const{selectionStart:g,selectionEnd:b}=u;return new si(u,g??void 0,b??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.#r}get endOffset(){return this.#a}setStartOffset(u){this.#r=this.#o(u)}setEndOffset(u){this.#a=this.#o(u)}collapse(u=!1){u?this.setEndOffset(this.startOffset):this.setStartOffset(this.endOffset)}cloneContents(){return this.#i().cloneContents()}cloneRange(){return new si(this.#t,this.startOffset,this.endOffset)}getBoundingClientRect(){return this.#i().getBoundingClientRect()}getClientRects(){return this.#i().getClientRects()}toString(){return this.#i().toString()}getStyleClone(){return this.#n}get#n(){return Qi.for(this.#t)}get#e(){return this.#n}#o(u){return Math.max(0,Math.min(u,this.#t.value.length))}#i(){const u=document.createRange(),g=this.#e.element.childNodes[0];return g&&(u.setStart(g,this.startOffset),u.setEnd(g,this.endOffset)),u}}const ri=new WeakMap;let ls=class{constructor(u,g){this.expander=u,this.input=g,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,g.addEventListener("paste",this.onpaste),g.addEventListener("input",this.oninput),g.addEventListener("keydown",this.onkeydown),g.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(u,g){var b,y;this.input!==document.activeElement&&this.input!==((y=(b=document.activeElement)===null||b===void 0?void 0:b.shadowRoot)===null||y===void 0?void 0:y.activeElement)||(this.deactivate(),this.menu=g,g.id||(g.id=`text-expander-${Math.floor(Math.random()*1e5).toString()}`),this.expander.append(g),this.combobox=new ts(this.input,g),this.expander.dispatchEvent(new Event("text-expander-activate")),this.positionMenu(g,u.position),this.combobox.start(),g.addEventListener("combobox-commit",this.oncommit),g.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1))}positionMenu(u,g){const b=Math.min(g,this.input.value.length),y=new si(this.input,b).getBoundingClientRect(),F={left:y.left,top:y.top+y.height},A=u.getBoundingClientRect(),S={left:F.left-A.left,top:F.top-A.top};if(S.left!==0||S.top!==0){const P=getComputedStyle(u);u.style.left=P.left?`calc(${P.left} + ${S.left}px)`:`${S.left}px`,u.style.top=P.top?`calc(${P.top} + ${S.top}px)`:`${S.top}px`}}deactivate(){const u=this.menu;return!u||!this.combobox?!1:(this.expander.dispatchEvent(new Event("text-expander-deactivate")),this.menu=null,u.removeEventListener("combobox-commit",this.oncommit),u.removeEventListener("mousedown",this.onmousedown),this.combobox.destroy(),this.combobox=null,u.remove(),!0)}onCommit({target:u}){var g;const b=u;if(!(b instanceof HTMLElement)||!this.combobox)return;const y=this.match;if(!y)return;const F=this.input.value.substring(0,y.position-y.key.length),A=this.input.value.substring(y.position+y.text.length),S={item:b,key:y.key,value:null,continue:!1};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:S}))||!S.value)return;let T=(g=this.expander.getAttribute("suffix"))!==null&&g!==void 0?g:" ";S.continue&&(T="");const L=`${S.value}${T}`;this.input.value=F+L+A;const le=F.length+L.length;this.deactivate(),this.input.focus({preventScroll:!0}),this.input.selectionStart=le,this.input.selectionEnd=le,S.continue||(this.lookBackIndex=le,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}isMatchStillValid(u){return u.position<=this.input.value.length}async onInput(){if(this.justPasted){this.justPasted=!1;return}const u=this.findMatch();if(u){this.match=u;const g=await this.notifyProviders(u);if(!this.match||!this.isMatchStillValid(u)){this.match=null,this.deactivate();return}g?this.activate(u,g):this.deactivate()}else this.match=null,this.deactivate()}findMatch(){const u=this.input.selectionEnd||0,g=this.input.value;u<=this.lookBackIndex&&(this.lookBackIndex=u-1);for(const{key:b,multiWord:y}of this.expander.keys){const F=ss(g,b,u,{multiWord:y,lookBackIndex:this.lookBackIndex,lastMatchPosition:this.match?this.match.position:null});if(F)return{text:F.text,key:b,position:F.position}}}async notifyProviders(u){const g=[],b=P=>g.push(P),y=new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:b,text:u.text,key:u.key}});return this.expander.dispatchEvent(y)?(await Promise.all(g)).filter(P=>P.matched).map(P=>P.fragment)[0]:void 0}onMousedown(){this.interactingWithList=!0}onKeydown(u){u.key==="Escape"&&(this.match=null,this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex,u.stopImmediatePropagation(),u.preventDefault()))}};class oa extends HTMLElement{get keys(){const u=this.getAttribute("keys"),g=u?u.split(" "):[],b=this.getAttribute("multiword"),y=b?b.split(" "):[],F=y.length===0&&this.hasAttribute("multiword");return g.map(A=>({key:A,multiWord:F||y.includes(A)}))}set keys(u){this.setAttribute("keys",u)}connectedCallback(){const u=this.querySelector('input[type="text"], textarea');if(!(u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement))return;const g=new ls(this,u);ri.set(this,g)}disconnectedCallback(){const u=ri.get(this);u&&(u.destroy(),ri.delete(this))}dismiss(){const u=ri.get(this);u&&u.dismissMenu()}}window.customElements.get("text-expander")||(window.TextExpanderElement=oa,window.customElements.define("text-expander",oa));async function ds(m,u){const b=(await u.v1.customEmojis.list()).filter(F=>F.visibleInPicker),y=new Oo(b,{keys:["shortcode"],findAllMatches:!0});return[b,y]}const Aa=bo(ds,{isKeyItemEqual:(m,u)=>m.instance===u.instance,expires:1800*1e3}),Pt=document.createElement("ul");Pt.role="listbox";Pt.className="text-expander-menu";const fs=16,hs=new IntersectionObserver(m=>{m.forEach(u=>{if(u.isIntersecting){const{left:g,width:b}=u.boundingClientRect,{innerWidth:y}=window;if(g+b>y){const F=_o()?"right":"left";Pt.style[F]=y-b-fs+"px"}}})});hs.observe(Pt);function Ft(m){return m.replace(/[&<>"']/g,function(u){return"&#"+u.charCodeAt(0)+";"})}function ps({onTrigger:m=null,...u},g){const{_:b}=Lt(),y=ce(),{masto:F,instance:A}=Ji(),S=ce(),P=ce(""),T=ce(!1);return yo(g,()=>({setStyle:L=>{y.current&&Object.assign(y.current.style,L)},activated:()=>T.current})),Ae(()=>{S.current||Aa(A,F).then(([,L])=>{S.current=L}).catch(L=>{})},[A,F]),Ae(()=>{const L=y.current;if(!L)return;const le=U=>{const{key:Y,provide:he,text:I}=U.detail;if(P.current=I,I===""){he(Promise.resolve({matched:!1}));return}if(Y===":"){const ue=!!m,de=S.current?.search(I,{limit:5});let me="";de?.forEach(({item:ve})=>{const{shortcode:M,url:X}=ve;me+=`
<li role="option" data-value="${Ft(M)}">
<img src="${Ft(X)}" width="16" height="16" alt="" loading="lazy" />
${Ft(M)}
</li>`}),ue&&(me+=`<li role="option" data-value="" data-more="${I}">More…</li>`),Pt.innerHTML=me,he(Promise.resolve({matched:(de?.length||0)>0,fragment:Pt}));return}const W={"@":"accounts","":"accounts","#":"hashtags","":"hashtags"}[Y];if(W){he(new Promise(async ue=>{try{let de;if(W==="accounts")de=await F.v1.accounts.search.list({q:I,limit:5,resolve:!1});else{const M=await F.v2.search.list({type:W,q:I,limit:5});de=M[W]||M}if(I!==P.current)return;const me=de;let ve="";me.forEach(M=>{const{name:X,avatarStatic:se,displayName:Fe,username:Ge,acct:Re,emojis:pe,history:Ke,roles:He,url:Ve}=M,rt=Ro(Fe,pe),J=xo(Ve);if(Re)ve+=`
<li role="option" data-value="${Ft(Re)}">
<span class="avatar">
<img src="${Ft(se)}" width="16" height="16" alt="" loading="lazy" />
</span>
<span>
<b>${rt||Ge}</b>
<br><span class="bidi-isolate">@${Ft(Re)}</span>
${He?.map(Ee=>` <span class="tag collapsed">
${Ee.name}
${!!J&&`<span class="more-insignificant">
${J}
</span>`}
</span>`)||""}
</span>
</li>
`;else{const Ee=Ke?.reduce?.((ye,$e)=>ye+ +$e.uses,0);ve+=`
<li role="option" data-value="${Ft(X)}">
<span class="grow">#<b>${Ft(X)}</b></span>
${Ee?`<span class="count">${zo(Ee)}</span>`:""}
</li>
`}}),W==="accounts"&&(ve+=`<li role="option" data-value="" data-more="${I}">${b({id:"24misb"})}</li>`),Pt.innerHTML=ve,ue({matched:me.length>0,fragment:Pt})}catch{ue({matched:!1})}}));return}he(Promise.resolve({matched:!1}))},z=U=>{const{key:Y,item:he}=U.detail,{value:I,more:W}=he.dataset;Y===":"?(U.detail.value=I?`:${I}:`:"",W&&(U.detail.continue=!0,setTimeout(()=>{m?.({name:"custom-emojis",defaultSearchTerm:W})},300))):Y==="@"?(U.detail.value=I?`@${I}`:"",W&&(U.detail.continue=!0,setTimeout(()=>{m?.({name:"mention",defaultSearchTerm:W})},300))):U.detail.value=`${Y}${I}`},D=U=>{const{input:Y}=U.detail;if(Y){const he=new Event("input",{bubbles:!0});Y.dispatchEvent(he)}},_=()=>{T.current=!0},B=()=>{T.current=!1};return L.addEventListener("text-expander-change",le),L.addEventListener("text-expander-value",z),L.addEventListener("text-expander-committed",D),L.addEventListener("text-expander-activate",_),L.addEventListener("text-expander-deactivate",B),()=>{L.removeEventListener("text-expander-change",le),L.removeEventListener("text-expander-value",z),L.removeEventListener("text-expander-committed",D),L.removeEventListener("text-expander-activate",_),L.removeEventListener("text-expander-deactivate",B)}},[S.current,m,b,F]),r("text-expander",{ref:y,...u})}const er=va(ps),Sa={300:Gt(5,"minute"),1800:Gt(30,"minute"),3600:Gt(1,"hour"),21600:Gt(6,"hour"),86400:Gt(1,"day"),259200:Gt(3,"day"),604800:Gt(1,"week")};function gs({lang:m,poll:u,disabled:g,onInput:b=()=>{},maxOptions:y,maxExpiration:F,minExpiration:A,maxCharactersPerOption:S}){const{_:P}=Lt(),{options:T,expiresIn:L,multiple:le}=u;return r("div",{class:`poll ${le?"multiple":""}`,children:[r("div",{class:"poll-choices",children:T.map((z,D)=>r("div",{class:"poll-choice",children:[r(er,{keys:":",class:"poll-field-container",children:r("input",{required:!0,type:"text",value:z,disabled:g,maxlength:S,placeholder:P({id:"LDUSXg",values:{0:D+1}}),lang:m,spellCheck:"true",autocomplete:"off",dir:"auto","data-allow-custom-emoji":"true",onInput:_=>{const{value:B}=_.target;T[D]=B,b(u)}})}),r("button",{type:"button",class:"plain4 poll-button",disabled:g||T.length<=1,onClick:()=>{T.splice(D,1),b(u)},title:P({id:"t/YqKh"}),children:""})]},D))}),r("div",{class:"poll-toolbar",children:[r("button",{type:"button",class:"plain2 poll-button",disabled:g||T.length>=y,onClick:()=>{T.push(""),b(u)},title:P({id:"m16xKo"}),children:"+"})," ",r("div",{class:"poll-config",children:[r("label",{class:"multiple-choices",children:[r("input",{type:"checkbox",checked:le,disabled:g,onChange:z=>{const{checked:D}=z.target;u.multiple=D,b(u)}})," ",r(ie,{id:"zytZXj"})]}),r("label",{class:"expires-in",children:[r(ie,{id:"lkz6PL"})," ",r("select",{value:L,disabled:g,onChange:z=>{const{value:D}=z.target;u.expiresIn=D,b(u)},children:Object.entries(Sa).filter(([z])=>z>=A&&z<=F).map(([z,D])=>r("option",{value:z,children:D()},z))})]}),r("div",{class:"spacer"}),r("button",{type:"button",class:"light danger small",disabled:g,onClick:()=>{b(null)},children:r(ie,{id:"CDpQAX"})})]})]})]})}const ms=/[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i,vs=new RegExp(`(^|[^=\\/\\w])([@]${ms.source}(?:@[\\p{L}\\w.-]+[\\w]+)?)`,"uig"),bs=new RegExp("(^|[^=\\/\\w])([#][\\p{L}\\p{N}_]+([\\p{L}\\p{N}_.]+[\\p{L}\\p{N}_]+)?)(?![\\/\\w])","iug"),ys="[a-zA-Z0-9_]{2,}",xs=new RegExp(`(^|[^=\\/\\w])(:${ys}:)(?=[^A-Za-z0-9_:]|$)`,"g"),ws=new Intl.Segmenter;function ks(m,{maxCharacters:u=1/0}){const{composerCharacterCount:g}=Oe;if(g>u){let b="",y="";const F=ws.segment(m);for(const{segment:A,index:S}of F)S<u?b+=A:y+=A;return y&&(y='<mark class="compose-highlight-exceeded">'+Gi(y)+"</mark>"),Gi(b)+y}return Gi(m).replace(Ea,'$2<mark class="compose-highlight-url">$3</mark>').replace(vs,'$1<mark class="compose-highlight-mention">$2</mark>').replace(bs,'$1<mark class="compose-highlight-hashtag">$2</mark>').replace(xs,'$1<mark class="compose-highlight-emoji-shortcode">$2</mark>')}function sa(m){if(!m)return;const{value:u,offsetHeight:g,scrollHeight:b,clientHeight:y}=m;if(g<window.innerHeight){const F=g-y,A=u?b+F+"px":null;m.style.height=A}}const Es=async m=>{if(Jr){const b=await Jr.detect(m);if(b?.length)return b.slice(0,2).map(y=>y.detectedLanguage)}const{detectAll:u}=await wo(async()=>{const{detectAll:b}=await import("./tinyld.light.node-D9KYf3Y3.js");return{detectAll:b}},[],import.meta.url),g=u(m);return g?.length?g.slice(0,2).map(b=>b.lang):null},As=va((m,u)=>{const[g,b]=oe(u.current?.value||""),{maxCharacters:y,onTrigger:F=null,...A}=m,S=ce();xa({ref:u,onResize:()=>{if(S.current&&u.current){const{height:z}=u.current.getBoundingClientRect();z&&S.current.setStyle({minHeight:z+"px"})}}});const P=ce(0),T=ce(),L=Mo(z=>{if(!T.current)return;if(P.current>3){T.current.innerHTML="",T.current=null,L?.cancel?.();return}let D,_;P.current<=3&&(D=Date.now()),T.current.innerHTML=ks(z,{maxCharacters:y})+`
`,P.current<=3&&(_=Date.now()),D&&_&&_-D>50&&P.current++},500),le=ci(()=>{const z=T.current?.cloneNode(!0);if(!z)return;z.querySelectorAll("mark").forEach(_=>{_.remove()});const D=z.innerText?.trim();D&&(async()=>{const _=await Es(D);_?.length&&F?.({name:"auto-detect-language",languages:_})})()},2e3);return r(er,{ref:S,keys:"@ : # ",class:"compose-field-container",onTrigger:F,children:[r("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...A,ref:u,name:"status",value:g,onKeyDown:z=>{const{key:D,target:_}=z,B=S.current?.activated();if(D==="Enter"&&!(z.ctrlKey||z.metaKey||B)&&!z.isComposing)try{const{value:U,selectionStart:Y}=_,I=U.slice(0,Y).split(`
`).slice(-1)[0];if(I&&/^\s*(-|\d+\.)\s/.test(I)){const[W,ue,de,me,ve]=I.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(ve){z.preventDefault();const[M]=de.match(/\d+/)||[],X=M?`${+M+1}.`:"-",se=`
${ue}${X}${me}`;_.setRangeText(se,Y,Y);const Fe=Y+se.length;_.setSelectionRange(Fe,Fe)}else{const M=Y-I.length;_.setRangeText("",M,Y)}sa(_),_.dispatchEvent(new Event("input"))}}catch{}T.current&&(T.current.scrollTop=_.scrollTop)},onInput:z=>{const{target:D}=z,_=D.value;b(_),sa(D),m.onInput?.(z),L(_),le()},onScroll:z=>{if(T.current){const{scrollTop:D}=z.target;T.current.scrollTop=D}},onPaste:z=>{try{const D=z.clipboardData.getData("text").trim();D&&F?.({name:"pasted-link",url:D})}catch{}}}),r("div",{ref:T,class:"compose-highlight","aria-hidden":"true"})]})}),Xi=100,Fn=1,ua=2,ca=.5,Ta=ba(({emoji:m,onClick:u,showCode:g})=>{const b=y=>{const A=y.currentTarget.closest("main");if(A){const S=A.getBoundingClientRect(),P=y.currentTarget.getBoundingClientRect(),T=y.currentTarget.classList;P.left<S.left+88?(T.add("edge-left"),T.remove("edge-right")):P.right>S.right-88?(T.add("edge-right"),T.remove("edge-left")):T.remove("edge-left","edge-right")}};return r("button",{type:"button",className:"plain4",onClick:u,"data-title":g?void 0:m.shortcode,onPointerEnter:b,onFocus:b,children:[r("picture",{children:[!!m.staticUrl&&r("source",{srcSet:m.staticUrl,media:"(prefers-reduced-motion: reduce)"}),r("img",{className:"shortcode-emoji",src:m.url||m.staticUrl,alt:m.shortcode,width:"24",height:"24",loading:"lazy",decoding:"async"})]}),g&&r(Kt,{children:[" ",r("code",{children:m.shortcode})]})]})}),Ss=ba(({emojis:m,onSelect:u})=>{const{i18n:g}=Lt(),[b,y]=oe(Xi),F=m.length>b;return r("section",{children:[m.slice(0,b).map(A=>r(Ta,{emoji:A,onClick:()=>{u(`:${A.shortcode}:`)}},A.shortcode)),F&&r("button",{type:"button",class:"plain small",onClick:()=>y(b+Xi),children:r(ie,{id:"iAB71E",values:{0:g.number(m.length-b)}})})]})}),In="composer-customEmojiSize";function Ts({masto:m,instance:u,onClose:g=()=>{},onSelect:b=()=>{},defaultSearchTerm:y}){const{_:F}=Lt(),[A,S]=oe("default"),P=ce([]),[T,L]=oe([]),le=hn(()=>mt.account.get("recentlyUsedCustomEmojis")||[]),z=ce();Ae(()=>{S("loading"),(async()=>{try{const[M,X]=await Aa(u,m);z.current=X,L(M),S("default")}catch{S("error")}})()},[]);const D=hn(()=>{const M={"--recent--":le.filter(se=>T.find(Fe=>Fe.shortcode===se.shortcode))},X=[];return T.forEach(se=>{if(P.current?.push?.(se),!se.category){X.push(se);return}M[se.category]||(M[se.category]=[]),M[se.category].push(se)}),X.length&&(M["--others--"]=X),M},[T]),_=ce(),[B,U]=oe(null),[Y,he]=oe(mt.local.get(In)||Fn),I=ni(()=>{const M=Math.max(Fn,Y-ca);he(M),M===Fn?mt.local.del(In):mt.local.set(In,M)},[Y]),W=ni(()=>{const M=Math.min(ua,Y+ca);he(M),M===Fn?mt.local.del(In):mt.local.set(In,M)},[Y]),ue=ni(M=>{const{value:X}=M.target;if(X){const se=z.current?.search(X,{limit:Xi});U(se.map(Fe=>Fe.item)),_.current?.scrollTo?.(0,0)}else U(null)},[T]);Ae(()=>{y&&T?.length&&ue({target:{value:y}})},[y,ue,T]);const de=ni(M=>{b?.(M),g?.(),queueMicrotask(()=>{let X=mt.account.get("recentlyUsedCustomEmojis")||[];const se=X.findIndex(Fe=>Fe.shortcode===M.shortcode);se!==-1?(X.splice(se,1),X.unshift(M)):(X.unshift(M),X=X.filter(Fe=>P.current?.find?.(Ge=>Ge.shortcode===Fe.shortcode)),X=X.slice(0,10)),mt.account.set("recentlyUsedCustomEmojis",X)})},[b]),me=ce();Ae(()=>{me.current&&(me.current.focus(),me.current.value&&(me.current.selectionStart=me.current.value.length,me.current.selectionEnd=me.current.value.length))},[]);const ve=!!T?.length;return r("div",{id:"custom-emojis-sheet",class:"sheet",style:{"--custom-emoji-size":Y},children:[!!g&&r("button",{type:"button",class:"sheet-close",onClick:g,children:r(te,{icon:"x",alt:F({id:"yz7wBu"})})}),r("header",{children:[r("div",{children:[r("b",{children:r(ie,{id:"8i6Ueo"})})," ",A==="loading"?r(ui,{}):r("small",{class:"insignificant",children:[" • ",u]})]}),ve&&r("form",{onSubmit:M=>{M.preventDefault();const X=B[0];X&&de(`:${X.shortcode}:`)},children:r("input",{ref:me,type:"search",placeholder:F({id:"EarrCe"}),onInput:ue,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",enterKeyHint:"search",defaultValue:y||""})})]}),r("main",{ref:_,children:ve?r(Kt,{children:[B!==null?r("ul",{class:"custom-emojis-matches custom-emojis-list",children:B.map(M=>r("li",{class:"custom-emojis-match",children:r(Ta,{emoji:M,onClick:()=>{de(`:${M.shortcode}:`)},showCode:!0})},M.shortcode))}):r("div",{class:"custom-emojis-list",children:[A==="error"&&r("div",{class:"ui-state",children:r("p",{children:r(ie,{id:"Kzwsg2"})})}),A==="default"&&Object.entries(D).map(([M,X])=>!!X?.length&&r("div",{class:"section-container",children:[r("div",{class:"section-header",children:{"--recent--":F({id:"uabU9X"}),"--others--":F({id:"NuKR0h"})}[M]||M}),r(Ss,{emojis:X,onSelect:de})]}))]}),r("div",{class:"size-range",children:[r("button",{type:"button",class:"plain4",onClick:I,disabled:Y<=Fn,children:r(te,{icon:"zoom-out",size:"l",alt:F({id:"FjkaiT"})})}),r("button",{type:"button",class:"plain4",onClick:W,disabled:Y>=ua,children:r(te,{icon:"zoom-in",size:"l",alt:F({id:"AWOSPo"})})})]})]}):r("div",{class:"ui-state",children:r("p",{children:r(ie,{id:"oQIgSu"})})})})]})}function la({hidden:m,supportedMimeTypes:u,maxMediaAttachments:g,mediaAttachments:b,disabled:y=!1,setMediaAttachments:F}){return r("input",{type:"file",hidden:m,accept:u?.join(","),multiple:g===void 0||g-b>=2,disabled:y,onChange:A=>{const S=A.target.files;if(!S)return;const P=Array.from(S).map(T=>({file:T,type:T.type,size:T.size,url:URL.createObjectURL(T),id:null,description:null}));b.length+P.length>g?alert(Pn._({id:"ctFhjs",values:{maxMediaAttachments:g}})):F(T=>T.concat(P)),A.target.value=""}})}const Cs="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",Fs={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_GIPHY_API_KEY:Is}=Fs,Vi=20;function Ps({onClose:m=()=>{},onSelect:u=()=>{}}){const{i18n:g,_:b}=Lt(),[y,F]=oe("default"),[A,S]=oe([]),P=ce(null),T=ce(null),L=ce(0),le=ce(null);function z({offset:_}){T.current?.value&&(F("loading"),le.current?.scrollTo?.({top:0,left:0,behavior:"smooth"}),(async()=>{try{const B={api_key:Is,q:T.current.value,rating:"g",limit:Vi,bundle:"messaging_non_clips",offset:_,lang:g.locale||"en"},U=await fetch("https://api.giphy.com/v1/gifs/search?"+new URLSearchParams(B),{referrerPolicy:"no-referrer"}).then(Y=>Y.json());L.current=U.pagination?.offset||0,S(U),F("results")}catch{F("error")}})())}Ae(()=>{T.current?.focus()},[]);const D=ci(()=>{z({offset:0})},1e3);return r("div",{id:"gif-picker-sheet",class:"sheet",children:[!!m&&r("button",{type:"button",class:"sheet-close",onClick:m,children:r(te,{icon:"x",alt:b({id:"yz7wBu"})})}),r("header",{children:r("form",{ref:P,onSubmit:_=>{_.preventDefault(),z({offset:0})},children:[r("input",{ref:T,type:"search",name:"q",placeholder:b({id:"wxlF9B"}),required:!0,autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",enterKeyHint:"search",onInput:D}),r("input",{type:"image",class:"powered-button",src:Cs,width:"86",height:"30",alt:b({id:"c1Q/eU"})})]})}),r("main",{ref:le,class:y==="loading"?"loading":"",children:[y==="default"&&r("div",{class:"ui-state",children:r("p",{class:"insignificant",children:r(ie,{id:"9KEidY"})})}),y==="loading"&&!A?.data?.length&&r("div",{class:"ui-state",children:r(ui,{abrupt:!0})}),A?.data?.length>0?r(Kt,{children:[r("ul",{children:A.data.map(_=>{const{id:B,images:U,title:Y,alt_text:he}=_,{fixed_height_small:I,fixed_height_downsampled:W,fixed_height:ue,original:de}=U,me=I?.url?I:W?.url?W:ue;let{url:ve,webp:M,width:X,height:se}=me;+se>100&&(X=X/se*100,se=100);const Fe=URL.parse(ve),Ge=Fe.origin+Fe.pathname;let Re;if(M){const pe=URL.parse(M);Re=pe.origin+pe.pathname}return r("li",{children:r("button",{type:"button",onClick:()=>{const{mp4:pe,url:Ke}=de,He=pe||Ke,Ve=URL.parse(He),rt=Ve.origin+Ve.pathname;m(),u({url:rt,type:pe?"video/mp4":"image/gif",alt_text:he||Y})},children:r("figure",{style:{"--figure-width":X+"px"},children:[r("picture",{children:[Re&&r("source",{srcset:Re,type:"image/webp"}),r("img",{src:Ge,width:X,height:se,loading:"lazy",decoding:"async",alt:he,referrerpolicy:"no-referrer",onLoad:pe=>{pe.target.style.backgroundColor="transparent"}})]}),r("figcaption",{children:he||Y})]})})},B)})}),r("p",{class:"pagination",children:[A.pagination?.offset>0&&r("button",{type:"button",class:"light small",disabled:y==="loading",onClick:()=>{z({offset:A.pagination?.offset-Vi})},children:[r(te,{icon:"chevron-left"}),r("span",{children:r(ie,{id:"DHhJ7s"})})]}),r("span",{}),A.pagination?.offset+A.pagination?.count<A.pagination?.total_count&&r("button",{type:"button",class:"light small",disabled:y==="loading",onClick:()=>{z({offset:A.pagination?.offset+Vi})},children:[r("span",{children:r(ie,{id:"hXzOVo"})})," ",r(te,{icon:"chevron-right"})]})]})]}):y==="results"&&r("div",{class:"ui-state",children:r("p",{children:"No results"})}),y==="error"&&r("div",{class:"ui-state",children:r("p",{children:r(ie,{id:"PbFw9n"})})})]})]})}var Ln={exports:{}};const qi=ko(Yo);var Ls=Ln.exports,da;function Os(){return da||(da=1,(function(m,u){(function(g,b){m.exports=b()})(Object(typeof self<"u"?self:Ls),function(){return(function(){"use strict";var g={d:function(e,t){for(var n in t)g.o(t,n)&&!g.o(e,n)&&Object.defineProperty(e,n,{enumerable:1,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:1})}},b={};function y(e,t,n){for(var a=[],o=0;o<n&&t+o<e.byteLength;o++)a.push(e.getUint8(t+o));return A(a)}function F(e,t){for(var n=[],a=0;t+a<e.byteLength;){var o=e.getUint8(t+a);if(o===0)break;n.push(o),a++}return A(n)}function A(e){return e.map(function(t){return String.fromCharCode(t)}).join("")}function S(){for(var e=1;e<arguments.length;e++)for(var t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}g.r(b),g.d(b,{default:function(){return co},errors:function(){return lo},load:function(){return Cr},loadView:function(){return Pi}});var P=void 0;function T(e){return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(e)}function L(e){var t=(function(n){if(T(n)!="object"||!n)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,"string");if(T(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return n+""})(e);return T(t)=="symbol"?t:t+""}var le=(function(){return e=function n(a){if((function(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")})(this,n),(function(o){return T(o)!=="object"||o.length===void 0||o.readUInt8===void 0||o.readUInt16LE===void 0||o.readUInt16BE===void 0||o.readUInt32LE===void 0||o.readUInt32BE===void 0||o.readInt32LE===void 0||o.readInt32BE===void 0})(a))throw Error("DataView: Passed buffer type is unsupported.");this.buffer=a,this.byteLength=this.buffer.length},(t=[{key:"getUint8",value:function(n){return this.buffer.readUInt8(n)}},{key:"getUint16",value:function(n,a){return a?this.buffer.readUInt16LE(n):this.buffer.readUInt16BE(n)}},{key:"getUint32",value:function(n,a){return a?this.buffer.readUInt32LE(n):this.buffer.readUInt32BE(n)}},{key:"getInt32",value:function(n,a){return a?this.buffer.readInt32LE(n):this.buffer.readInt32BE(n)}}])&&(function(n,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||0,s.configurable=1,"value"in s&&(s.writable=1),Object.defineProperty(n,L(s.key),s)}})(e.prototype,t),Object.defineProperty(e,"prototype",{writable:0}),e;var e,t})(),z={USE_FILE:1,USE_JFIF:1,USE_PNG_FILE:1,USE_EXIF:1,USE_IPTC:1,USE_XMP:1,USE_ICC:1,USE_MPF:1,USE_PHOTOSHOP:1,USE_THUMBNAIL:1,USE_TIFF:1,USE_JPEG:1,USE_PNG:1,USE_HEIC:1,USE_AVIF:1,USE_WEBP:1,USE_GIF:1,USE_MAKER_NOTES:1};function D(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}var _=18761,B=19789,U=_,Y=2,he=65496,I=2,W=4,ue=2,de=10,me=18,ve=33,M=79,X=65472,se=65474,Fe=65476,Ge=65499,Re=65501,pe=65498,Ke=65504,He=65505,Ve=65517,rt=65519,J=65534,Ee=65535,ye="Exif",$e="http://ns.adobe.com/xap/1.0/\0",De="http://ns.adobe.com/xmp/extension/\0",qe="Photoshop 3.0";function at(e,t){var n=ye.length;return e.getUint16(t)===He&&y(e,t+W,n)===ye&&e.getUint8(t+W+n)===0}function ne(e,t){return e.getUint16(t)===He&&(function(n,a){var o=$e.length;return y(n,a+W,o)===$e})(e,t)}function fe(e,t){return e.getUint16(t)===He&&(function(n,a){var o=De.length;return y(n,a+W,o)===De})(e,t)}function xe(e,t){return{dataOffset:e+ve,length:t-(ve-ue)}}function ge(e,t){return{dataOffset:e+M,length:t-(M-ue)}}function Ue(e,t){var n=qe.length;return e.getUint16(t)===Ve&&y(e,t+W,n)===qe&&e.getUint8(t+W+n)===0}function ct(e,t){var n=e.getUint16(t);return n>=Ke&&n<=rt||n===J||n===X||n===se||n===Fe||n===Ge||n===Re||n===pe}function re(e,t){return e.getUint16(t)===Ee}function Ie(e,t,n,a){var o=(function(c,d,p){try{if(d+8>p)return;var h=c.getUint16(d+0),l=h===U;if(!l&&h!==19789||c.getUint16(d+2,l)!==42)return;var f=d+c.getUint32(d+4,l);if(f+2>p)return;var w=c.getUint16(f,l);return{ifdEntries:w,isValid:f+(2+12*w+4)<=p&&w>0}}catch{return}})(e,a,t+ue+n);if(!o)return 0;var s=Number.isInteger(o.ifdEntries)?o.ifdEntries:0;return(o.isValid?1e9:0)+1e6*s+n}var Se=`‰PNG\r

`,lt=4,Pe=4,dt=0,ot=lt,Te=lt+Pe,Ht="XML:com.adobe.xmp\0",Ot="tEXt",ft="iTXt",_t="zTXt",Le="pHYs",ze="tIME",li="eXIf";function di(e,t){return y(e,t+ot,Pe)===ft&&y(e,t+Te,Ht.length)===Ht}function ht(e,t,n){var a=y(e,t+ot,Pe);return a===Ot||a===ft||a===_t&&n}function We(e,t){return y(e,t+ot,Pe)===li}function _n(e,t){var n=[Le,ze],a=y(e,t+ot,Pe);return n.includes(a)}function Vt(e,t){t+=Te+Ht.length+1+1;for(var n=0;n<2&&t<e.byteLength;)e.getUint8(t)===0&&n++,t++;if(!(n<2))return t}function qt(e,t,n,a,o,s,c,d){if(d===void 0)return[];for(var p=[],h=n.items,l=0;l<d;l++){var f={extents:[]};f.itemId=Rt(e,h,t),h+=a.item.itemId,f.constructionMethod=t===1||t===2?15&e.getUint16(h):void 0,h+=a.item.constructionMethod,f.dataReferenceIndex=e.getUint16(h),h+=a.item.dataReferenceIndex,f.baseOffset=zt(e,h,a.item.baseOffset),h+=a.item.baseOffset,f.extentCount=e.getUint16(h),h+=a.item.extentCount;for(var w=0;w<f.extentCount;w++){var x={};x.extentIndex=Wt(e,t,h,c),h+=a.item.extent.extentIndex,x.extentOffset=zt(e,h,o),h+=a.item.extent.extentOffset,x.extentLength=zt(e,h,s),h+=a.item.extent.extentLength,f.extents.push(x)}p.push(f)}return p}function Rt(e,t,n){return n<2?e.getUint16(t):n===2?e.getUint32(t):void 0}function Wt(e,t,n,a){if((t===1||t===2)&&a>0)return zt(e,n,a)}function zt(e,t,n){return n===4?e.getUint32(t):n===8?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),(function(a,o){return a.getUint32(o+4)})(e,t)):0}var pn=1165519206,Yt=1835625829;function Mt(e,t){var n=(function(d,p){var h=d.getUint32(p);return(function(l){return l===0})(h)?{length:d.byteLength-p,contentOffset:p+4+4}:(function(l){return l===1})(h)&&(function(l,f){return l.getUint32(f+8)===0})(d,p)?{length:d.getUint32(p+12),contentOffset:p+4+4+8}:{length:h,contentOffset:p+4+4}})(e,t),a=n.length,o=n.contentOffset;if(!(a<8)){var s=e.getUint32(t+4);if(s===1718909296)return(function(d,p,h){return{type:"ftyp",majorBrand:y(d,p,4),length:h}})(e,o,a);if(s===1768977008)return(function(d,p,h,l){return{type:"iprp",subBoxes:Et(d,h,l-(h-p)),length:l}})(e,t,o,a);if(s===1768973167)return(function(d,p,h,l){return{type:"ipco",properties:Et(d,h,l-(h-p)),length:l}})(e,t,o,a);if(s===1668246642)return(function(d,p,h){return{type:"colr",icc:fi(d,p),length:h}})(e,o,a);var c=e.getUint8(o);return s===1835365473?(function(d,p,h,l){return{type:"meta",subBoxes:Et(d,h+3,l-(h+3-p)),length:l}})(e,t,o+1,a):s===1768714083?(function(d,p,h,l){var f=(function(j,ee){var ae={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};j<2?(ae.itemCount=2,ae.item.itemId=2):j===2&&(ae.itemCount=4,ae.item.itemId=4),ae.item.constructionMethod=j===1||j===2?2:0;var we={offsetSize:ee,lengthSize:ee,baseOffsetSize:ee+1,indexSize:ee+1};return we.itemCount=ee+2,we.items=we.itemCount+ae.itemCount,we.item={itemId:0},we.item.constructionMethod=we.item.itemId+ae.item.itemId,we.item.dataReferenceIndex=we.item.constructionMethod+ae.item.constructionMethod,{offsets:we,sizes:ae}})(p,h+3),w=f.offsets,x=f.sizes,k=d.getUint8(w.offsetSize)>>4;x.item.extent.extentOffset=k;var C=15&d.getUint8(w.lengthSize);x.item.extent.extentLength=C;var K=d.getUint8(w.baseOffsetSize)>>4;x.item.baseOffset=K;var $=(function(j,ee,ae){if(ae===1||ae===2)return 15&j.getUint8(ee)})(d,w.indexSize,p);x.item.extent.extentIndex=$!==void 0?$:0;var q=(function(j,ee,ae){return ae<2?j.getUint16(ee):ae===2?j.getUint32(ee):void 0})(d,w.itemCount,p);return{type:"iloc",items:qt(d,p,w,x,k,C,$,q),length:l}})(e,c,o+1,a):s===1768517222?(function(d,p,h,l,f){var w=(function(k,C){var K={entryCount:C+3},$={};return $.entryCount=k===0?2:4,K.itemInfos=K.entryCount+$.entryCount,{offsets:K}})(h,l),x=w.offsets;return{type:"iinf",itemInfos:Et(d,x.itemInfos,f-(x.itemInfos-p)),length:f}})(e,t,c,o+1,a):s===1768842853?(function(d,p,h,l,f){l+=3;var w={type:"infe",length:f};return h!==0&&h!==1||(w.itemId=d.getUint16(l),l+=2,w.itemProtectionIndex=d.getUint16(l),l+=2,w.itemName=F(d,l),l+=w.itemName.length+1),h>=2&&(h===2?(w.itemId=d.getUint16(l),l+=2):h===3&&(w.itemId=d.getUint32(l),l+=4),w.itemProtectionIndex=d.getUint16(l),l+=2,w.itemType=d.getUint32(l),l+=4,w.itemName=F(d,l),l+=w.itemName.length+1,w.itemType===Yt?(w.contentType=F(d,l),p+f>(l+=w.contentType.length+1)&&(w.contentEncoding=F(d,l),l+=w.contentEncoding.length+1)):w.itemType===1970432288&&(w.itemUri=F(d,l),l+=w.itemUri.length+1)),w})(e,t,c,o+1,a):{type:void 0,length:a}}}function jt(e,t){return e.subBoxes.find(function(n){return n.type==="iloc"}).items.find(function(n){return n.itemId===t})}function fi(e,t){var n=y(e,t,4);if(n==="prof"||n==="rICC")return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function Et(e,t,n){for(var a=[pn,Yt],o=[],s=t;s<t+n;){var c=Mt(e,s);if(c===void 0)break;c.type===void 0||c.itemType!==void 0&&a.indexOf(c.itemType)===-1||o.push(c),s+=c.length}return o}var gn=0,Xt="<?xpacket begin",Rn={parseAppMarkers:function(e,t){if((function(n){return!!n&&n.byteLength>=Y&&n.getUint16(0)===he})(e))return At((function(n){for(var a,o,s,c,d,p,h,l,f=I,w=0;f+W+5<=n.byteLength;){if(at(n,f)){a=n.getUint16(f+ue),w++;var x=f+de;if(w===1)p=x,h=f,l=a;else if(w===2){d=Ie(n,h,l,p);var k=Ie(n,f,a,x);k>d&&(d=k,p=x,h=f,l=a)}else{var C=Ie(n,f,a,x);C>d&&(d=C,p=x,h=f,l=a)}o=p}else if(ne(n,f))c||(c=[]),a=n.getUint16(f+ue),c.push(xe(f,a));else if(fe(n,f))c||(c=[]),a=n.getUint16(f+ue),c.push(ge(f,a));else if(Ue(n,f))a=n.getUint16(f+ue),s=f+me;else{if(!ct(n,f)){if(re(n,f)){f++;continue}break}a=n.getUint16(f+ue)}f+=ue+a}return w>1&&(function(K){typeof console<"u"&&typeof console.warn=="function"&&console.warn("ExifReader: Found ".concat(K," Exif segments (APP1). ")+"Will pick the best candidate segment.")})(w),{hasAppMarkers:f>I,fileDataOffset:void 0,jfifDataOffset:void 0,tiffHeaderOffset:o,iptcDataOffset:s,xmpChunks:c,iccChunks:void 0,mpfDataOffset:void 0}})(e),"jpeg","JPEG");if((function(n){return!!n&&y(n,0,Se.length)===Se})(e))return At((function(n,a){for(var o={hasAppMarkers:0},s=Se.length;s+lt+Pe<=n.byteLength;){if(di(n,s)){var c=Vt(n,s);c!==void 0&&(o.hasAppMarkers=1,o.xmpChunks=[{dataOffset:c,length:n.getUint32(s+dt)-(c-(s+Te))}])}else if(ht(n,s,a)){o.hasAppMarkers=1;var d=y(n,s+ot,Pe);o.pngTextChunks||(o.pngTextChunks=[]),o.pngTextChunks.push({length:n.getUint32(s+dt),type:d,offset:s+Te})}else We(n,s)?(o.hasAppMarkers=1,o.tiffHeaderOffset=s+Te):_n(n,s)&&(o.hasAppMarkers=1,o.pngChunkOffsets||(o.pngChunkOffsets=[]),o.pngChunkOffsets.push(s+dt));s+=n.getUint32(s+dt)+lt+Pe+4}return o})(e,t),"png","PNG");if((function(n){if(!n)return 0;try{var a=Mt(n,0);return a&&["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"].indexOf(a.majorBrand)!==-1}catch{return 0}})(e))return At((function(n){return(function(a){var o={},s=(function(c){for(var d=0;d+4+4<=c.byteLength;){var p=Mt(c,d);if(p===void 0)break;if(p.type==="meta")return p;d+=p.length}})(a);return s?(o.tiffHeaderOffset=(function(c,d){try{var p=(function(l){return l.subBoxes.find(function(f){return f.type==="iinf"}).itemInfos.find(function(f){return f.itemType===pn})})(d).itemId,h=jt(d,p);return(function(l,f){return f+4+l.getUint32(f)})(c,h.baseOffset+h.extents[0].extentOffset)}catch{return}})(a,s),o.xmpChunks=(function(c){try{var d=(function(l){return l.subBoxes.find(function(f){return f.type==="iinf"}).itemInfos.find(function(f){return f.itemType===Yt&&f.contentType==="application/rdf+xml"})})(c).itemId,p=jt(c,d),h=jt(c,d).extents[0];return[{dataOffset:p.baseOffset+h.extentOffset,length:h.extentLength}]}catch{return}})(s),o.hasAppMarkers=o.tiffHeaderOffset!==void 0||o.xmpChunks!==void 0||o.iccChunks!==void 0,o):{hasAppMarkers:0}})(n)})(e),"heic","HEIC");if((function(n){return!!n&&y(n,0,4)==="RIFF"&&y(n,8,4)==="WEBP"})(e))return At((function(n){for(var a,o,s,c=12,d=0;c+8<n.byteLength;){var p=y(n,c,4),h=n.getUint32(c+4,1);p==="EXIF"?(d=1,a=y(n,c+8,6)==="Exif\0\0"?c+8+6:c+8):p==="XMP "?(d=1,o=[{dataOffset:c+8,length:h}]):p==="VP8X"&&(d=1,s=c+8),c+=8+(h%2==0?h:h+1)}return{hasAppMarkers:d,tiffHeaderOffset:a,xmpChunks:o,iccChunks:void 0,vp8xChunkOffset:s}})(e),"webp","WebP");if((function(n){return!!n&&y(n,gn,Xt.length)===Xt})(e))return At((function(n){var a=[];return a.push({dataOffset:gn,length:n.byteLength}),{xmpChunks:a}})(e),"xml","XML");throw Error("Invalid image format")}};function At(e,t,n){return S({},e,{fileType:{value:t,description:n}})}var Jt={270:"ImageDescription",700:"ApplicationNotes",33723:"IPTC-NAA",34665:"Exif IFD Pointer"};function St(e){return St=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},St(e)}function Ye(e,t,n){return(t=(function(a){var o=(function(s){if(St(s)!="object"||!s)return s;var c=s[Symbol.toPrimitive];if(c!==void 0){var d=c.call(s,"string");if(St(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return s+""})(a);return St(o)=="symbol"?o:o+""})(t))in e?Object.defineProperty(e,t,{value:n,enumerable:1,configurable:1,writable:1}):e[t]=n,e}var Zt=S({},Jt,{}),vt="exif",zn="interoperability",Ut="pentax",Me=Ye(Ye(Ye(Ye(Ye(Ye(Ye(Ye({},"0th",Zt),"1st",Jt),vt,Zt),"gps",{}),zn,{}),"mpf",{}),"canon",{}),Ut,{}),Mn={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},mn={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},N={getAsciiValue:function(e){return e.map(function(t){return String.fromCharCode(t)})},getByteAt:vn,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===U)},getLongAt:Qt,getRationalAt:function(e,t,n){return[Qt(e,t,n),Qt(e,t+4,n)]},getUndefinedAt:function(e,t){return vn(e,t)},getSlongAt:Xe,getSrationalAt:function(e,t,n){return[Xe(e,t,n),Xe(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return Qt(e,t,n)},typeSizes:Mn,tagTypes:mn,getTypeSize:function(e){if(mn[e]===void 0)throw Error("No such type found.");return Mn[mn[e]]}};function vn(e,t){return e.getUint8(t)}function Qt(e,t,n){return e.getUint32(t,n===U)}function Xe(e,t,n){return e.getInt32(t,n===U)}var jn={exif:1,iptc:1,photoshop:1,mpf:1,makerNotes:1},Tt={exif:1,iptc:1,xmp:1,icc:1,photoshop:1,makerNotes:1,mpf:1,file:1,jfif:1,png:1,riff:1,gif:1,gps:1,composite:1,thumbnail:1},bt={exifIfdPointer:"Exif IFD Pointer",gpsInfoIfdPointer:"GPS Info IFD Pointer",interoperabilityIfdPointer:"Interoperability IFD Pointer"},bn={thumbnail:["JPEGInterchangeFormat","JPEGInterchangeFormatLength"],iptc:["IPTC-NAA"],xmp:["ApplicationNotes"],icc:["ICC_Profile"],photoshop:["ImageSourceData","PhotoshopSettings"],makerNotes:["MakerNote","Make"],gps:["GPSLatitude","GPSLatitudeRef","GPSLongitude","GPSLongitudeRef","GPSAltitude","GPSAltitudeRef"]},yn={file:["Image Width","Image Height"],exif:["FocalLength","FocalPlaneXResolution","FocalPlaneYResolution","FocalPlaneResolutionUnit","FocalLengthIn35mmFilm"]};function Un(e){return e==1?1:Array.isArray(e)&&e.length>0}function Dn(){return{isActive:0,shouldReturnGroup:e,shouldParseGroup:e,shouldReturnTag:e,shouldParseTag:e};function e(){return 1}}var Dt=Dn();function Bn(e){var t=e.groupKey,n=e.hasIncludeTags,a=e.hasIncludeEntry,o=e.includeTags,s=e.shouldParseExif,c=e.shouldParseFile;return n?a?t==="thumbnail"&&Array.isArray(o[t])?1:o[t]:t==="exif"&&s||t==="file"&&c?[]:void 0:1}function en(e){var t=e.groupKey,n=e.hasIncludeTags,a=e.hasIncludeEntry,o=e.shouldParseExif,s=e.shouldParseFile,c=e.exifIncludeDependencies,d=e.fileIncludeDependencies;return n?t==="exif"&&(o||a&&Object.keys(c).length>0)?c:t==="file"&&s?d:Object.create(null):Object.create(null)}function Je(e,t){if(!e||!Object.prototype.hasOwnProperty.call(e,t))return 0;var n=e[t];return n==1?1:Array.isArray(n)&&n.length>0}function hi(e){return Array.isArray(e)&&e.length===0}function Nn(e){var t=e.groupKey,n=e.includeValue,a=e.excludeValue,o=e.extraIncludeNames,s=!!jn[t],c={includeAll:0,includeNames:void 0,includeIds:void 0,excludeAll:0,excludeNames:void 0,excludeIds:void 0};if(n==1)c.includeAll=1;else if(Array.isArray(n)){c.includeNames=Object.create(null),s&&(c.includeIds=Object.create(null));for(var d=0;d<n.length;d++)f(c,n[d]);for(var p in o)c.includeNames[p.toLowerCase()]=1}else if(o&&Object.keys(o).length>0)for(var h in c.includeNames=Object.create(null),o)c.includeNames[h.toLowerCase()]=1;if(a==1)return c.excludeAll=1,c;if(Array.isArray(a)){c.excludeNames=Object.create(null),s&&(c.excludeIds=Object.create(null));for(var l=0;l<a.length;l++)w(c,a[l])}return c;function f(x,k){typeof k=="number"&&x.includeIds?x.includeIds[k+""]=1:typeof k=="string"&&(x.includeNames[k.toLowerCase()]=1)}function w(x,k){typeof k=="number"&&x.excludeIds?x.excludeIds[k+""]=1:typeof k=="string"&&(x.excludeNames[k.toLowerCase()]=1)}}function xn(e,t,n){return e.excludeAll?0:e.includeAll?!tn(e,t,n):e.includeNames||e.includeIds?(function(a,o,s){return s!==void 0&&a.includeIds&&a.includeIds[s+""]||o&&a.includeNames&&a.includeNames[(o+"").toLowerCase()]?1:0})(e,t,n)?!tn(e,t,n):0:!tn(e,t,n)}function tn(e,t,n){return n!==void 0&&e.excludeIds&&e.excludeIds[n+""]||t&&e.excludeNames&&e.excludeNames[(t+"").toLowerCase()]?1:0}var Gn={1:N.getByteAt,2:N.getAsciiAt,3:N.getShortAt,4:N.getLongAt,5:N.getRationalAt,7:N.getUndefinedAt,9:N.getSlongAt,10:N.getSrationalAt,13:N.getIfdPointerAt};function v(e,t,n,a,o,s){var c=arguments.length>6&&arguments[6]!==void 0?arguments[6]:0,d=arguments.length>7&&arguments[7]!==void 0?arguments[7]:Dt,p=arguments.length>8&&arguments[8]!==void 0?arguments[8]:"exif",h=N.getTypeSize("SHORT"),l={},f=(function(k,C,K){return C+N.getTypeSize("SHORT")<=k.byteLength?N.getShortAt(k,C,K):0})(e,a,o);a+=h;for(var w=0;w<f&&!(a+12>e.byteLength);w++){var x=E(e,t,n,a,o,s,d,p);x!==void 0&&(l[x.name]={id:x.id,value:x.value,description:x.description},c&&(l[x.name].computed=H(x.tagType,x.value)),(x.name==="MakerNote"||t===Ut&&x.name==="LevelInfo")&&(l[x.name].__offset=x.__offset)),a+=12}return l}function E(e,t,n,a,o){var s,c,d=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,p=arguments.length>6&&arguments[6]!==void 0?arguments[6]:Dt,h=arguments.length>7&&arguments[7]!==void 0?arguments[7]:"exif",l=N.getTypeSize("SHORT"),f=l+N.getTypeSize("SHORT"),w=f+N.getTypeSize("LONG"),x=N.getShortAt(e,a,o),k=N.getShortAt(e,a+l,o),C=N.getLongAt(e,a+f,o);if(N.typeSizes[k]!==void 0&&(d||Me[t][x]!==void 0)){var K=(function(q,j){if(Me[q][j]!==void 0){if(typeof Me[q][j]=="string")return Me[q][j];if(Me[q][j].name)return Me[q][j].name}return"undefined-".concat(j)})(t,x);if(p.shouldParseTag(h,K,x)){s=(function(q,j){return N.typeSizes[q]*j<=N.getTypeSize("LONG")})(k,C)?R(e,c=a+w,k,C,o):(function(q,j,ee,ae,we){return j+ee+N.typeSizes[ae]*we<=q.byteLength})(e,n,c=N.getLongAt(e,a+w,o),k,C)?R(e,n+c,k,C,o,x===33723):"<faulty value>",k===N.tagTypes.ASCII&&(s=(function(q){try{return q.map(function(j){return decodeURIComponent(escape(j))})}catch{return q}})(s=(function(q){for(var j=[],ee=0,ae=0;ae<q.length;ae++)q[ae]!=="\0"?(j[ee]===void 0&&(j[ee]=""),j[ee]+=q[ae]):ee++;return j})(s)));var $=s;if(Me[t][x]!==void 0)if(Me[t][x].name!==void 0&&Me[t][x].description!==void 0)try{$=Me[t][x].description(s)}catch{$=O(s)}else $=k===N.tagTypes.RATIONAL||k===N.tagTypes.SRATIONAL?""+s[0]/s[1]:O(s);return{id:x,name:K,value:s,description:$,tagType:k,__offset:c}}}}function R(e,t,n,a,o){var s=[];arguments.length>5&&arguments[5]!==void 0&&arguments[5]&&(a*=N.typeSizes[n],n=N.tagTypes.BYTE);for(var c=0;c<a;c++)s.push(Gn[n](e,t,o)),t+=N.typeSizes[n];return n===N.tagTypes.ASCII?s=N.getAsciiValue(s):s.length===1&&(s=s[0]),s}function O(e){return e instanceof Array?e.join(", "):e}function H(e,t){return e===N.tagTypes.ASCII?Array.isArray(t)&&t.length===1?t[0]:t:e===N.tagTypes.RATIONAL||e===N.tagTypes.SRATIONAL?(function(n){return Array.isArray(n)&&n.length===2?typeof n[0]=="number"&&typeof n[1]=="number":0})(t)?V(t):Array.isArray(t)?t.map(function(n){return V(n)}):t:t}function V(e){if(!Array.isArray(e)||e.length!==2)return e;var t=e[0],n=e[1];return Number.isFinite(t)&&Number.isFinite(n)?n===0?null:t/n:e}var G="Exif IFD Pointer",Q="GPS Info IFD Pointer",Z="Interoperability IFD Pointer",Ze={read:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:void 0,s=(function(d,p){if(d.getUint16(p)===_)return _;if(d.getUint16(p)===B)return B;throw Error("Illegal byte order value. Faulty image.")})(e,t),c=(function(d,p,h,l,f,w){return v(d,"0th",p,(function(x,k,C){return k+N.getLongAt(x,k+4,C)})(d,p,h),h,l,f,w,"exif")})(e,t,s,n,a,o);return{tags:c=et(c=Qe(c=be(c,e,t,s,n,a,o),e,t,s,n,a,o),e,t,s,n,a,o),byteOrder:s}}};function be(e,t,n,a,o,s,c){return e[G]!==void 0?S(e,v(t,vt,n,n+e[G].value,a,o,s,c,"exif")):e}function Qe(e,t,n,a,o,s,c){return e[Q]!==void 0?S(e,v(t,"gps",n,n+e[Q].value,a,o,s,c,"exif")):e}function et(e,t,n,a,o,s,c){return e[Z]!==void 0?S(e,v(t,zn,n,n+e[Z].value,a,o,s,c,"exif")):e}var tt={iptc:{632:"Caption/Abstract"}},nt=function(e,t){var n=(function(){if(typeof TextDecoder<"u")return TextDecoder})();if(typeof n<"u"&&e!==void 0)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch{}return(function(a){try{return decodeURIComponent(escape(a))}catch{return a}})(t.map(function(a){return String.fromCharCode(a)}).join(""))},$n={read:function(e,t,n){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Dt;try{if(Array.isArray(e))return nn(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n,a);var o=(function(s,c){for(;c+12<=s.byteLength;){var d=pi(s,c);if(gi(d))return{naaBlock:d,dataOffset:c+d.headerSize};c+=d.headerSize+d.size+mi(d)}throw Error("No IPTC NAA resource block.")})(e,t);return nn(e,o.naaBlock,o.dataOffset,n,a)}catch{return{}}}};function pi(e,t){if(e.getUint32(t,0)!==943868237)throw Error("Not an IPTC resource block.");var n=e.getUint8(t+4+2),a=(n%2==0?n+1:n)+1;return{headerSize:6+a+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+a)}}function gi(e){return e.type===1028}function mi(e){return e.size%2!=0?1:0}function nn(e,t,n,a,o){for(var s={},c=void 0,d=n+t.size;n<d&&n<e.byteLength;){var p=Ca(e,n,s,c,a,o),h=p.tag,l=p.tagSize;if(h===null)break;h&&("encoding"in h&&(c=h.encoding),s[h.name]===void 0||h.repeatable===void 0?s[h.name]={id:h.id,value:h.value,description:h.description}:(s[h.name]instanceof Array||(s[h.name]=[{id:s[h.name].id,value:s[h.name].value,description:s[h.name].description}]),s[h.name].push({id:h.id,value:h.value,description:h.description}))),n+=5+l}return s}function Ca(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:void 0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Dt;if((function(l,f){return l.getUint8(f)!==28})(e,t))return{tag:null,tagSize:0};var c=e.getUint16(t+1),d=e.getUint16(t+3);if(!o&&!tt.iptc[c])return{tag:void 0,tagSize:d};if(!s.shouldParseTag("iptc",(function(l,f){var w=tt.iptc[l];return w?typeof w=="string"?w:w&&typeof w.name=="string"?w.name:void 0:f?"undefined-".concat(l):void 0})(c,o),c))return{tag:void 0,tagSize:d};var p=(function(l,f,w){for(var x=[],k=0;k<w;k++)x.push(l.getUint8(f+k));return x})(e,t+5,d),h={id:c,name:Fa(tt.iptc[c],c,p),value:p,description:Ia(tt.iptc[c],p,n,a)};return(function(l){return tt.iptc[l]&&tt.iptc[l].repeatable})(c)&&(h.repeatable=1),(function(l){return tt.iptc[l]&&tt.iptc[l].encoding_name!==void 0})(c)&&(h.encoding=tt.iptc[c].encoding_name(p)),{tag:h,tagSize:d}}function Fa(e,t,n){return e?(function(a){return typeof a=="string"})(e)?e:(function(a){return typeof a.name=="function"})(e)?e.name(n):e.name:"undefined-".concat(t)}function Ia(e,t,n,a){if((function(o){return o&&o.description!==void 0})(e))try{return e.description(t,n)}catch{}return(function(o,s){return o&&s instanceof Array})(e,t)?nt(a,t):t}var Pa=function(e){return Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},La=function(e){return"f/".concat(Number(e[0]/e[1]).toFixed(1))},Oa=function(e){return e[0]/e[1]+" mm"},_a=function(e){var t=Math.pow(2,e[0]/e[1]);return t<=1?"".concat(Math.round(1/t)):"1/".concat(Math.round(t))},Ra=function(e){return""+Math.round(e[0]/e[1])},za=function(e){return""+Math.round(e[0]/e[1])};function tr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}var Kn={"tiff:Orientation":function(e){return e==="1"?"Horizontal (normal)":e==="2"?"Mirror horizontal":e==="3"?"Rotate 180":e==="4"?"Mirror vertical":e==="5"?"Mirror horizontal and rotate 270 CW":e==="6"?"Rotate 90 CW":e==="7"?"Mirror horizontal and rotate 90 CW":e==="8"?"Rotate 270 CW":e},"tiff:ResolutionUnit":function(e){return(function(t){return t===2?"inches":t===3?"centimeters":"Unknown"})(parseInt(e,10))},"tiff:XResolution":function(e){return rn(Ra,e)},"tiff:YResolution":function(e){return rn(za,e)},"exif:ApertureValue":function(e){return rn(Pa,e)},"exif:GPSLatitude":ir,"exif:GPSLongitude":ir,"exif:FNumber":function(e){return rn(La,e)},"exif:FocalLength":function(e){return rn(Oa,e)},"exif:FocalPlaneResolutionUnit":function(e){return(function(t){return t===2?"inches":t===3?"centimeters":t===4?"millimeters":"Unknown"})(parseInt(e,10))},"exif:ColorSpace":function(e){return(function(t){return t===1?"sRGB":t===65535?"Uncalibrated":"Unknown"})((function(t){return t.substring(0,2)==="0x"?parseInt(t.substring(2),16):parseInt(t,10)})(e))},"exif:ComponentsConfiguration":function(e,t){return/^\d, \d, \d, \d$/.test(t)?(function(n){return n.map(function(a){return a===49?"Y":a===50?"Cb":a===51?"Cr":a===52?"R":a===53?"G":a===54?"B":void 0}).join("")})(t.split(", ").map(function(n){return n.charCodeAt(0)})):t},"exif:Contrast":function(e){return(function(t){return t===0?"Normal":t===1?"Soft":t===2?"Hard":"Unknown"})(parseInt(e,10))},"exif:CustomRendered":function(e){return(function(t){return t===0?"Normal process":t===1?"Custom process":"Unknown"})(parseInt(e,10))},"exif:ExposureMode":function(e){return(function(t){return t===0?"Auto exposure":t===1?"Manual exposure":t===2?"Auto bracket":"Unknown"})(parseInt(e,10))},"exif:ExposureProgram":function(e){return(function(t){return t===0?"Undefined":t===1?"Manual":t===2?"Normal program":t===3?"Aperture priority":t===4?"Shutter priority":t===5?"Creative program":t===6?"Action program":t===7?"Portrait mode":t===8?"Landscape mode":t===9?"Bulb":"Unknown"})(parseInt(e,10))},"exif:ExposureTime":function(e){return nr(e)?(function(t){if(t[0]/t[1]>.25){var n=t[0]/t[1];return Number.isInteger(n)?""+n:n.toFixed(1)}return t[0]!==0?"1/".concat(Math.round(t[1]/t[0])):"0/".concat(t[1])})(e.split("/").map(function(t){return parseInt(t,10)})):e},"exif:MeteringMode":function(e){return(function(t){return t===1?"Average":t===2?"CenterWeightedAverage":t===3?"Spot":t===4?"MultiSpot":t===5?"Pattern":t===6?"Partial":t===255?"Other":"Unknown"})(parseInt(e,10))},"exif:Saturation":function(e){return(function(t){return t===0?"Normal":t===1?"Low saturation":t===2?"High saturation":"Unknown"})(parseInt(e,10))},"exif:SceneCaptureType":function(e){return(function(t){return t===0?"Standard":t===1?"Landscape":t===2?"Portrait":t===3?"Night scene":"Unknown"})(parseInt(e,10))},"exif:Sharpness":function(e){return(function(t){return t===0?"Normal":t===1?"Soft":t===2?"Hard":"Unknown"})(parseInt(e,10))},"exif:ShutterSpeedValue":function(e){return rn(_a,e)},"exif:WhiteBalance":function(e){return(function(t){return t===0?"Auto white balance":t===1?"Manual white balance":"Unknown"})(parseInt(e,10))}};function rn(e,t){return nr(t)?e(t.split("/")):t}function nr(e){return/^-?\d+\/-?\d+$/.test(e)}function ir(e){var t,n=(function(p){if(Array.isArray(p))return p})(t=e.split(","))||(function(p){var h=p==null?null:typeof Symbol<"u"&&p[Symbol.iterator]||p["@@iterator"];if(h!=null){var l,f,w,x,k=[],C=1,K=0;try{for(w=(h=h.call(p)).next,!1;!(C=(l=w.call(h)).done)&&(k.push(l.value),k.length!==2);C=1);}catch($){K=1,f=$}finally{try{if(!C&&h.return!=null&&(x=h.return(),Object(x)!==x))return}finally{if(K)throw f}}return k}})(t)||(function(p){if(p){if(typeof p=="string")return tr(p,2);var h={}.toString.call(p).slice(8,-1);return h==="Object"&&p.constructor&&(h=p.constructor.name),h==="Map"||h==="Set"?Array.from(p):h==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(h)?tr(p,2):void 0}})(t)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})(),a=n[0],o=n[1];if(a!==void 0&&o!==void 0){var s=parseFloat(a),c=parseFloat(o),d=o.charAt(o.length-1);if(!Number.isNaN(s)&&!Number.isNaN(c))return""+(s+c/60)+d}return e}var Ma={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};function wn(e){return wn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wn(e)}function rr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function vi(e){var t=typeof Map=="function"?new Map:void 0;return vi=function(n){if(n===null||!(function(o){try{return Function.toString.call(o).indexOf("[native code]")!==-1}catch{return typeof o=="function"}})(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(n))return t.get(n);t.set(n,a)}function a(){return(function(o,s,c){if(bi())return Reflect.construct.apply(null,arguments);var d=[null];d.push.apply(d,s);var p=new(o.bind.apply(o,d));return c&&kn(p,c.prototype),p})(n,arguments,En(this).constructor)}return a.prototype=Object.create(n.prototype,{constructor:{value:a,enumerable:0,writable:1,configurable:1}}),kn(a,n)},vi(e)}function bi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(bi=function(){return!!e})()}function kn(e,t){return kn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},kn(e,t)}function En(e){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},En(e)}var ja={read:function(e,t,n){var a={};if(typeof e=="string")return Hn(a,e,n),a;var o,s=(o=(function(l,f){if(f.length===0)return[];var w=[yi(l,f.slice(0,1))];return f.length>1&&w.push(yi(l,f.slice(1))),w})(e,t),(function(l){if(Array.isArray(l))return l})(o)||(function(l){var f=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(f!=null){var w,x,k,C,K=[],$=1,q=0;try{for(k=(f=f.call(l)).next,!1;!($=(w=k.call(f)).done)&&(K.push(w.value),K.length!==2);$=1);}catch(j){q=1,x=j}finally{try{if(!$&&f.return!=null&&(C=f.return(),Object(C)!==C))return}finally{if(q)throw x}}return K}})(o)||(function(l){if(l){if(typeof l=="string")return rr(l,2);var f={}.toString.call(l).slice(8,-1);return f==="Object"&&l.constructor&&(f=l.constructor.name),f==="Map"||f==="Set"?Array.from(l):f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f)?rr(l,2):void 0}})(o)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()),c=s[0],d=s[1],p=Hn(a,c,n);if(d){var h=Hn(a,d,n);p||h||(delete a._raw,Hn(a,yi(e,t),n))}return a}},Ua=(function(e){function t(a){var o;return(function(s,c){if(!(s instanceof c))throw new TypeError("Cannot call a class as a function")})(this,t),(o=(function(s,c,d){return c=En(c),(function(p,h){if(h&&(wn(h)=="object"||typeof h=="function"))return h;if(h!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l})(p)})(s,bi()?Reflect.construct(c,d||[],En(s).constructor):c.apply(s,d))})(this,t,[a])).name="ParseError",o}return(function(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(o&&o.prototype,{constructor:{value:a,writable:1,configurable:1}}),Object.defineProperty(a,"prototype",{writable:0}),o&&kn(a,o)})(t,e),Object.defineProperty(n=t,"prototype",{writable:0}),n;var n})(vi(Error));function yi(e,t){for(var n=t.reduce(function(p,h){return p+h.length},0),a=new Uint8Array(n),o=0,s=0;s<t.length;s++){var c=t[s],d=e.buffer.slice(c.dataOffset,c.dataOffset+c.length);a.set(new Uint8Array(d),o),o+=c.length}return new DataView(a.buffer)}function Hn(e,t,n){try{var a=(function(c,d){var p=(function(l){if(l)return l;if(typeof DOMParser<"u")return new DOMParser;try{var f=require("@xmldom/xmldom");return new f.DOMParser({onError:f.onErrorStopParsing})}catch{return}})(d);if(!p)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),Error();var h=typeof c=="string"?c:y(c,0,c.byteLength);return{doc:ar(p,h.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")),raw:h}})(t,n),o=a.doc,s=a.raw;return e._raw=(e._raw||"")+s,S(e,ur(sr(or(o),1))),1}catch{return 0}}function ar(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;try{var a=e.parseFromString(t,"application/xml"),o=a.getElementsByTagName("parsererror");if(o.length>0)throw new Ua(o[0].textContent);return a}catch(s){if(s.name==="ParseError"&&(function(c){for(var d=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/],p=0;p<d.length;p++)if(RegExp(d[p]).test(c.message))return 1;return 0})(s)&&!n)return ar(e,(function(c){var d=c.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!d)return c;var p=d[1],h=(function(f){for(var w,x=[],k=/xmlns:([\w-]+)=["'][^"']+["']/g;(w=k.exec(f))!==null;)x.indexOf(w[1])===-1&&x.push(w[1]);return x})(c),l=(function(f){for(var w,x=[],k=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;(w=k.exec(f))!==null;){var C=w[1];C!=="xmlns"&&C!=="xml"&&x.indexOf(C)===-1&&x.push(C)}return x})(c).filter(function(f){return h.indexOf(f)===-1});return l.length===0?c:(function(f,w,x){var k=RegExp("<"+w+"([^>]*)>");return f.replace(k,"<"+w+"$1"+x+">")})(c,p,(function(f){for(var w=[],x=0;x<f.length;x++){var k=f[x],C=Ma[k]||"http://fallback.namespace/"+k;w.push(" xmlns:"+k+'="'+C+'"')}return w.join("")})(l))})(t),1);throw s}}function or(e){for(var t=0;t<e.childNodes.length;t++){if(e.childNodes[t].tagName==="x:xmpmeta")return or(e.childNodes[t]);if(e.childNodes[t].tagName==="rdf:RDF")return e.childNodes[t]}throw Error()}function sr(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(function(o){for(var s=[],c=0;c<o.childNodes.length;c++)s.push(o.childNodes[c]);return s})(e);return(t=a).length===1&&t[0].nodeName==="#text"?n?{}:(function(o){return o.nodeValue})(a[0]):(function(o){var s={};return o.forEach(function(c){if((function(p){return p.nodeName&&p.nodeName!=="#text"})(c)){var d=(function(p){return{attributes:Da(p),value:sr(p)}})(c);s[c.nodeName]!==void 0?(Array.isArray(s[c.nodeName])||(s[c.nodeName]=[s[c.nodeName]]),s[c.nodeName].push(d)):s[c.nodeName]=d}}),s})(a)}function Da(e){for(var t={},n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function ur(e){var t={};if(typeof e=="string")return e;for(var n in e){var a=e[n];Array.isArray(a)||(a=[a]),a.forEach(function(o){S(t,xi(o.attributes)),wn(o.value)==="object"&&S(t,cr(o.value))})}return t}function xi(e){var t={};for(var n in e)try{Ba(n)&&(t[qn(n)]={value:e[n],attributes:{},description:yt(e[n],n)})}catch{}return t}function Ba(e){return e!=="rdf:parseType"&&!Vn(e)}function Vn(e){return e.split(":")[0]==="xmlns"}function qn(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function yt(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0;if(Array.isArray(e)){var n=(function(a){return a.map(function(o){return o.value!==void 0?yt(o.value):yt(o)}).join(", ")})(e);return t&&typeof Kn[t]=="function"?Kn[t](e,n):n}if(wn(e)==="object")return(function(a){var o=[];for(var s in a)o.push("".concat(Na(s),": ").concat(yt(a[s].value)));return o.join("; ")})(e);try{return t&&typeof Kn[t]=="function"?Kn[t](e):decodeURIComponent(escape(e))}catch{return e}}function Na(e){return e==="CiAdrCity"?"CreatorCity":e==="CiAdrCtry"?"CreatorCountry":e==="CiAdrExtadr"?"CreatorAddress":e==="CiAdrPcode"?"CreatorPostalCode":e==="CiAdrRegion"?"CreatorRegion":e==="CiEmailWork"?"CreatorWorkEmail":e==="CiTelWork"?"CreatorWorkPhone":e==="CiUrlWork"?"CreatorWorkUrl":e}function cr(e){var t={};for(var n in e)try{Vn(n)||(t[qn(n)]=Ga(e[n],n))}catch{}return t}function Ga(e,t){return(function(n){return Array.isArray(n)})(e)?(function(n,a){return wi(n[n.length-1],a)})(e,t):(function(n){return n.attributes["rdf:parseType"]==="Resource"&&typeof n.value=="string"&&n.value.trim()===""})(e)?{value:"",attributes:{},description:""}:lr(e)?dr(e,t):fr(e)?hr(e,t):pr(e)?gr(e,t):(function(n){return mr(n.value)!==void 0})(e)?(function(n,a){var o=mr(n.value).value["rdf:li"],s=An(n),c=[];return o===void 0?o=[]:Array.isArray(o)||(o=[o]),o.forEach(function(d){c.push((function(p){return lr(p)?dr(p):fr(p)?hr(p).value:pr(p)?gr(p).value:wi(p)})(d))}),{value:c,attributes:s,description:yt(c,a)}})(e,t):wi(e,t)}function lr(e){return e.attributes["rdf:parseType"]==="Resource"&&e.value["rdf:value"]!==void 0||e.value["rdf:Description"]!==void 0&&e.value["rdf:Description"].value["rdf:value"]!==void 0}function dr(e,t){var n=An(e);e.value["rdf:Description"]!==void 0&&(e=e.value["rdf:Description"]),S(n,An(e),(function(o){var s={};for(var c in o.value)c==="rdf:value"||Vn(c)||(s[qn(c)]=o.value[c].value);return s})(e));var a=(function(o){return vr(o.value["rdf:value"])||o.value["rdf:value"].value})(e);return{value:a,attributes:n,description:yt(a,t)}}function An(e){var t={};for(var n in e.attributes)n==="rdf:parseType"||n==="rdf:resource"||Vn(n)||(t[qn(n)]=e.attributes[n]);return t}function fr(e){return e.attributes["rdf:parseType"]==="Resource"||e.value["rdf:Description"]!==void 0&&e.value["rdf:Description"].value["rdf:value"]===void 0}function hr(e,t){var n={value:{},attributes:{}};return e.value["rdf:Description"]!==void 0&&(S(n.value,xi(e.value["rdf:Description"].attributes)),S(n.attributes,An(e)),e=e.value["rdf:Description"]),S(n.value,cr(e.value)),n.description=yt(n.value,t),n}function pr(e){return Object.keys(e.value).length===0&&e.attributes["xml:lang"]===void 0&&e.attributes["rdf:resource"]===void 0}function gr(e,t){var n=xi(e.attributes);return{value:n,attributes:{},description:yt(n,t)}}function mr(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function wi(e,t){var n=vr(e)||ur(e.value);return{value:n,attributes:An(e),description:yt(n,t)}}function vr(e){return e.attributes&&e.attributes["rdf:resource"]}function Sn(e){return Sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sn(e)}var $a={read:function(e,t,n,a){for(var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Dt,c={},d=[],p=0;p<t.length;p++){var h=t[p],l=qa(e,h.offset,h.length,h.type,n);if(l instanceof Promise)d.push(l.then(function(k){var C,K,$,q=k.name,j=k.value,ee=k.description;try{if(xr(q,j))return s.shouldParseGroup("exif")?{__exif:Ze.read(kr(j),Va,a,o,s).tags}:{};if(wr(q,j))return s.shouldParseGroup("iptc")?{__iptc:$n.read(kr(j),0,a,s)}:{};if(q&&!xr(q,j)&&!wr(q,j))return s.shouldParseGroup("png")?(C={},$={value:j,description:ee},(K=(function(ae){var we=(function(ke){if(Sn(ke)!="object"||!ke)return ke;var pt=ke[Symbol.toPrimitive];if(pt!==void 0){var Nt=pt.call(ke,"string");if(Sn(Nt)!="object")return Nt;throw new TypeError("@@toPrimitive must return a primitive value.")}return ke+""})(ae);return Sn(we)=="symbol"?we:we+""})(K=q))in C?Object.defineProperty(C,K,{value:$,enumerable:1,configurable:1,writable:1}):C[K]=$,C):{}}catch{}return{}}));else{var f=l.name,w=l.value,x=l.description;f&&s.shouldParseGroup("png")&&(c[f]={value:w,description:x})}}return{readTags:c,readTagsPromise:d.length>0?Promise.all(d):void 0}}},ki="STATE_KEYWORD",Ei="STATE_COMPRESSION",Ai="STATE_LANG",br="STATE_TRANSLATED_KEYWORD",Si="STATE_TEXT",Ka=1,Ha=1,Va=6;function qa(e,t,n,a,o){for(var s,c=[],d=[],p=[],h=ki,l=P,f=0;f<n&&t+f<e.byteLength;f++)if(h!==Ei){if(h===Si){s=new DataView(e.buffer.slice(t+f,t+n));break}var w=e.getUint8(t+f);w===0?h=yr(a,h):h===ki?c.push(w):h===Ai?d.push(w):h===br&&p.push(w)}else l=Wa({type:a,dataView:e,offset:t+f}),a===ft&&(f+=Ka),h=yr(a,h);if(l!==P&&!o)return{};var x=(function(k,C,K){var $=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"string";if(C===0&&typeof DecompressionStream=="function"){var q=new DecompressionStream("deflate"),j=new Blob([k]).stream().pipeThrough(q);return $==="dataview"?new Response(j).arrayBuffer().then(function(ee){return new DataView(ee)}):new Response(j).arrayBuffer().then(function(ee){return new TextDecoder(K).decode(ee)})}return C!==void 0?Promise.reject("Unknown compression method ".concat(C,".")):k})(s,l,(function(k){return k===Ot||k===_t?"latin1":"utf-8"})(a));return x instanceof Promise?x.then(function(k){return Ti(k,a,d,c)}).catch(function(){return Ti("<text using unknown compression>".split(""),a,d,c)}):Ti(x,a,d,c)}function Wa(e){var t=e.type,n=e.dataView,a=e.offset;if(t===ft){if(n.getUint8(a)===Ha)return n.getUint8(a+1)}else if(t===_t)return n.getUint8(a);return P}function yr(e,t){return t===ki&&[ft,_t].includes(e)?Ei:t===Ei?e===ft?Ai:Si:t===Ai?br:Si}function Ti(e,t,n,a){var o=(function(s){return s instanceof DataView?y(s,0,s.byteLength):s})(e);return{name:Ya(t,n,a),value:o,description:t===ft?Xa(e):o}}function Ya(e,t,n){var a=A(n);if(e===Ot||t.length===0)return a;var o=A(t);return"".concat(a," (").concat(o,")")}function Xa(e){return nt("UTF-8",e)}function xr(e,t){return e.toLowerCase()==="raw profile type exif"&&t.substring(1,5)==="exif"}function wr(e,t){return e.toLowerCase()==="raw profile type iptc"&&t.substring(1,5)==="iptc"}function kr(e){return(function(t){for(var n=new DataView(new ArrayBuffer(t.length/2)),a=0;a<t.length;a+=2)n.setUint8(a/2,parseInt(t.substring(a,a+2),16));return n})(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var Ja={read:function(e,t){for(var n={},a=0;a<t.length;a++){var o=N.getLongAt(e,t[a]+dt),s=y(e,t[a]+ot,Pe);s===Le?(n["Pixels Per Unit X"]=Za(e,t[a],o),n["Pixels Per Unit Y"]=Qa(e,t[a],o),n["Pixel Units"]=eo(e,t[a],o)):s===ze&&(n["Modify Date"]=to(e,t[a],o))}return n}};function Za(e,t,n){if(Wn(e,t,n,0,4)){var a=N.getLongAt(e,t+Te+0);return{value:a,description:""+a}}}function Qa(e,t,n){if(Wn(e,t,n,4,4)){var a=N.getLongAt(e,t+Te+4);return{value:a,description:""+a}}}function eo(e,t,n){if(Wn(e,t,n,8,1)){var a=N.getByteAt(e,t+Te+8);return{value:a,description:a===1?"meters":"Unknown"}}}function to(e,t,n){if(Wn(e,t,n,0,7)){var a=N.getShortAt(e,t+Te),o=N.getByteAt(e,t+Te+2),s=N.getByteAt(e,t+Te+3),c=N.getByteAt(e,t+Te+4),d=N.getByteAt(e,t+Te+5),p=N.getByteAt(e,t+Te+6);return{value:[a,o,s,c,d,p],description:"".concat(an(a,4),"-").concat(an(o,2),"-").concat(an(s,2)," ").concat(an(c,2),":").concat(an(d,2),":").concat(an(p,2))}}}function Wn(e,t,n,a,o){return a+o<=n&&t+Te+a+o<=e.byteLength}function an(e,t){return"".concat("0".repeat(t-(""+e).length)).concat(e)}var no={read:function(e,t){var n={},a=N.getByteAt(e,t);return n.Alpha=(function(o){var s=16&o;return{value:s?1:0,description:s?"Yes":"No"}})(a),n.Animation=(function(o){var s=2&o;return{value:s?1:0,description:s?"Yes":"No"}})(a),n.ImageWidth=Er(e,t+io),n.ImageHeight=Er(e,t+ro),n}},io=4,ro=7;function Er(e,t){var n=N.getByteAt(e,t)+256*N.getByteAt(e,t+1)+65536*N.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var ao=[6,7,99],oo={get:function(e,t,n){if((p=t)&&(p.Compression===void 0||ao.includes(p.Compression.value))&&p.JPEGInterchangeFormat&&p.JPEGInterchangeFormat.value&&p.JPEGInterchangeFormatLength&&p.JPEGInterchangeFormatLength.value){t.type="image/jpeg";var a=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(a,a+t.JPEGInterchangeFormatLength.value),c=function(){return h=this.image,typeof btoa<"u"?btoa(typeof h=="string"?h:Array.prototype.reduce.call(new Uint8Array(h),function(l,f){return l+String.fromCharCode(f)},"")):typeof Buffer<"u"?typeof Buffer.from<"u"?Buffer.from(h).toString("base64"):new Buffer(h).toString("base64"):void 0;var h},d=0,Object.defineProperty(o=t,s="base64",{get:function(){return d||(d=1,Object.defineProperty(o,s,{configurable:1,enumerable:1,value:c.apply(o),writable:1})),o[s]},configurable:1,enumerable:1})}var o,s,c,d,p;return t}},so={get:function(e,t){var n,a={},o=0,s=Bt(e,"exif","FocalLength",t),c=Bt(e,"exif","FocalPlaneXResolution",t),d=Bt(e,"exif","FocalPlaneYResolution",t),p=Bt(e,"exif","FocalPlaneResolutionUnit",t),h=Bt(e,"file","Image Width",t),l=Bt(e,"file","Image Height",t),f=Bt(e,"exif","FocalLengthIn35mmFilm",t)||(function(k,C,K,$,q,j){if(k&&C&&K&&$&&q&&j)try{var ee;switch(K){case 2:ee=25.4;break;case 3:ee=10;break;case 4:ee=1;break;default:return}var ae=k[0]/k[1]*ee,we=q/(C[0]/C[1]*ee),ke=Math.sqrt(Math.pow($/ae,2)+Math.pow(we,2));return j[0]/j[1]*(43.27/ke)}catch{}})(c,d,p,h,l,s);f&&(a.FocalLength35efl={value:f,description:(n=f,n===0?"Unknown":n+" mm")},o=1);var w=(function(k,C){if(k&&C)try{var K=C/(k[0]/k[1]);return{value:K,description:K.toFixed(1)}}catch{}})(s,f);w&&(a.ScaleFactorTo35mmEquivalent=w,o=1);var x=(function(k){if(k)try{var C=2*Math.atan(36/(2*k))*(180/Math.PI);return{value:C,description:C.toFixed(1)+" deg"}}catch{}})(f);if(x&&(a.FieldOfView=x,o=1),o)return a}};function Bt(e,t,n,a){return a&&e[t]&&e[t][n]?e[t][n].value:!a&&e[n]?e[n].value:void 0}function Ar(e){for(var t=e.mergeSteps,n=e.deferredResults,a=e.parsedGroups,o=e.expanded,s=e.tagFilter,c=e.dataView,d=e.tiffHeaderOffset,p=e.fileType,h=e.pngTextChunks,l=e.pngTextIsAsync,f=e.thumbnailIfdTags,w=e.deps,x={},k=0;k<t.length;k++)x=uo({step:t[k],deferredResults:n,parsedGroups:a,expanded:o,tagFilter:s,dataView:c,tiffHeaderOffset:d,fileType:p,thumbnailIfdTags:f,tags:x,deps:w});return o&&l&&s.shouldReturnGroup("png")&&x.png&&(x.pngText=w.objectAssign({},x.png)),o&&s.shouldReturnGroup("png")&&w.hasPngTextData(h)&&x.png&&!x.pngText&&(x.pngText=w.objectAssign({},x.png)),x}function uo(e){var t=e.step,n=e.deferredResults,a=e.parsedGroups,o=e.expanded,s=e.tagFilter,c=e.dataView,d=e.tiffHeaderOffset,p=e.fileType,h=e.thumbnailIfdTags,l=e.tags,f=e.deps;if(t.type==="mergeGroupAssign"){var w=f.filterTagsForReturn(t.groupKey,t.parsedTags,s);return Ci(l,t.groupKey,w,o,f)}if(t.type==="mergeGroupMerge"){var x=f.filterTagsForReturn(t.groupKey,t.parsedTags,s);return(function(gt,un,Tn,Oi,Ct){return Oi?(gt[un]?gt[un]=Ct.objectAssign({},gt[un],Tn):gt[un]=Tn,gt):Ct.objectAssign({},gt,Tn)})(l,t.groupKey,x,o,f)}if(t.type==="mergeXmpGroupAssign"){var k=f.filterTagsForReturn("xmp",t.parsedTags,s);if(o)return l.xmp=k,l;var C=f.objectAssign({},k);return delete C._raw,f.objectAssign({},l,C)}if(t.type==="mergeIccDeferred"){var K=n[t.deferredKey],$=f.filterTagsForParse("icc",K,s);return a.icc=$,s.shouldReturnGroup("icc")?Ci(l,"icc",f.filterTagsForReturn("icc",$,s),o,f):l}if(t.type==="mergePngFile"){var q=f.filterTagsForReturn("png",t.parsedTags,s);return s.shouldReturnGroup("png")?o?(l.png=l.png?f.objectAssign({},l.png,q):q,l.pngFile=q,l):f.objectAssign({},l,q):l}if(t.type==="mergePngChunk"){var j=f.filterTagsForReturn("png",t.parsedTags,s);return s.shouldReturnGroup("png")?o?(l.png=l.png?f.objectAssign({},l.png,j):j,l):f.objectAssign({},l,j):l}if(t.type==="processPngTextReadTags")return Sr({readTags:t.readTags,parsedGroups:a,expanded:o,tagFilter:s,tags:l,deps:f});if(t.type==="processPngTextReadTagsDeferredList"){for(var ee=n[t.deferredKey]||[],ae=0;ae<ee.length;ae++)l=Sr({readTags:ee[ae],parsedGroups:a,expanded:o,tagFilter:s,tags:l,deps:f});return l}if(t.type==="gps"){if(o&&s.shouldReturnGroup("gps")&&a.exif){var we=f.getGpsGroupFromExifTags(a.exif);if(we){var ke=f.filterTagsForReturn("gps",we,s);l.gps=ke}}return l}if(t.type==="composite"){if(!s.shouldReturnGroup("composite"))return l;var pt=l,Nt=o;s.isActive&&(pt={exif:a.exif,file:a.file},Nt=1);var Yn=f.Composite.get(pt,Nt);return Yn?Ci(l,"composite",f.filterTagsForReturn("composite",Yn,s),o,f):l}if(t.type==="thumbnail"){if(!s.shouldReturnGroup("thumbnail")||!s.shouldReturnTag("thumbnail","Thumbnail"))return delete l.Thumbnail,l;if(!h)return l;var xt=h?f.filterTagsForParse("thumbnail",h,s):void 0;xt&&(a.thumbnail=xt);var sn=(f.Constants.USE_JPEG||f.Constants.USE_WEBP)&&f.Constants.USE_EXIF&&f.Constants.USE_THUMBNAIL&&f.Thumbnail.get(c,xt,d);return sn?l.Thumbnail=sn:delete l.Thumbnail,l}return t.type==="fileType"&&p&&s.shouldReturnGroup("file")&&s.shouldReturnTag("file","FileType")&&(o?(l.file||(l.file={}),l.file.FileType=p):l.FileType=p),l}function Ci(e,t,n,a,o){return a?(e[t]=n,e):o.objectAssign({},e,n)}function Sr(e){var t=e.readTags,n=e.parsedGroups,a=e.expanded,o=e.tagFilter,s=e.tags,c=e.deps,d=t.__exif,p=t.__iptc;if(delete t.__exif,delete t.__iptc,d){var h=c.filterTagsForParse("exif",d,o);if(n.exif=n.exif?c.objectAssign({},n.exif,h):h,o.shouldReturnGroup("exif")){var l=c.filterTagsForReturn("exif",h,o);a?s.exif=s.exif?c.objectAssign({},s.exif,l):l:s=c.objectAssign({},s,l)}}if(p){var f=c.filterTagsForParse("iptc",p,o);if(n.iptc=n.iptc?c.objectAssign({},n.iptc,f):f,o.shouldReturnGroup("iptc")){var w=c.filterTagsForReturn("iptc",f,o);a?s.iptc=s.iptc?c.objectAssign({},s.iptc,w):w:s=c.objectAssign({},s,w)}}if(o.shouldReturnGroup("png")){var x=c.filterTagsForParse("png",t,o),k=c.filterTagsForReturn("png",x,o);n.pngText=x,a?(s.png=s.png?c.objectAssign({},s.png,k):k,k&&Object.keys(k).length>0&&(s.pngText=s.pngText?c.objectAssign({},s.pngText,k):k)):s=c.objectAssign({},s,k)}return s}function Tr(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=Error().stack}Tr.prototype=Error();var Fi={MetadataMissingError:Tr},co={load:Cr,loadView:Pi,errors:Fi},lo=Fi;function Cr(e){var t,n,a,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((function(s){return typeof s=="string"})(e)){if(o.async=1,typeof Promise>"u")throw Error("Promise is required when async mode is enabled.");return(function(s,c){return/^\w+:\/\//.test(s)?typeof fetch<"u"?(function(d){var p=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).length,h={method:"GET"};return Number.isInteger(p)&&p>=0&&(h.headers={range:"bytes=0-".concat(p-1)}),fetch(d,h).then(function(l){return l.arrayBuffer()})})(s,c):(function(d){var p=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).length;return new Promise(function(h,l){var f={};Number.isInteger(p)&&p>=0&&(f.headers={range:"bytes=0-".concat(p-1)});var w=(function(x){return/^https:\/\//.test(x),qi.get})(d);w(d,f,function(x){if(x.statusCode>=200&&x.statusCode<=299){var k=[];x.on("data",function(C){return k.push(Buffer.from(C))}),x.on("error",function(C){return l(C)}),x.on("end",function(){return h(Buffer.concat(k))})}else l("Could not fetch file: ".concat(x.statusCode," ").concat(x.statusMessage)),x.resume()}).on("error",function(x){return l(x)})})})(s,c):(function(d){return/^data:[^;,]*(;base64)?,/.test(d)})(s)?Promise.resolve((function(d){var p=d.substring(d.indexOf(",")+1);if(d.indexOf(";base64")!==-1)return typeof atob<"u"?Uint8Array.from(atob(p),function(l){return l.charCodeAt(0)}).buffer:typeof Buffer>"u"?void 0:typeof Buffer.from<"u"?Buffer.from(p,"base64"):new Buffer(p,"base64");var h=decodeURIComponent(p);return typeof Buffer<"u"?typeof Buffer.from<"u"?Buffer.from(h):new Buffer(h):Uint8Array.from(h,function(l){return l.charCodeAt(0)}).buffer})(s)):(function(d){var p=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).length;return new Promise(function(h,l){var f=(function(){try{return qi}catch{return}})();f.open(d,function(w,x){w?l(w):f.stat(d,function(k,C){if(k)l(k);else{var K=Math.min(C.size,p!==void 0?p:C.size),$=Buffer.alloc(K),q={buffer:$,length:K};f.read(x,q,function(j){j?l(j):f.close(x,function(ee){ee&&console.warn("Could not close file ".concat(d,":"),ee),h($)})})}})})})})(s,c)})(e,o).then(function(s){return Ii(s,o)})}if((function(s){return typeof File<"u"&&s instanceof File})(e)){if(o.async=1,typeof Promise>"u")throw Error("Promise is required when async mode is enabled.");return(t=e,n=o,a=n.length,new Promise(function(s,c){var d=new FileReader;d.onload=function(p){return s(p.target.result)},d.onerror=function(){return c(d.error)},Number.isInteger(a)&&a>=0&&t.slice!==void 0?d.readAsArrayBuffer(t.slice(0,a)):d.readAsArrayBuffer(t)})).then(function(s){return Ii(s,o)})}return Ii(e,o)}function Ii(e,t){return(function(n){try{return Buffer.isBuffer(n)}catch{return 0}})(e)&&(e=new Uint8Array(e).buffer),Pi((function(n){try{return new DataView(n)}catch{return new le(n)}})(e),t)}function Pi(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{expanded:0,async:0,computed:0,includeUnknown:0,domParser:void 0,includeTags:void 0,excludeTags:void 0},n=t.expanded,a=n===void 0?0:n,o=t.async,s=o===void 0?0:o,c=t.computed,d=c===void 0?0:c,p=t.includeUnknown,h=p===void 0?0:p,l=t.domParser,f=l===void 0?void 0:l,w=t.includeTags,x=w===void 0?void 0:w,k=t.excludeTags,C=(function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_e=it.includeTags,Cn=it.excludeTags,st=!!_e,Zn=!!Cn,Qn=st||Zn,ei=Object.create(null),Nr=Object.create(null),Gr=Object.create(null);if(!Qn)return Dn();var Mi=st&&(Je(_e,"iptc")||Je(_e,"xmp")||Je(_e,"icc")||Je(_e,"photoshop")||Je(_e,"makerNotes")||Je(_e,"thumbnail")||Je(_e,"gps")||Je(_e,"composite")),ti=st&&Je(_e,"composite"),$r=Object.create(null);st&&($r=(function(Ce){var wt=(function(je){var ut=Object.create(null);if(!je)return ut;for(var ln in Array.isArray(je.exif)&&je.exif.length>0&&(ut[bt.exifIfdPointer]=1,(function(Wr,Yr){for(var Bi=0;Bi<Yr.length;Bi++){var Xr=Yr[Bi];if(typeof Xr=="string"){var Ni=Xr.toLowerCase();Ni.indexOf("gps")===0&&(Wr[bt.gpsInfoIfdPointer]=1),Ni.indexOf("interoperability")!==0&&Ni.indexOf("relatedimage")!==0||(Wr[bt.interoperabilityIfdPointer]=1)}}})(ut,je.exif)),bn)if(Un(je[ln])){for(var qr=bn[ln],Di=0;Di<qr.length;Di++)ut[qr[Di]]=1;ut[bt.exifIfdPointer]=1}return Un(je.gps)&&(ut[bt.gpsInfoIfdPointer]=1,ut[bt.exifIfdPointer]=1),ut})(Ce);return Je(Ce,"composite")&&(function(je,ut){for(var ln=0;ln<ut.length;ln++)je[ut[ln]]=1})(wt,yn.exif),wt})(_e));var Kr=Object.create(null);for(var Be in st&&ti&&(Kr=(function(Ce){for(var wt=Object.create(null),je=0;je<Ce.length;je++)wt[Ce[je].toLowerCase()]=1;return wt})(yn.file)),Tt){var cn=st&&Object.prototype.hasOwnProperty.call(_e,Be),ji=void 0;Zn&&Object.prototype.hasOwnProperty.call(Cn,Be)&&!cn&&(ji=Cn[Be]);var Hr=Nn({groupKey:Be,includeValue:cn?_e[Be]:void 0,excludeValue:ji,extraIncludeNames:Object.create(null)});ei[Be]=st?cn:1,cn&&hi(_e[Be])&&(ei[Be]=0),Hr.excludeAll&&(ei[Be]=0),Nr[Be]=Hr;var vo=Nn({groupKey:Be,includeValue:Bn({groupKey:Be,hasIncludeTags:st,hasIncludeEntry:cn,includeTags:_e,shouldParseExif:Mi,shouldParseFile:ti}),excludeValue:ji,extraIncludeNames:en({groupKey:Be,hasIncludeTags:st,hasIncludeEntry:cn,shouldParseExif:Mi,shouldParseFile:ti,exifIncludeDependencies:$r,fileIncludeDependencies:Kr})});Gr[Be]=vo}return{isActive:Qn,shouldReturnGroup:Ui,shouldParseGroup:Vr,shouldReturnTag:function(Ce,wt,je){return Tt[Ce]?Ui(Ce)?xn(Nr[Ce],wt,je):0:1},shouldParseTag:function(Ce,wt,je){return Tt[Ce]?Vr(Ce)?xn(Gr[Ce],wt,je):0:1}};function Ui(Ce){return Tt[Ce]?!!ei[Ce]:1}function Vr(Ce){return Tt[Ce]?Ui(Ce)?1:Ce==="exif"?Mi:Ce==="file"?ti:0:1}})({includeTags:x,excludeTags:k===void 0?void 0:k}),K=Object.create(null),$=[],q=Object.create(null),j=[],ee=0,ae=void 0,we=void 0,ke=Rn.parseAppMarkers(e,s),pt=ke.fileType,Nt=ke.fileDataOffset,Yn=ke.jfifDataOffset,xt=ke.tiffHeaderOffset,sn=ke.iptcDataOffset,gt=ke.xmpChunks,un=ke.iccChunks,Tn=ke.mpfDataOffset,Oi=ke.pngHeaderOffset,Ct=ke.pngTextChunks,_i=ke.pngChunkOffsets,Ri=ke.vp8xChunkOffset,po=ke.gifHeaderOffset,go=(function(it){var _e=it.iptcDataOffset,Cn=it.xmpChunks,st=it.pngTextChunks,Zn=it.pngChunkOffsets,Qn=it.vp8xChunkOffset;return!!it.fileType||Ir(it.tiffHeaderOffset)||Pr(_e)||Lr(Cn)||Li(st)||Or(Zn)||_r(Qn)||0})({fileType:pt,fileDataOffset:Nt,jfifDataOffset:Yn,tiffHeaderOffset:xt,iptcDataOffset:sn,xmpChunks:gt,iccChunks:un,mpfDataOffset:Tn,pngHeaderOffset:Oi,pngTextChunks:Ct,pngChunkOffsets:_i,vp8xChunkOffset:Ri,gifHeaderOffset:po});if(Ir(xt)&&C.shouldParseGroup("exif")){var Rr=Ze.read(e,xt,h,d,C),Xn=Rr.tags;Rr.byteOrder,Xn.Thumbnail&&(ae=Xn.Thumbnail,delete Xn.Thumbnail);var Jn=on("exif",Xn,C);K.exif=Jn,Jn.MakerNote&&delete Jn.MakerNote.__offset,C.shouldReturnGroup("exif")&&$.push({type:"mergeGroupAssign",groupKey:"exif",parsedTags:Jn}),!a&&we&&($.push(we),we=void 0)}if(Pr(sn)&&C.shouldParseGroup("iptc")){var zr=on("iptc",$n.read(e,sn,h,C),C);K.iptc=zr,C.shouldReturnGroup("iptc")&&$.push({type:"mergeGroupAssign",groupKey:"iptc",parsedTags:zr})}if(Lr(gt)&&C.shouldParseGroup("xmp")){var Mr=on("xmp",ja.read(e,gt,f),C);K.xmp=Mr,C.shouldReturnGroup("xmp")&&$.push({type:"mergeXmpGroupAssign",parsedTags:Mr})}if(Li(Ct)&&(C.shouldParseGroup("png")||C.shouldParseGroup("exif")||C.shouldParseGroup("iptc"))){var jr=$a.read(e,Ct,s,h,d,C),mo=jr.readTags,zi=jr.readTagsPromise;ee=!!zi,$.push({type:"processPngTextReadTags",readTags:mo}),zi&&(j.push(zi.then(function(it){q.pngTextTagList=it})),$.push({type:"processPngTextReadTagsDeferredList",deferredKey:"pngTextTagList"}))}if(Or(_i)&&C.shouldParseGroup("png")){var Ur=on("png",Ja.read(e,_i),C);K.pngChunk=Ur,C.shouldReturnGroup("png")&&$.push({type:"mergePngChunk",parsedTags:Ur})}if(_r(Ri)&&C.shouldParseGroup("riff")){var Dr=on("riff",no.read(e,Ri),C);K.riff=Dr,C.shouldReturnGroup("riff")&&$.push({type:"mergeGroupMerge",groupKey:"riff",parsedTags:Dr})}if($.push({type:"gps"}),$.push({type:"composite"}),$.push({type:"thumbnail"}),$.push({type:"fileType"}),!go)throw new Fi.MetadataMissingError;var Br={objectAssign:S,hasPngTextData:Li,filterTagsForParse:on,filterTagsForReturn:fo,getGpsGroupFromExifTags:ho,Constants:z,Composite:so,Thumbnail:oo};if(s){if(typeof Promise>"u")throw Error("Promise is required when async mode is enabled.");return Promise.all(j).then(function(){return Ar({mergeSteps:$,deferredResults:q,parsedGroups:K,expanded:a,tagFilter:C,dataView:e,tiffHeaderOffset:xt,fileType:pt,pngTextChunks:Ct,pngTextIsAsync:ee,thumbnailIfdTags:ae,deps:Br})})}return Ar({mergeSteps:$,deferredResults:q,parsedGroups:K,expanded:a,tagFilter:C,dataView:e,tiffHeaderOffset:xt,fileType:pt,pngTextChunks:Ct,pngTextIsAsync:ee,thumbnailIfdTags:ae,deps:Br})}function on(e,t,n){return n.isActive?Fr(e,t,n.shouldParseTag):t}function fo(e,t,n){return n.isActive?Fr(e,t,n.shouldReturnTag):t}function Fr(e,t,n){if(!t)return t;var a={};for(var o in t){var s=t[o];n(e,o,c(s))&&(a[o]=s)}return a;function c(d){if(d)return Array.isArray(d)?d.length===0?void 0:d[0].id:d.id}}function ho(e){var t=void 0;if(e.GPSLatitude&&e.GPSLatitudeRef){t=t||{};try{t.Latitude=D(e.GPSLatitude.value),e.GPSLatitudeRef.value.join("")==="S"&&(t.Latitude=-t.Latitude)}catch{}}if(e.GPSLongitude&&e.GPSLongitudeRef){t=t||{};try{t.Longitude=D(e.GPSLongitude.value),e.GPSLongitudeRef.value.join("")==="W"&&(t.Longitude=-t.Longitude)}catch{}}if(e.GPSAltitude&&e.GPSAltitudeRef){t=t||{};try{t.Altitude=e.GPSAltitude.value[0]/e.GPSAltitude.value[1],e.GPSAltitudeRef.value===1&&(t.Altitude=-t.Altitude)}catch{}}if(t)return t}function Ir(e){return e!==void 0}function Pr(e){return e!==void 0}function Lr(e){return Array.isArray(e)&&e.length>0}function Li(e){return Array.isArray(e)&&e.length>0}function Or(e){return e!==void 0}function _r(e){return e!==void 0}return b})()})})(Ln,Ln.exports)),Ln.exports}var _s=Os();const Rs=Eo(_s),zs=["Caption/Abstract","Description","ImageDescription"];async function Ms(m){if(!m||!m.type?.startsWith?.("image/"))return null;try{const u=await Rs.load(m);for(const g of zs)if(u[g]?.description)return u[g].description.trim();return null}catch{return null}}const js={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:Wi}=js;function fa(m,u,g,b){const y=Math.sqrt(u/m),F=Math.floor(g*y),A=Math.floor(b*y);return{newWidth:F,newHeight:A}}function Us({attachment:m,disabled:u,lang:g,supportedMimeTypes:b,descriptionLimit:y=1500,onDescriptionChange:F=()=>{},onRemove:A=()=>{}}){const{i18n:S,_:P}=Lt(),[T,L]=oe("default"),le=fn("@mastodon")||fn("@gotosocial/edit-media-attributes"),{type:z,id:D,file:_}=m,B=hn(()=>_?URL.createObjectURL(_):m.url,[_,m.url]),U=!!_?.size,Y=U?ya():{},{mediaAttachments:{imageSizeLimit:he,imageMatrixLimit:I,videoSizeLimit:W,videoMatrixLimit:ue,videoFrameRateLimit:de}={}}=Y||{},[me,ve]=oe(()=>U?z.startsWith("image")&&he&&_.size>he?{type:"imageSizeLimit",details:{imageSize:_.size,imageSizeLimit:he}}:z.startsWith("video")&&W&&_.size>W?{type:"videoSizeLimit",details:{videoSize:_.size,videoSizeLimit:W}}:null:null),[M,X]=oe({});Ae(()=>{!U||!I||M?.matrix>I&&ve({type:"imageMatrixLimit",details:{imageMatrix:M?.matrix,imageMatrixLimit:I,width:M?.width,height:M?.height}})},[M,I,U]);const[se,Fe]=oe({});Ae(()=>{!U||!ue||se?.matrix>ue&&ve({type:"videoMatrixLimit",details:{videoMatrix:se?.matrix,videoMatrixLimit:ue,width:se?.width,height:se?.height}})},[se,ue,U]);const[Ge,Re]=oe(m.description);Ae(()=>{if(!_||!z.startsWith("image/")||D||m.description)return;let ne=!1;return(async()=>{L("loading");try{const fe=await Ms(_);!ne&&fe&&Re(fe)}catch{}finally{ne||L("default")}})(),()=>{ne=!0}},[]);let[pe,Ke]=z.split("/");const He=new Set,Ve={};b?.length&&b.forEach(ne=>{const[fe,xe]=ne.split("/");Ve[xe]=fe,He.add(fe)}),Ke&&!He.has(pe)&&Ve[Ke]&&(pe=Ve[Ke]);const rt=ci(F,250);Ae(()=>{rt(Ge)},[Ge,rt]);const[J,Ee]=oe(!1),ye=ce(null);Ae(()=>{let ne;return J&&ye.current&&(ne=setTimeout(()=>{ye.current.focus()},100)),()=>{clearTimeout(ne)}},[J]);const $e=r(Kt,{children:D&&!le?r("div",{class:"media-desc",children:[r("span",{class:"tag",children:r(ie,{id:"3wG7HI"})}),r("p",{title:Ge,children:m.description||r("i",{children:"No description"})})]}):r("textarea",{ref:ye,value:Ge||"",lang:g,placeholder:{image:P({id:"Lh8B0N"}),video:P({id:"mN4S+e"}),gifv:P({id:"mN4S+e"}),audio:P({id:"ieZytw"})}[pe],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:u||T==="loading",class:T==="loading"?"loading":"",maxlength:y,onInput:ne=>{const{value:fe}=ne.target;Re(fe)}})}),De=ce(null);Ae(()=>()=>{De.current?.hideToast?.()},[]);const qe=ce(null),at=ne=>{const{type:fe,details:xe}=ne;switch(fe){case"imageSizeLimit":{const{imageSize:ge,imageSizeLimit:Ue}=xe;return P({id:"d83/LB",values:{0:ii(ge),1:ii(Ue)}})}case"imageMatrixLimit":{const{imageMatrix:ge,imageMatrixLimit:Ue,width:ct,height:re}=xe,{newWidth:Ie,newHeight:Se}=fa(ge,Ue,ct,re);return P({id:"DuvOX/",values:{0:S.number(ct),1:S.number(re),2:S.number(Ie),3:S.number(Se)}})}case"videoSizeLimit":{const{videoSize:ge,videoSizeLimit:Ue}=xe;return P({id:"d83/LB",values:{0:ii(ge),1:ii(Ue)}})}case"videoMatrixLimit":{const{videoMatrix:ge,videoMatrixLimit:Ue,width:ct,height:re}=xe,{newWidth:Ie,newHeight:Se}=fa(ge,Ue,ct,re);return P({id:"DuvOX/",values:{0:S.number(ct),1:S.number(re),2:S.number(Ie),3:S.number(Se)}})}case"videoFrameRateLimit":return P({id:"S1fBwy"})}};return r(Kt,{children:[r("div",{class:"media-attachment",children:[r("div",{class:"media-preview",tabIndex:"0",onClick:()=>{Ee(!0)},children:pe==="image"?r("img",{src:B,alt:"",onLoad:ne=>{if(!U)return;const{naturalWidth:fe,naturalHeight:xe}=ne.target;X({matrix:fe*xe,width:fe,height:xe})}}):pe==="video"||pe==="gifv"?r("video",{src:B+"#t=0.1",playsinline:!0,muted:!0,disablePictureInPicture:!0,preload:"metadata",onLoadedMetadata:ne=>{if(!U)return;const{videoWidth:fe,videoHeight:xe}=ne.target;fe&&xe&&Fe({matrix:fe*xe,width:fe,height:xe})}}):pe==="audio"?r("audio",{src:B,controls:!0}):null}),$e,r("div",{class:"media-aside",children:[r("button",{type:"button",class:"plain close-button",disabled:u,onClick:A,children:r(te,{icon:"x",alt:P({id:"t/YqKh"})})}),!!me&&r("button",{type:"button",class:"media-error",title:at(me),onClick:()=>{qe.current&&qe.current.hideToast(),qe.current=It({text:at(me),duration:1e4})},children:r(te,{icon:"alert",alt:P({id:"SlfejT"})})})]})]}),J&&r(ai,{onClose:()=>{Ee(!1)},children:r("div",{id:"media-sheet",class:"sheet sheet-max",children:[r("button",{type:"button",class:"sheet-close",onClick:()=>{Ee(!1)},children:r(te,{icon:"x",alt:P({id:"yz7wBu"})})}),r("header",{children:r("h2",{children:{image:P({id:"oMslIB"}),video:P({id:"WZw+zB"}),gifv:P({id:"WZw+zB"}),audio:P({id:"KMtgtM"})}[pe]})}),r("main",{tabIndex:"-1",children:[r("div",{class:"media-preview",children:pe==="image"?r("img",{src:B,alt:""}):pe==="video"||pe==="gifv"?r("video",{src:B,playsinline:!0,controls:!0}):pe==="audio"?r("audio",{src:B,controls:!0}):null}),r("div",{class:"media-form",children:[$e,r("footer",{children:[pe==="image"&&/^(png|jpe?g|gif|webp)$/i.test(Ke)&&!!Oe.settings.mediaAltGenerator&&!!Wi&&r(wa,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:r("button",{type:"button",class:"plain",children:r(te,{icon:"more",size:"l",alt:P({id:"2FYpfJ"})})}),children:[r(kt,{disabled:T==="loading",onClick:()=>{L("loading"),De.current=It({text:P({id:"8zsp51"}),duration:-1}),(async function(){try{const ne=new FormData;ne.append("image",_);const fe=await fetch(Wi,{method:"POST",body:ne}).then(xe=>xe.json());if(fe.error)throw new Error(fe.error);Re(fe.description)}catch(ne){It(ne.message?P({id:"wy0Iwj",values:{0:ne.message}}):P({id:"xhYfVj"}))}finally{L("default"),De.current?.hideToast?.()}})()},children:[r(te,{icon:"sparkles2"}),g&&g!=="en"?r("small",{children:[r(ie,{id:"o5sTJw"}),r("br",{}),"(English)"]}):r("span",{children:r(ie,{id:"o5sTJw"})})]}),!!g&&g!=="en"&&r(kt,{disabled:T==="loading",onClick:()=>{L("loading"),De.current=It({text:P({id:"8zsp51"}),duration:-1}),(async function(){try{const ne=new FormData;ne.append("image",_);const fe=`?lang=${g}`,xe=await fetch(Wi+fe,{method:"POST",body:ne}).then(ge=>ge.json());if(xe.error)throw new Error(xe.error);Re(xe.description)}catch(ne){It(P({id:"eNTGfp",values:{0:ne?.message?`: ${ne.message}`:""}}))}finally{L("default"),De.current?.hideToast?.()}})()},children:[r(te,{icon:"sparkles2"}),r("small",{children:[r(ie,{id:"o5sTJw"}),r("br",{}),r(ie,{id:"m+pAEQ",values:{0:Yi(g)},components:{0:r("span",{class:"more-insignificant"})}})]})]})]}),r("button",{type:"button",class:"light block",onClick:()=>{Ee(!1)},disabled:T==="loading",children:r(ie,{id:"DPfwMq"})})]})]})]})]})})]})}function Ds({onClose:m=()=>{},onSelect:u=()=>{},defaultSearchTerm:g}){const{_:b}=Lt(),{masto:y}=Ji(),[F,A]=oe("default"),[S,P]=oe([]),[T,L]=oe({}),[le,z]=oe(0),D=async I=>{if(!I?.length)return;const W=await jo(I,T);W&&L({...T,...W})},_=I=>{I&&(A("loading"),(async()=>{try{const W=await y.v1.accounts.search.list({q:I,limit:40,resolve:!1});P(W),D(W),A("default")}catch{A("error")}})())},B=ci(_,1e3);Ae(()=>{_()},[_]);const U=ce();Ae(()=>{U.current&&(U.current.focus(),U.current.value&&(U.current.selectionStart=U.current.value.length,U.current.selectionEnd=U.current.value.length))},[]),Ae(()=>{g&&_(g)},[g]);const Y=I=>{const W=I.acct;u(W),m()};On("enter",()=>{const I=S[le];I&&Y(I)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:I=>I.metaKey||I.ctrlKey||I.altKey||I.shiftKey});const he=ce();return On("down",()=>{le<S.length-1?z(le+1):z(0),setTimeout(()=>{const I=he.current.querySelector(".selected");I&&I.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:I=>I.metaKey||I.ctrlKey||I.altKey||I.shiftKey}),On("up",()=>{le>0?z(le-1):z(S.length-1),setTimeout(()=>{const I=he.current.querySelector(".selected");I&&I.scrollIntoView({behavior:"smooth",block:"center",inline:"center"})},1)},{preventDefault:!0,enableOnFormTags:["input"],useKey:!0,ignoreEventWhen:I=>I.metaKey||I.ctrlKey||I.altKey||I.shiftKey}),r("div",{id:"mention-sheet",class:"sheet",children:[!!m&&r("button",{type:"button",class:"sheet-close",onClick:m,children:r(te,{icon:"x",alt:b({id:"yz7wBu"})})}),r("header",{children:r("form",{onSubmit:I=>{I.preventDefault(),B.flush?.()},children:r("input",{ref:U,required:!0,type:"search",class:"block",placeholder:b({id:"eH1bqp"}),onInput:I=>{const{value:W}=I.target;B(W)},autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",dir:"auto",enterKeyHint:"search",defaultValue:g||""})})}),r("main",{children:S?.length>0?r("ul",{ref:he,class:`accounts-list ${F==="loading"?"loading":""}`,children:S.map((I,W)=>{const ue=T[I.id];return r("li",{class:W===le?"selected":"",children:[r(ka,{avatarSize:"xxl",account:I,relationship:ue,showStats:!0,showActivity:!0}),r("button",{type:"button",class:"plain2",onClick:()=>{Y(I)},children:r(te,{icon:"plus",size:"xl",alt:b({id:"m16xKo"})})})]},I.id)})}):F==="loading"?r("div",{class:"ui-state",children:r(ui,{abrupt:!0})}):F==="error"?r("div",{class:"ui-state",children:r("p",{children:r(ie,{id:"AThL/k"})})}):null})]})}function Bs({quoteSuggestion:m,hasCurrentQuoteStatus:u,onAccept:g,onCancel:b}){return m?r("div",{class:"quote-suggestion",children:[r("div",{class:"quote-suggestion-header",children:[r("b",{children:r(ie,{id:"UefSZg"})}),r("div",{class:"quote-suggestion-url",children:m.url})]}),r("div",{class:"quote-status",children:r(oi,{status:m.status,instance:m.instance,size:"s",readOnly:!0})}),r("div",{class:"quote-suggestion-actions",children:[r("span",{class:"spacer"}),r("button",{type:"button",class:"plain",onClick:b,children:u?r(ie,{id:"dEgA5A"}):r(ie,{id:"nc+Oa+"})}),r("button",{type:"button",class:"plain6",onClick:g,children:u?r(ie,{id:"UYZxOy"}):r(ie,{id:"vuFeUI"})})]})]}):null}const Ns=Zi.reduce((m,u)=>{const[g,b,y]=u;return m[g]={common:b,native:y},m},{}),Gs=Object.keys(Sa),ha=1440*60,pa=m=>{if(!m)return ha;const u=(Date.parse(m)-Date.now())/1e3;return Gs.find(g=>g>=u)||ha},$t=Ao([Uo(),...navigator.languages],Zi.map(m=>m[0]),"en"),$s=/(^|[^\/\w])[@](([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/gi,Ks="$2xxxxxxxxxxxxxxxxxxxxxxx";function Hs(m){return m.replace(Ea,Ks).replace($s,"$1@$3")}const Vs=So(m=>new Intl.ListFormat(m||void 0)),Ne={camera:{id:"TbrCz2"},media:{id:"MfJ43d"},customEmoji:{id:"ggiJLM"},gif:{id:"Fm6c4W"},poll:{id:"cZJ92q"},sensitive:{id:"x/s2/O"},scheduledPost:{id:"sX3iLV"}},qs=Math.max(600*1e3,Do);function Ws(m,u){if(!u||u.includes(m))return!0;const[g,b]=m.split("/"),y={};return u.forEach(F=>{const[A,S]=F.split("/");y[S]=A}),!!y[b]}function eu({onClose:m,replyToStatus:u,replyMode:g="all",editStatus:b,draftStatus:y,quoteStatus:F,standalone:A,hasOpener:S}){const{i18n:P,_:T,_:L}=Lt(),le=Bo(P.locale),z=Vs(P.locale),{masto:D,instance:_}=Ji(),[B,U]=oe("default"),Y=ce(y?.uid||No()),he=hn(To,[]),I=he.info,W=ya(),{statuses:{maxCharacters:ue,maxMediaAttachments:de,charactersReservedPerUrl:me}={},mediaAttachments:{supportedMimeTypes:ve,imageSizeLimit:M,imageMatrixLimit:X,videoSizeLimit:se,videoMatrixLimit:Fe,videoFrameRateLimit:Ge,descriptionLimit:Re}={},polls:{maxOptions:pe,maxCharactersPerOption:Ke,maxExpiration:He,minExpiration:Ve}={}}=W||{},rt=ve?.filter(v=>/^(image|video)/i.test(v)),J=ce(),Ee=ce(),[ye,$e]=oe("public"),[De,qe]=oe("public"),[at,ne]=oe(!1),[fe,xe]=oe(!1),[ge,Ue]=oe(mt.session.get("currentLanguage")||$t),ct=ce(ge),[re,Ie]=oe([]),[Se,lt]=oe(null),[Pe,dt]=oe(null),[ot,Te]=oe(null),[Ht,Ot]=oe(F),[ft,_t]=oe(!1),Le=Co(),ze=ft?null:Ht||F,li=v=>{if(!dn())return!1;const{visibility:E,quoteApproval:R,account:O}=v,H=I&&I.id===O.id,V=["public","unlisted"].includes(E),G=H&&E==="private",Q=R?.currentUser==="automatic"&&(V||G),Z=R?.currentUser==="manual"&&(V||G);return!V&&!H?!1:Q?!0:!!Z},di=async v=>{if(dn()){if(re.length>0||Se||b||ye==="direct")return;try{const E=await Fo(_,v);if(E?.id){const R=Oe.statuses[`${E.instance}/${E.id}`];if(R&&li(R)){if(ze?.id===R.id)return;Te({status:R,instance:E.instance,url:E.originalURL})}}}catch{}}},ht=()=>{J.current&&J.current.dispatchEvent(new Event("input"))},We=v=>{setTimeout(()=>{J.current&&(v!==void 0&&J.current.setSelectionRange(v,v),J.current?.focus())},300)},_n=({targetElement:v,text:E})=>{if(!v)return;const{selectionStart:R,selectionEnd:O,value:H}=v;let V=H.slice(0,R);V=V.replace(/\u200B$/,"");const G=V?/[\s\t\n\r]$/.test(V)?"":" ":"",Q=H.slice(O),Z=/^[\s\t\n\r]/.test(Q)?"":" ",Ze=V+G+E+Z+Q;v.value=Ze,v.selectionStart=v.selectionEnd=O+E.length+Z.length,v.focus(),v.dispatchEvent(new Event("input"))},Vt=ce(null),qt=ce(null),Rt=()=>{setTimeout(()=>{Vt.current&&Vt.current.focus()},0)},Wt=ce(null);Ae(()=>{const v=R=>{Wt.current.classList.toggle("focused",R.type==="focusin");const O=R.target;O.hasAttribute("data-allow-custom-emoji")&&(qt.current=O),["INPUT","BUTTON","SELECT","TEXTAREA"].includes(O.tagName)&&(Vt.current=O)},E=Wt.current;return E&&(E.addEventListener("focusin",v),E.addEventListener("focusout",v)),()=>{E&&(E.removeEventListener("focusin",v),E.removeEventListener("focusout",v))}},[]),Ae(()=>{if(u){const{spoilerText:v,visibility:E,language:R,sensitive:O}=u;v&&Ee.current&&(Ee.current.value=v);const V=[...new Set([u.account.acct,...u.mentions.map(G=>G.acct)])].filter(G=>G!==I.acct);if(V.length>0){const G=`@${u.account.acct}`,Q=V.filter(Z=>Z!==u.account.acct).map(Z=>`@${Z}`);if(g==="author-only")J.current.value=`${G} `,ht(),We();else if(g==="author-first")if(Q.length>0){J.current.value=`${G}
${Q.join(" ")}`,ht();const Z=G.length+1;We(Z)}else J.current.value=`${G} `,ht(),We();else J.current.value=`${V.map(Z=>`@${Z}`).join(" ")} `,ht(),We()}$e(E==="public"&&Le["posting:default:visibility"]?Le["posting:default:visibility"].toLowerCase():E),Ue(R||Le["posting:default:language"]?.toLowerCase()||$t),ne(!!v)}else if(b){const{visibility:v,language:E,sensitive:R,poll:O,mediaAttachments:H,quoteApproval:V}=b,G=!!O?.options&&{...O,options:O.options.map(Q=>Q?.title||Q),expiresIn:O?.expiresIn||pa(O.expiresAt)};U("loading"),(async()=>{try{const Q=await D.v1.statuses.$select(b.id).source.fetch(),{text:Z,spoilerText:Ze}=Q;if(J.current.value=Z,J.current.dataset.source=Z,ht(),We(),Ee.current.value=Ze,$e(v),Ue(E||Le["posting:default:language"]?.toLowerCase()||$t),dn()){const be=Go(V);qe(be)}ne(R),G&&lt(G),Ie(H),U("default")}catch(Q){alert(Q?.reason||Q),U("error")}})()}else if(We(),Le["posting:default:visibility"]&&$e(Le["posting:default:visibility"].toLowerCase()),Le["posting:default:language"]&&Ue(Le["posting:default:language"].toLowerCase()),Le["posting:default:sensitive"]&&ne(!!Le["posting:default:sensitive"]),Le["posting:default:quote_policy"]){let v=Le["posting:default:quote_policy"].toLowerCase();if(Le["posting:default:visibility"]){const E=Le["posting:default:visibility"].toLowerCase();(E==="private"||E==="direct")&&(v="nobody")}qe(v)}if(y){const{status:v,spoilerText:E,visibility:R,language:O,sensitive:H,sensitiveMedia:V,poll:G,mediaAttachments:Q,scheduledAt:Z,quoteApprovalPolicy:Ze}=y,be=!!G?.options&&{...G,options:G.options.map(et=>et?.title||et),expiresIn:G?.expiresIn||pa(G.expiresAt)};J.current.value=v,ht();const Qe=/^\n|\s/.test(v)?0:void 0;We(Qe),E&&(Ee.current.value=E),R&&$e(R),Ue(O||Le["posting:default:language"]?.toLowerCase()||$t),V!==null&&xe(V),H!==null&&ne(H),be&&lt(be),Q&&Ie(Q),Z&&dt(Z),Ze&&qe(Ze)}},[y,b,u,g]);const zt=ma(Oe);Ae(()=>{zt.composerState.minimized||We()},[zt.composerState.minimized]);const pn=ce(),Yt=L({id:"hR9gtK"}),Mt=()=>{const{value:v,dataset:E}=J.current;if(B==="loading")return!1;const R=(v||"").trim().replace(new RegExp("^\\p{White_Space}+|\\p{White_Space}+$","gu"),""),O=re.length>0;if(!R&&!O||re.length>0&&re.every(Z=>Z.id))return!0;const V=u?.account.id===I.id,G=u&&v.trim()===`@${u.account.acct}`;return!!(!V&&G||v===E?.source)},jt=()=>Mt()?!0:confirm(Yt);Ae(()=>{const v=E=>{Mt()||(E.preventDefault(),E.returnValue=Yt)};return window.addEventListener("beforeunload",v,{capture:!0}),()=>window.removeEventListener("beforeunload",v,{capture:!0})},[]);const fi=()=>{const{value:v}=J.current,{value:E}=Ee.current;return ea(Hs(v))+ea(E)},Et=()=>{const v=fi();Oe.composerCharacterCount=v};Ae(Et,[]);const gn=window.CloseWatcher,Xt=ce(!1);On("esc",()=>{Xt.current=!0},{enabled:!gn,enableOnFormTags:!0,useKey:!0,ignoreEventWhen:v=>v.metaKey||v.ctrlKey||v.altKey||v.shiftKey}),On("esc",()=>{!A&&Xt.current&&jt()&&m(),Xt.current=!1},{enabled:!gn,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:v=>{const E=document.querySelectorAll("#modal-container > *"),R=!!E,O=E.length===1&&E[0].querySelector("#compose-container");return R&&!O||v.metaKey||v.ctrlKey||v.altKey||v.shiftKey},useKey:!0}),$o(()=>{!A&&jt()&&m()},[]);const Rn=ce({}),At=()=>`${Io()}#${Y.current}`,Jt=()=>{if(b||Oe.composerState.minimized)return;const v=At(),E={key:v,replyTo:u?{id:u.id,account:{id:u.account.id,username:u.account.username,acct:u.account.acct}}:null,draftStatus:{uid:Y.current,status:J.current.value,spoilerText:Ee.current.value,visibility:ye,language:ge,sensitive:at,sensitiveMedia:fe,poll:Se,mediaAttachments:re,scheduledAt:Pe,quoteApprovalPolicy:De},quote:ze?.id?{id:ze.id}:null};!Po(E,Rn.current)&&!Mt()&&(Zr.drafts.set(v,{...E,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(R=>{}),Rn.current=structuredClone(E))};Ko(Jt,5e3),Ae(()=>(Jt(),()=>{Zr.drafts.del(At())}),[]),Ae(()=>{const v=R=>{if(document.querySelector(".sheet"))return;const{items:O}=R.clipboardData||R.dataTransfer,H=[],V=[];for(let G=0;G<O.length;G++){const Q=O[G];if(Q.kind==="file"){const Z=Q.getAsFile();Ws(Z.type,ve)?H.push(Z):V.push(Z)}}if(V.length>0&&alert(Pn._({id:"rpXAF6",values:{0:V.length,1:V[0].name,2:z.format(V.map(G=>G.name))}})),H.length>0&&re.length>=de){alert(Pn._({id:"ctFhjs",values:{maxMediaAttachments:de}}));return}if(H.length>0){R.preventDefault(),R.stopPropagation();let G=H;if(de!==void 0){const Z=de-re.length;if(G=G.slice(0,Z),G.length<=0){alert(Pn._({id:"ctFhjs",values:{maxMediaAttachments:de}}));return}}const Q=G.map(Z=>({file:Z,type:Z.type,size:Z.size,url:URL.createObjectURL(Z),id:null,description:null}));Ie([...re,...Q])}};window.addEventListener("paste",v);const E=R=>{R.dataTransfer.items.length>0&&(R.preventDefault(),R.stopPropagation())};return window.addEventListener("dragover",E),window.addEventListener("drop",v),()=>{window.removeEventListener("paste",v),window.removeEventListener("dragover",E),window.removeEventListener("drop",v)}},[re]);const[St,Ye]=oe(!1),[Zt,vt]=oe(!1),[zn,Ut]=oe(!1),[Me,Mn]=oe(null),[mn,N]=hn(()=>{const v=[],E=[],{contentTranslationHideLanguages:R=[]}=Oe.settings;return Zi.forEach(O=>{const[H]=O;H===ge||H===ct.current||H===$t||R.includes(H)||Me?.length&&Me.includes(H)?v.push(O):E.push(O)}),v.sort(([O,H],[V,G])=>O===ge?-1:V===ge?1:H.localeCompare(G)),E.sort(([O,H],[V,G])=>H.localeCompare(G)),[v,E]},[ge,Me]),vn=hn(()=>!!u?.createdAt&&Math.floor((Date.now()-Date.parse(u.createdAt))/(1e3*60*60*24*30)),[u]),Qt=()=>{Jt(),Oe.composerState.minimized=!0},Xe=B==="loading"||de!==void 0&&re.length>=de||!!Se,jn=B==="loading"||!!at,Tt=()=>{ne(!0),setTimeout(()=>{Ee.current?.focus()},0)},bt=pe==null||pe>1,bn=B==="loading"||!!Se||!!re.length,yn=()=>{lt({options:["",""],expiresIn:1440*60,multiple:!1}),setTimeout(()=>{Wt.current?.querySelector('.poll-choice input[type="text"]')?.focus()},0)},Un=ge!==ct.current||Me?.length&&!Me.includes(ge),Dn=ye!=="public",Dt=De!=="public",Bn=ye==="private"||ye==="direct",en=ce(),[Je,hi]=oe(!0),Nn=42;xa({ref:en,box:"border-box",onResize:({width:v})=>{const{scrollWidth:E}=en.current,R=E>v,O=v<Nn*4;hi(O||R),en.current.hidden=O}});const xn=!b,tn=B==="loading"||!!Pe,Gn=()=>{const v=new Date(Date.now()+qs);dt(v)};return r("div",{id:"compose-container-outer",ref:Wt,children:[r("div",{id:"compose-container",tabIndex:-1,class:A?"standalone":"",children:[r("div",{class:"compose-top",children:[I?.avatarStatic&&r(ka,{account:I,accountInstance:he.instanceURL,hideDisplayName:!0,useAvatarStatic:!0}),A?S&&r("button",{type:"button",class:"light pop-button",disabled:B==="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 v=L({id:"AB/GtR"});if(!confirm(v))return}m({fn:()=>{const v={editStatus:b,replyToStatus:u,replyMode:g,draftStatus:{uid:Y.current,status:J.current.value,spoilerText:Ee.current.value,visibility:ye,language:ge,sensitive:at,sensitiveMedia:fe,poll:Se,mediaAttachments:re,scheduledAt:Pe},quoteStatus:ze};window.opener.__COMPOSE__=v,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:r(te,{icon:"popin",alt:L({id:"/5ZKeE"})})}):r("span",{class:"compose-controls",children:[r("button",{type:"button",class:"plain4 pop-button",disabled:B==="loading",onClick:()=>{Ho({editStatus:b,replyToStatus:u,draftStatus:{uid:Y.current,status:J.current.value,spoilerText:Ee.current.value,visibility:ye,language:ge,sensitive:at,poll:Se,mediaAttachments:re,scheduledAt:Pe},quoteStatus:ze})&&m()},children:r(te,{icon:"popout",alt:L({id:"JsU2En"})})}),r("button",{type:"button",class:"plain4 min-button",onClick:Qt,children:r(te,{icon:"minimize",alt:L({id:"3TSz9S"})})})," ",r("button",{type:"button",class:"plain4 close-button",disabled:B==="loading",onClick:()=>{jt()&&m()},children:r(te,{icon:"x",alt:L({id:"yz7wBu"})})})]})]}),!!u&&r("details",{class:"status-preview",open:!0,children:[r(oi,{status:u,size:"s",previewMode:!0}),r("summary",{class:"status-preview-legend reply-to",children:vn>0?r(ie,{id:"Q1Huya",values:{0:u.account.acct||u.account.username,1:le.format(-vn,"month")},components:{0:r("strong",{})}}):r(ie,{id:"dwLCPZ",values:{0:u.account.acct||u.account.username}})})]}),!!b&&r("details",{class:"status-preview",children:[r(oi,{status:b,size:"s",previewMode:!0}),r("summary",{class:"status-preview-legend",children:r(ie,{id:"wKtOLH"})})]}),r("form",{ref:pn,class:`form-visibility-${ye}`,style:{pointerEvents:B==="loading"?"none":"auto",opacity:B==="loading"?.5:1},onClick:()=>{setTimeout(()=>{document.activeElement||Vt.current?.focus?.()},10)},onKeyDown:v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&pn.current.dispatchEvent(new Event("submit",{cancelable:!0}))},onSubmit:v=>{v.preventDefault();const E=new FormData(v.target),R=Object.fromEntries(E.entries());let{status:O,visibility:H,sensitive:V,sensitiveMedia:G,spoilerText:Q,scheduledAt:Z,quoteApprovalPolicy:Ze}=R;if(V=V==="on",G=G==="on",Z=Z?new Date(Z).toISOString():void 0,Se){if(Se.options.length<2){alert(L({id:"zhrMYj"}));return}if(Se.options.some(be=>be==="")){alert(L({id:"uNVxXX"}));return}}re.length>0&&re.some(Qe=>!Qe.description?.trim?.())&&!confirm(L({id:"MQYucx"}))||(Q=V&&Q||void 0,O=O===""?void 0:O,Oe.composerState.publishing=!0,U("loading"),(async()=>{try{if(re.length>0){const et=re.map(nt=>{const{file:$n,description:pi,id:gi}=nt;if(gi)return nt;{const mi=ga({file:$n,description:pi});return D.v2.media.create(mi).then(nn=>(nn.id&&(nt.id=nn.id),nn))}}),tt=await Promise.allSettled(et);if(tt.some(nt=>nt.status==="rejected"||!nt.value?.id)){Oe.composerState.publishing=!1,Oe.composerState.publishingError=!0,U("error"),tt.forEach(nt=>{nt.status==="rejected"&&alert(nt.reason||L({id:"eIiurD",values:{i}}))});return}}let be={status:O,spoiler_text:Q,language:ge,sensitive:V||G,poll:Se,media_ids:re.map(et=>et.id)};b?(dn()&&(be.quote_approval_policy=Ze),(fn("@mastodon")||fn("@gotosocial/edit-media-attributes"))&&(be.media_attributes=re.map(et=>({id:et.id,description:et.description})))):(dn()&&ze?.id&&(be.quoted_status_id=ze.id,be.quote_approval_policy=Ze),be.visibility=H,be.in_reply_to_id=u?.id||void 0,be.scheduled_at=Z),be=ga(be);let Qe;if(b)Qe=await D.v1.statuses.$select(b.id).update(be),Lo(Qe,_,{skipThreading:!0});else try{Qe=await D.v1.statuses.create(be,{requestInit:{headers:{"Idempotency-Key":Y.current}}})}catch{Qe=await D.v1.statuses.create(be)}Oe.composerState.minimized=!1,Oe.composerState.publishing=!1,U("default"),m({type:b?"edit":u?"reply":"post",newStatus:Qe,instance:_,scheduledAt:Z})}catch(be){Oe.composerState.publishing=!1,Oe.composerState.publishingError=!0,alert(be?.reason||be),U("error")}})())},children:[r("div",{children:[r("div",{class:`compose-cw-container ${at?"":"collapsed"}`,children:[r("input",{type:"hidden",name:"sensitive",value:at?"on":"off"}),r(er,{keys:":",class:"spoiler-text-field-container",onTrigger:v=>{v?.name==="custom-emojis"&&vt({targetElement:Ee,defaultSearchTerm:v?.defaultSearchTerm||null})},children:r("input",{ref:Ee,type:"text",name:"spoilerText",placeholder:L({id:"gnKo7f"}),"data-allow-custom-emoji":"true",disabled:B==="loading",class:"spoiler-text-field",lang:ge,spellCheck:"true",autocomplete:"off",dir:"auto",onInput:()=>{Et()},onKeyDown:v=>{v.key==="Enter"&&!v.ctrlKey&&!v.metaKey&&!v.isComposing&&(v.preventDefault(),We())}})}),r("button",{type:"button",class:"close-button plain4 small",onClick:()=>{ne(!1),J.current.focus()},children:r(te,{icon:"x",alt:L({id:"dEgA5A"})})})]}),r(As,{ref:J,"data-allow-custom-emoji":"true",placeholder:L(u?{id:"Sjj+EN"}:b?{id:"qzVesX"}:Se?{id:"/fY1js"}:{id:"owpNF1"}),required:re?.length===0,disabled:B==="loading",lang:ge,onInput:()=>{Et()},maxCharacters:ue,onTrigger:v=>{v?.name==="custom-emojis"?vt({targetElement:qt,defaultSearchTerm:v?.defaultSearchTerm||null}):v?.name==="mention"?Ye({defaultSearchTerm:v?.defaultSearchTerm||null}):v?.name==="auto-detect-language"&&v?.languages?Mn(v.languages):v?.name==="pasted-link"&&v?.url&&di(v.url)}})]}),re?.length>0&&r("div",{class:"media-attachments",children:[re.map((v,E)=>{const{id:R,file:O}=v,H=O?.size+O?.type+O?.name;return r(Us,{attachment:v,disabled:B==="loading",lang:ge,supportedMimeTypes:ve,descriptionLimit:Re,onDescriptionChange:V=>{Ie(G=>{const Q=[...G];return Q[E]={...Q[E],description:V},Q})},onRemove:()=>{Ie(V=>V.filter((G,Q)=>Q!==E))}},R||H||E)}),r("label",{class:"media-sensitive",children:[r("input",{name:"sensitiveMedia",type:"checkbox",checked:fe,disabled:B==="loading",onChange:v=>{const E=v.target.checked;xe(E)}})," ",r("span",{children:r(ie,{id:"jER18a"})})," ",r(te,{icon:`eye-${fe?"close":"open"}`})]})]}),!!Se&&r(gs,{lang:ge,maxOptions:pe,maxExpiration:He,minExpiration:Ve,maxCharactersPerOption:Ke,poll:Se,disabled:B==="loading",onInput:v=>{if(v){const E={...v};lt(E)}else lt(null),Rt()}}),!!ze?.id&&r("div",{class:"quote-status",children:r(oi,{status:ze,instance:_,size:"s",readOnly:!0})}),Pe&&r("div",{class:"toolbar scheduled-at",children:[r("span",{children:[r("label",{children:r(ie,{id:"GKuKcZ",components:{0:r(Vo,{scheduledAt:Pe,setScheduledAt:dt})}})})," ",r("small",{class:"tag insignificant",children:qo()})]}),r("button",{type:"button",class:"plain4 close-button small",onClick:()=>{dt(null),Rt()},children:r(te,{icon:"x",alt:L({id:"dEgA5A"})})})]}),r(Bs,{quoteSuggestion:ot,hasCurrentQuoteStatus:!!ze?.id,onAccept:()=>{const{status:v}=ot,E=J.current?.value||"",R=J.current?.selectionStart||0,O=E.lastIndexOf(ot.url,R),H=E.slice(0,O)+E.slice(O+ot.url.length);J.current&&(J.current.value=H,J.current.dispatchEvent(new Event("input"))),!!ze?.id?(Te(null),Ot(v)):document.startViewTransition?document.startViewTransition(()=>{Te(null),Ot(v)}):(Te(null),Ot(v)),We()},onCancel:()=>Te(null)}),r("div",{class:"toolbar compose-footer",children:[r("span",{class:"add-toolbar-button-group spacer",children:[Je&&r(wa,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},menuButton:({open:v})=>r("button",{type:"button",class:`toolbar-button add-button ${v?"active":""}`,children:r(te,{icon:"plus",title:L({id:"m16xKo"})})}),children:[ia&&r(kt,{disabled:Xe,className:"compose-menu-add-media",children:[r("label",{class:"compose-menu-add-media-field",children:r(na,{hidden:!0,supportedMimeTypes:rt,disabled:Xe,setMediaAttachments:Ie})}),r(te,{icon:"camera"})," ",r("span",{children:T(Ne.camera)})]}),r(kt,{disabled:Xe,className:"compose-menu-add-media",children:[r("label",{class:"compose-menu-add-media-field",children:r(la,{hidden:!0,supportedMimeTypes:ve,maxMediaAttachments:de,mediaAttachments:re,disabled:Xe,setMediaAttachments:Ie})}),r(te,{icon:"media"})," ",r("span",{children:T(Ne.media)})]}),r(kt,{disabled:jn,onClick:Tt,children:[r(te,{icon:"alert"})," ",r("span",{children:T(Ne.sensitive)})]}),bt&&r(kt,{disabled:bn,onClick:yn,children:[r(te,{icon:"poll"})," ",r("span",{children:T(Ne.poll)})]}),r(Qr,{}),r(kt,{onClick:()=>{vt({targetElement:qt})},children:[r(te,{icon:"emoji2"})," ",r("span",{children:T(Ne.customEmoji)})]}),!!Oe.settings.composerGIFPicker&&r(kt,{disabled:Xe,onClick:()=>{Ut(!0)},children:[r("span",{class:"icon icon-gif",role:"img"}),r("span",{children:T(Ne.gif)})]}),xn&&r(Kt,{children:[r(Qr,{}),r(kt,{disabled:tn,onClick:Gn,children:[r(te,{icon:"schedule"})," ",r("span",{children:T(Ne.scheduledPost)})]})]})]}),r("span",{class:"add-sub-toolbar-button-group",ref:en,hidden:!0,children:[ia&&r("label",{class:"toolbar-button",children:[r(na,{supportedMimeTypes:rt,mediaAttachments:re,disabled:Xe,setMediaAttachments:Ie}),r(te,{icon:"camera",alt:T(Ne.camera)})]}),r("label",{class:"toolbar-button",children:[r(la,{supportedMimeTypes:ve,maxMediaAttachments:de,mediaAttachments:re,disabled:Xe,setMediaAttachments:Ie}),r(te,{icon:"media",alt:T(Ne.media)})]}),r("button",{type:"button",class:"toolbar-button",disabled:jn,onClick:Tt,children:r(te,{icon:"alert",alt:T(Ne.sensitive)})}),bt&&r("button",{type:"button",class:"toolbar-button",disabled:bn,onClick:yn,children:r(te,{icon:"poll",alt:T(Ne.poll)})}),r("div",{class:"toolbar-divider"}),r("button",{type:"button",class:"toolbar-button",disabled:B==="loading",onClick:()=>{vt({targetElement:qt})},children:r(te,{icon:"emoji2",alt:T(Ne.customEmoji)})}),!!Oe.settings.composerGIFPicker&&r("button",{type:"button",class:"toolbar-button gif-picker-button",disabled:Xe,onClick:()=>{Ut(!0)},children:r("span",{class:"icon icon-gif","aria-label":T(Ne.gif)})}),xn&&r(Kt,{children:[r("div",{class:"toolbar-divider"}),r("button",{type:"button",class:`toolbar-button ${Pe?"highlight":""}`,disabled:tn,onClick:Gn,children:r(te,{icon:"schedule",alt:T(Ne.scheduledPost)})})]})]})]}),B==="loading"?r(ui,{abrupt:!0}):r(es,{maxCharacters:ue,hidden:B==="loading"}),dn()&&r("label",{class:`toolbar-button ${Dt?"highlight":""}`,children:[r(te,{icon:"quote2",alt:"Quote settings"}),De==="followers"&&r(te,{icon:"group",class:"insignificant"}),De==="nobody"&&r(te,{icon:"block",class:"insignificant"}),r("select",{name:"quoteApprovalPolicy",value:De,onChange:v=>{qe(v.target.value)},disabled:B==="loading",dir:"auto",children:[r("option",{value:"public",disabled:Bn,children:r(ie,{id:"hDWXuG"})}),r("option",{value:"followers",disabled:Bn,children:r(ie,{id:"9Ko+Xp"})}),r("option",{value:"nobody",children:r(ie,{id:"+bAQ3S"})})]})]}),r("label",{class:`toolbar-button ${Dn?"highlight":""}`,title:T($i[ye]),children:[ye==="public"||ye==="direct"?r(te,{icon:Wo[ye],alt:T($i[ye])}):r("span",{class:"icon-text",children:T($i[ye])}),r("select",{name:"visibility",value:ye,onChange:v=>{if($e(v.target.value),(v.target.value==="private"||v.target.value==="direct")&&qe("nobody"),v.target.value==="direct"&&ze?.id){const E=ze.url;if(E){const R=J.current.value;R.includes(E)||(J.current.value=R+(R?`
`:"")+E,ht())}_t(!0),It(L({id:"Z/Vnvj"}))}else if(v.target.value!=="direct"&&ft){const E=(Ht||F)?.url;if(E&&J.current){const R=J.current.value,O=R.indexOf(E);if(O!==-1){let H=R.slice(0,O)+R.slice(O+E.length);H=H.replace(/\n+$/,""),J.current.value=H,ht()}}_t(!1)}},disabled:B==="loading"||!!b,dir:"auto",children:[r("option",{value:"public",children:r(ie,{id:"7d1a0d"})}),(fn("@pleroma/local-visibility-post")||fn("@akkoma/local-visibility-post"))&&r("option",{value:"local",children:r(ie,{id:"d5zxa4"})}),r("option",{value:"unlisted",children:r(ie,{id:"pPYeIN"})}),r("option",{value:"private",children:r(ie,{id:"x5LEuB"})}),r("option",{value:"direct",children:r(ie,{id:"IV4QaU"})})]})]})," ",r("label",{class:`toolbar-button ${Un?"highlight":""}`,children:[r("span",{class:"icon-text",children:Ns[ge]?.native}),r("select",{name:"language",value:ge,onChange:v=>{const{value:E}=v.target;Ue(E||$t),mt.session.set("currentLanguage",E||$t)},disabled:B==="loading",dir:"auto",children:[mn.map(([v,E,R])=>{const O=Yi({code:v,fallback:E});return r("option",{value:v,children:O!==R?`${R} - ${O}`:O},v)}),r("hr",{}),N.map(([v,E,R])=>{const O=Yi({code:v,fallback:E});return r("option",{value:v,children:O!==R?`${R} - ${O}`:O},v)})]})]})," ",r("button",{type:"submit",disabled:B==="loading",children:L(Pe?{id:"gmB6oO"}:u?{id:"ImOQa9"}:b?{id:"EkH9pt"}:{id:"GMe2XV"})})]})]})]}),St&&r(ai,{onClose:()=>{Ye(!1),Rt()},children:r(Ds,{masto:D,instance:_,onClose:()=>{Ye(!1)},defaultSearchTerm:St?.defaultSearchTerm,onSelect:v=>{const E=J.current;E&&_n({targetElement:E,text:"@"+v})}})}),Zt&&r(ai,{onClose:()=>{vt(!1),Rt()},children:r(Ts,{masto:D,instance:_,onClose:()=>{vt(!1)},defaultSearchTerm:Zt?.defaultSearchTerm,onSelect:v=>{const E=Zt?.targetElement?.current||J.current;E&&_n({targetElement:E,text:v})}})}),zn&&r(ai,{onClose:()=>{Ut(!1),Rt()},children:r(Ps,{onClose:()=>Ut(!1),onSelect:({url:v,type:E,alt_text:R})=>{if(re.length>=de){alert(Pn._({id:"ctFhjs",values:{maxMediaAttachments:de}}));return}(async()=>{let O;try{O=It({text:L({id:"/Cw4Tx"}),duration:-1});const H=await fetch(v,{referrerPolicy:"no-referrer"}).then(Q=>Q.blob()),V=new File([H],E==="video/mp4"?"video.mp4":"image.gif",{type:E}),G=[...re,{file:V,type:E,size:V.size,id:null,description:R||""}];Ie(G),O?.hideToast?.()}catch{O?.hideToast?.(),It(L({id:"VKDnAx"}))}})()}})})]})}function ga(m){for(let u in m)(m[u]===null||m[u]===void 0)&&delete m[u];return m}export{eu as default};
//# sourceMappingURL=compose-6wkLWCrG.js.map