1 line
No EOL
15 KiB
JavaScript
1 line
No EOL
15 KiB
JavaScript
!function(){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(e){function n(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],o=Object.create(t.prototype);for(var a in n)o[a]=n[a];return o.constructor=e,e.prototype=o,e}function o(t){t=t||{},this.defaultProtocol=t.defaultProtocol||g.defaultProtocol,this.events=t.events||g.events,this.format=t.format||g.format,this.formatHref=t.formatHref||g.formatHref,this.nl2br=t.nl2br||g.nl2br,this.tagName=t.tagName||g.tagName,this.target=t.target||g.target,this.validate=t.validate||g.validate,this.ignoreTags=[],this.attributes=t.attributes||t.linkAttributes||g.attributes,this.className=t.className||t.linkClass||g.className;for(var e=t.ignoreTags||g.ignoreTags,n=0;n<e.length;n++)this.ignoreTags.push(e[n].toUpperCase())}function a(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return!0;return!1}function r(t){return t}function i(t,e){return"url"===e?"_blank":null}function s(){return function(t){this.j=[],this.T=t||null}}function c(t,e,n,o){for(var a=0,r=t.length,i=e,s=[],c=void 0;a<r&&(c=i.next(t[a]));)i=c,a++;if(a>=r)return[];for(;a<r-1;)c=new m(o),s.push(c),i.on(t[a],c),i=c,a++;return c=new m(n),s.push(c),i.on(t[r-1],c),s}function l(){return function(t){t&&(this.v=t)}}function u(t){var e=t?{v:t}:{};return n(b,l(),e)}function h(t){return t instanceof v||t instanceof P}var g={defaultProtocol:"http",events:null,format:r,formatHref:r,nl2br:!1,tagName:"a",target:i,validate:!0,ignoreTags:[],attributes:null,className:"linkified"};o.prototype={resolve:function(t){var e=t.toHref(this.defaultProtocol);return{formatted:this.get("format",t.toString(),t),formattedHref:this.get("formatHref",e,t),tagName:this.get("tagName",e,t),className:this.get("className",e,t),target:this.get("target",e,t),events:this.getObject("events",e,t),attributes:this.getObject("attributes",e,t)}},check:function(t){return this.get("validate",t.toString(),t)},get:function(e,n,o){var a=this[e];if(!a)return a;switch("undefined"==typeof a?"undefined":t(a)){case"function":return a(n,o.type);case"object":var r=a[o.type]||g[e];return"function"==typeof r?r(n,o.type):r}return a},getObject:function(t,e,n){var o=this[t];return"function"==typeof o?o(e,n.type):o}};var p=Object.freeze({defaults:g,Options:o,contains:a}),f=s();f.prototype={defaultTransition:!1,on:function(t,e){if(t instanceof Array){for(var n=0;n<t.length;n++)this.j.push([t[n],e]);return this}return this.j.push([t,e]),this},next:function(t){for(var e=0;e<this.j.length;e++){var n=this.j[e],o=n[0],a=n[1];if(this.test(t,o))return a}return this.defaultTransition},accepts:function(){return!!this.T},test:function(t,e){return t===e},emit:function(){return this.T}};var m=n(f,s(),{test:function(t,e){return t===e||e instanceof RegExp&&e.test(t)}}),d=n(f,s(),{jump:function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=this.next(new t(""));return n===this.defaultTransition?(n=new this.constructor(e),this.on(t,n)):e&&(n.T=e),n},test:function(t,e){return t instanceof e}}),b=l();b.prototype={toString:function(){return this.v+""}};var v=u(),y=u("@"),k=u(":"),w=u("."),j=u(),x=u(),z=u("\n"),O=u(),S=u("+"),N=u("#"),T=u(),L=u("?"),A=u("/"),E=u("_"),C=u(),P=u(),q=u(),H=u("{"),R=u("["),U=u("("),B=u("}"),D=u("]"),K=u(")"),M=Object.freeze({Base:b,DOMAIN:v,AT:y,COLON:k,DOT:w,PUNCTUATION:j,LOCALHOST:x,NL:z,NUM:O,PLUS:S,POUND:N,QUERY:L,PROTOCOL:T,SLASH:A,UNDERSCORE:E,SYM:C,TLD:P,WS:q,OPENBRACE:H,OPENBRACKET:R,OPENPAREN:U,CLOSEBRACE:B,CLOSEBRACKET:D,CLOSEPAREN:K}),I="aaa|aarp|abb|abbott|abogado|ac|academy|accenture|accountant|accountants|aco|active|actor|ad|adac|ads|adult|ae|aeg|aero|af|afl|ag|agency|ai|aig|airforce|airtel|al|alibaba|alipay|allfinanz|alsace|am|amica|amsterdam|an|analytics|android|ao|apartments|app|apple|aq|aquarelle|ar|aramco|archi|army|arpa|arte|as|asia|associates|at|attorney|au|auction|audi|audio|author|auto|autos|avianca|aw|ax|axa|az|azure|ba|baidu|band|bank|bar|barcelona|barclaycard|barclays|bargains|bauhaus|bayern|bb|bbc|bbva|bcg|bcn|bd|be|beats|beer|bentley|berlin|best|bet|bf|bg|bh|bharti|bi|bible|bid|bike|bing|bingo|bio|biz|bj|black|blackfriday|bloomberg|blue|bm|bms|bmw|bn|bnl|bnpparibas|bo|boats|boehringer|bom|bond|boo|book|boots|bosch|bostik|bot|boutique|br|bradesco|bridgestone|broadway|broker|brother|brussels|bs|bt|budapest|bugatti|build|builders|business|buy|buzz|bv|bw|by|bz|bzh|ca|cab|cafe|cal|call|camera|camp|cancerresearch|canon|capetown|capital|car|caravan|cards|care|career|careers|cars|cartier|casa|cash|casino|cat|catering|cba|cbn|cc|cd|ceb|center|ceo|cern|cf|cfa|cfd|cg|ch|chanel|channel|chase|chat|cheap|chloe|christmas|chrome|church|ci|cipriani|circle|cisco|citic|city|cityeats|ck|cl|claims|cleaning|click|clinic|clinique|clothing|cloud|club|clubmed|cm|cn|co|coach|codes|coffee|college|cologne|com|commbank|community|company|compare|computer|comsec|condos|construction|consulting|contact|contractors|cooking|cool|coop|corsica|country|coupon|coupons|courses|cr|credit|creditcard|creditunion|cricket|crown|crs|cruises|csc|cu|cuisinella|cv|cw|cx|cy|cymru|cyou|cz|dabur|dad|dance|date|dating|datsun|day|dclk|de|dealer|deals|degree|delivery|dell|deloitte|delta|democrat|dental|dentist|desi|design|dev|diamonds|diet|digital|direct|directory|discount|dj|dk|dm|dnp|do|docs|dog|doha|domains|download|drive|dubai|durban|dvag|dz|earth|eat|ec|edeka|edu|education|ee|eg|email|emerck|energy|engineer|engineering|enterprises|epson|equipment|er|erni|es|esq|estate|et|eu|eurovision|eus|events|everbank|exchange|expert|exposed|express|fage|fail|fairwinds|faith|family|fan|fans|farm|fashion|fast|feedback|ferrero|fi|film|final|finance|financial|firestone|firmdale|fish|fishing|fit|fitness|fj|fk|flickr|flights|florist|flowers|flsmidth|fly|fm|fo|foo|football|ford|forex|forsale|forum|foundation|fox|fr|fresenius|frl|frogans|frontier|fund|furniture|futbol|fyi|ga|gal|gallery|gallup|game|garden|gb|gbiz|gd|gdn|ge|gea|gent|genting|gf|gg|ggee|gh|gi|gift|gifts|gives|giving|gl|glass|gle|global|globo|gm|gmail|gmbh|gmo|gmx|gn|gold|goldpoint|golf|goo|goog|google|gop|got|gov|gp|gq|gr|grainger|graphics|gratis|green|gripe|group|gs|gt|gu|gucci|guge|guide|guitars|guru|gw|gy|hamburg|hangout|haus|hdfcbank|health|healthcare|help|helsinki|here|hermes|hiphop|hitachi|hiv|hk|hm|hn|hockey|holdings|holiday|homedepot|homes|honda|horse|host|hosting|hoteles|hotmail|house|how|hr|hsbc|ht|hu|hyundai|ibm|icbc|ice|icu|id|ie|ifm|iinet|il|im|immo|immobilien|in|industries|infiniti|info|ing|ink|institute|insurance|insure|int|international|investments|io|ipiranga|iq|ir|irish|is|iselect|ist|istanbul|it|itau|iwc|jaguar|java|jcb|je|jetzt|jewelry|jlc|jll|jm|jmp|jo|jobs|joburg|jot|joy|jp|jpmorgan|jprs|juegos|kaufen|kddi|ke|kerryhotels|kerrylogistics|kerryproperties|kfh|kg|kh|ki|kia|kim|kinder|kitchen|kiwi|km|kn|koeln|komatsu|kp|kpn|kr|krd|kred|kuokgroup|kw|ky|kyoto|kz|la|lacaixa|lamborghini|lamer|lancaster|land|landrover|lanxess|lasalle|lat|latrobe|law|lawyer|lb|lc|lds|lease|leclerc|legal|lexus|lgbt|li|liaison|lidl|life|lifeinsurance|lifestyle|lighting|like|limited|limo|lincoln|linde|link|live|living|lixil|lk|loan|loans|local|locus|lol|london|lotte|lotto|love|lr|ls|lt|ltd|ltda|lu|lupin|luxe|luxury|lv|ly|ma|madrid|maif|maison|makeup|man|management|mango|market|marketing|markets|marriott|mba|mc|md|me|med|media|meet|melbourne|meme|memorial|men|menu|meo|mg|mh|miami|microsoft|mil|mini|mk|ml|mm|mma|mn|mo|mobi|mobily|moda|moe|moi|mom|monash|money|montblanc|mormon|mortgage|moscow|motorcycles|mov|movie|movistar|mp|mq|mr|ms|mt|mtn|mtpc|mtr|mu|museum|mutuelle|mv|mw|mx|my|mz|na|nadex|nagoya|name|natura|navy|nc|ne|nec|net|netbank|network|neustar|new|news|nexus|nf|ng|ngo|nhk|ni|nico|nikon|ninja|nissan|nl|no|nokia|norton|nowruz|np|nr|nra|nrw|ntt|nu|nyc|nz|obi|office|okinawa|om|omega|one|ong|onl|online|ooo|oracle|orange|org|organic|origins|osaka|otsuka|ovh|pa|page|pamperedchef|panerai|paris|pars|partners|parts|party|passagens|pe|pet|pf|pg|ph|pharmacy|philips|photo|photography|photos|physio|piaget|pics|pictet|pictures|pid|pin|ping|pink|pizza|pk|pl|place|play|playstation|plumbing|plus|pm|pn|pohl|poker|porn|post|pr|praxi|press|pro|prod|productions|prof|promo|properties|property|protection|ps|pt|pub|pw|pwc|py|qa|qpon|quebec|quest|racing|re|read|realtor|realty|recipes|red|redstone|redumbrella|rehab|reise|reisen|reit|ren|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rexroth|rich|ricoh|rio|rip|ro|rocher|rocks|rodeo|room|rs|rsvp|ru|ruhr|run|rw|rwe|ryukyu|sa|saarland|safe|safety|sakura|sale|salon|samsung|sandvik|sandvikcoromant|sanofi|sap|sapo|sarl|sas|saxo|sb|sbs|sc|sca|scb|schaeffler|schmidt|scholarships|school|schule|schwarz|science|scor|scot|sd|se|seat|security|seek|select|sener|services|seven|sew|sex|sexy|sfr|sg|sh|sharp|shell|shia|shiksha|shoes|show|shriram|si|singles|site|sj|sk|ski|skin|sky|skype|sl|sm|smile|sn|sncf|so|soccer|social|softbank|software|sohu|solar|solutions|song|sony|soy|space|spiegel|spot|spreadbetting|sr|srl|st|stada|star|starhub|statefarm|statoil|stc|stcgroup|stockholm|storage|store|studio|study|style|su|sucks|supplies|supply|support|surf|surgery|suzuki|sv|swatch|swiss|sx|sy|sydney|symantec|systems|sz|tab|taipei|taobao|tatamotors|tatar|tattoo|tax|taxi|tc|tci|td|team|tech|technology|tel|telecity|telefonica|temasek|tennis|tf|tg|th|thd|theater|theatre|tickets|tienda|tiffany|tips|tires|tirol|tj|tk|tl|tm|tmall|tn|to|today|tokyo|tools|top|toray|toshiba|total|tours|town|toyota|toys|tp|tr|trade|trading|training|travel|travelers|travelersinsurance|trust|trv|tt|tube|tui|tunes|tushu|tv|tvs|tw|tz|ua|ubs|ug|uk|unicom|university|uno|uol|us|uy|uz|va|vacations|vana|vc|ve|vegas|ventures|verisign|versicherung|vet|vg|vi|viajes|video|viking|villas|vin|vip|virgin|vision|vista|vistaprint|viva|vlaanderen|vn|vodka|volkswagen|vote|voting|voto|voyage|vu|vuelos|wales|walter|wang|wanggou|watch|watches|weather|weatherchannel|webcam|weber|website|wed|wedding|weir|wf|whoswho|wien|wiki|williamhill|win|windows|wine|wme|wolterskluwer|work|works|world|ws|wtc|wtf|xbox|xerox|xin|xperia|xxx|xyz|yachts|yahoo|yamaxun|yandex|ye|yodobashi|yoga|yokohama|youtube|yt|za|zara|zero|zip|zm|zone|zuerich|zw".split("|"),_="0123456789".split(""),Y="0123456789abcdefghijklmnopqrstuvwxyz".split(""),Q=[" ","\f","\r","\t","\x0B"],W=[],X=function(t){return new m(t)},Z=X(),F=X(O),G=X(v),J=X(),V=X(q);Z.on("@",X(y)).on(".",X(w)).on("+",X(S)).on("#",X(N)).on("?",X(L)).on("/",X(A)).on("_",X(E)).on(":",X(k)).on("{",X(H)).on("[",X(R)).on("(",X(U)).on("}",X(B)).on("]",X(D)).on(")",X(K)).on([",",";","!",'"'],X(j)),Z.on("\n",X(z)).on(Q,V),V.on(Q,V);for(var $=0;$<I.length;$++){var tt=c(I[$],Z,P,v);W.push.apply(W,tt)}var et=c("file",Z,v,v),nt=c("ftp",Z,v,v),ot=c("http",Z,v,v);W.push.apply(W,et),W.push.apply(W,nt),W.push.apply(W,ot);var at=et.pop(),rt=nt.pop(),it=ot.pop(),st=X(v),ct=X(T);rt.on("s",st).on(":",ct),it.on("s",st).on(":",ct),W.push(st),at.on(":",ct),st.on(":",ct);var lt=c("localhost",Z,x,v);W.push.apply(W,lt),Z.on(_,F),F.on("-",J).on(_,F).on(Y,G),G.on("-",J).on(Y,G);for(var ut=0;ut<W.length;ut++)W[ut].on("-",J).on(Y,G);J.on("-",J).on(_,G).on(Y,G),Z.defaultTransition=X(C);var ht=function(t){for(var e=t.replace(/[A-Z]/g,function(t){return t.toLowerCase()}),n=t.length,o=[],a=0;a<n;){for(var r=Z,i=null,s=null,c=0,l=null,u=-1;a<n&&(s=r.next(e[a]));)i=null,r=s,r.accepts()?(u=0,l=r):u>=0&&u++,c++,a++;if(!(u<0)){a-=u,c-=u;var h=l.emit();o.push(new h(t.substr(a-c,c)))}}return o},gt=Z,pt=Object.freeze({State:m,TOKENS:M,run:ht,start:gt}),ft=l();ft.prototype={type:"token",isLink:!1,toString:function(){for(var t=[],e=0;e<this.v.length;e++)t.push(this.v[e].toString());return t.join("")},toHref:function(){return this.toString()},toObject:function(){var t=arguments.length<=0||void 0===arguments[0]?"http":arguments[0];return{type:this.type,value:this.toString(),href:this.toHref(t)}}};var mt=n(ft,l(),{type:"email",isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),dt=n(ft,l(),{type:"text"}),bt=n(ft,l(),{type:"nl"}),vt=n(ft,l(),{type:"url",isLink:!0,toHref:function(){for(var t=arguments.length<=0||void 0===arguments[0]?"http":arguments[0],e=!1,n=!1,o=this.v,a=[],r=0;o[r]instanceof T;)e=!0,a.push(o[r].toString().toLowerCase()),r++;for(;o[r]instanceof A;)n=!0,a.push(o[r].toString()),r++;for(;h(o[r]);)a.push(o[r].toString().toLowerCase()),r++;for(;r<o.length;r++)a.push(o[r].toString());return a=a.join(""),e||n||(a=t+"://"+a),a},hasProtocol:function(){return this.v[0]instanceof T}}),yt=Object.freeze({Base:ft,EMAIL:mt,NL:bt,TEXT:dt,URL:vt}),kt=function(t){return new d(t)},wt=kt(),jt=kt(),xt=kt(),zt=kt(),Ot=kt(),St=kt(),Nt=kt(vt),Tt=kt(),Lt=kt(vt),At=kt(vt),Et=kt(),Ct=kt(),Pt=kt(),qt=kt(),Ht=kt(vt),Rt=kt(vt),Ut=kt(vt),Bt=kt(),Dt=kt(),Kt=kt(),Mt=kt(),It=kt(),_t=kt(mt),Yt=kt(),Qt=kt(mt),Wt=kt(),Xt=kt(),Zt=kt(),Ft=kt(bt);wt.on(z,Ft).on(T,jt).on(A,xt),jt.on(A,xt),xt.on(A,zt),wt.on(P,Ot).on(v,Ot).on(x,Nt).on(O,Ot),zt.on(P,At).on(v,At).on(O,At).on(x,At),Ot.on(w,St),Mt.on(w,It),St.on(P,Nt).on(v,Ot).on(O,Ot).on(x,Ot),It.on(P,_t).on(v,Mt).on(O,Mt).on(x,Mt),Nt.on(w,St),_t.on(w,It),Nt.on(k,Tt).on(A,At),Tt.on(O,Lt),Lt.on(A,At),_t.on(k,Yt),Yt.on(O,Qt);var Gt=[v,y,x,O,S,N,T,A,P,E,C],Jt=[k,w,L,j,B,D,K,H,R,U];At.on(H,Ct).on(R,Pt).on(U,qt),Et.on(H,Ct).on(R,Pt).on(U,qt),Ct.on(B,At),Pt.on(D,At),qt.on(K,At),Ht.on(B,At),Rt.on(D,At),Ut.on(K,At),Bt.on(B,At),Dt.on(D,At),Kt.on(K,At),Ct.on(Gt,Ht),Pt.on(Gt,Rt),qt.on(Gt,Ut),Ct.on(Jt,Bt),Pt.on(Jt,Dt),qt.on(Jt,Kt),Ht.on(Gt,Ht),Rt.on(Gt,Rt),Ut.on(Gt,Ut),Ht.on(Jt,Ht),Rt.on(Jt,Rt),Ut.on(Jt,Ut),Bt.on(Gt,Ht),Dt.on(Gt,Rt),Kt.on(Gt,Ut),Bt.on(Jt,Bt),Dt.on(Jt,Dt),Kt.on(Jt,Kt),At.on(Gt,At),Et.on(Gt,At),At.on(Jt,Et),Et.on(Jt,Et);var Vt=[v,O,S,N,L,E,C,P];Ot.on(Vt,Wt).on(y,Xt),Nt.on(Vt,Wt).on(y,Xt),St.on(Vt,Wt),Wt.on(Vt,Wt).on(y,Xt).on(w,Zt),Zt.on(Vt,Wt),Xt.on(P,Mt).on(v,Mt).on(x,_t);var $t=function(t){for(var e=t.length,n=0,o=[],a=[];n<e;){for(var r=wt,i=null,s=null,c=0,l=null,u=-1;n<e&&!(i=r.next(t[n]));)a.push(t[n++]);for(;n<e&&(s=i||r.next(t[n]));)i=null,r=s,r.accepts()?(u=0,l=r):u>=0&&u++,n++,c++;if(u<0)for(var h=n-c;h<n;h++)a.push(t[h]);else{a.length>0&&(o.push(new dt(a)),a=[]),n-=u,c-=u;var g=l.emit();o.push(new g(t.slice(n-c,n)))}}return a.length>0&&o.push(new dt(a)),o},te=Object.freeze({State:d,TOKENS:yt,run:$t,start:wt});Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var ee=function(t){return $t(ht(t))},ne=function(t){for(var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=ee(t),o=[],a=0;a<n.length;a++){var r=n[a];!r.isLink||e&&r.type!==e||o.push(r.toObject())}return o},oe=function(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1],n=ee(t);return 1===n.length&&n[0].isLink&&(!e||n[0].type===e)};e.find=ne,e.inherits=n,e.options=p,e.parser=te,e.scanner=pt,e.test=oe,e.tokenize=ee}(window.linkify=window.linkify||{})}(); |