| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811 |
- /*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
- ! ( function ( n ) {
- 'function' == typeof define && define.amd
- ? define( [ 'jquery' ], n )
- : 'object' == typeof module && module.exports
- ? ( module.exports = function ( e, t ) {
- return (
- void 0 === t &&
- ( t =
- 'undefined' != typeof window
- ? require( 'jquery' )
- : require( 'jquery' )( e ) ),
- n( t ),
- t
- );
- } )
- : n( jQuery );
- } )( function ( t ) {
- var e,
- n,
- s,
- p,
- r,
- o,
- h,
- f,
- g,
- m,
- y,
- v,
- i,
- a,
- _,
- s =
- ( t &&
- t.fn &&
- t.fn.select2 &&
- t.fn.select2.amd &&
- ( u = t.fn.select2.amd ),
- ( u && u.requirejs ) ||
- ( u ? ( n = u ) : ( u = {} ),
- ( g = {} ),
- ( m = {} ),
- ( y = {} ),
- ( v = {} ),
- ( i = Object.prototype.hasOwnProperty ),
- ( a = [].slice ),
- ( _ = /\.js$/ ),
- ( h = function ( e, t ) {
- var n,
- s,
- i = c( e ),
- r = i[ 0 ],
- t = t[ 1 ];
- return (
- ( e = i[ 1 ] ),
- r && ( n = x( ( r = l( r, t ) ) ) ),
- r
- ? ( e =
- n && n.normalize
- ? n.normalize(
- e,
- ( ( s = t ),
- function ( e ) {
- return l( e, s );
- } )
- )
- : l( e, t ) )
- : ( ( r = ( i = c( ( e = l( e, t ) ) ) )[ 0 ] ),
- ( e = i[ 1 ] ),
- r && ( n = x( r ) ) ),
- { f: r ? r + '!' + e : e, n: e, pr: r, p: n }
- );
- } ),
- ( f = {
- require: function ( e ) {
- return w( e );
- },
- exports: function ( e ) {
- var t = g[ e ];
- return void 0 !== t ? t : ( g[ e ] = {} );
- },
- module: function ( e ) {
- return {
- id: e,
- uri: '',
- exports: g[ e ],
- config:
- ( ( t = e ),
- function () {
- return (
- ( y && y.config && y.config[ t ] ) || {}
- );
- } ),
- };
- var t;
- },
- } ),
- ( r = function ( e, t, n, s ) {
- var i,
- r,
- o,
- a,
- l,
- c = [],
- u = typeof n,
- d = A( ( s = s || e ) );
- if ( 'undefined' == u || 'function' == u ) {
- for (
- t =
- ! t.length && n.length
- ? [ 'require', 'exports', 'module' ]
- : t,
- a = 0;
- a < t.length;
- a += 1
- )
- if (
- 'require' === ( r = ( o = h( t[ a ], d ) ).f )
- )
- c[ a ] = f.require( e );
- else if ( 'exports' === r )
- ( c[ a ] = f.exports( e ) ), ( l = ! 0 );
- else if ( 'module' === r )
- i = c[ a ] = f.module( e );
- else if ( b( g, r ) || b( m, r ) || b( v, r ) )
- c[ a ] = x( r );
- else {
- if ( ! o.p )
- throw new Error( e + ' missing ' + r );
- o.p.load(
- o.n,
- w( s, ! 0 ),
- ( function ( t ) {
- return function ( e ) {
- g[ t ] = e;
- };
- } )( r ),
- {}
- ),
- ( c[ a ] = g[ r ] );
- }
- ( u = n ? n.apply( g[ e ], c ) : void 0 ),
- e &&
- ( i && i.exports !== p && i.exports !== g[ e ]
- ? ( g[ e ] = i.exports )
- : ( u === p && l ) || ( g[ e ] = u ) );
- } else e && ( g[ e ] = n );
- } ),
- ( e = n = o = function ( e, t, n, s, i ) {
- if ( 'string' == typeof e )
- return f[ e ] ? f[ e ]( t ) : x( h( e, A( t ) ).f );
- if ( ! e.splice ) {
- if (
- ( ( y = e ).deps && o( y.deps, y.callback ), ! t )
- )
- return;
- t.splice
- ? ( ( e = t ), ( t = n ), ( n = null ) )
- : ( e = p );
- }
- return (
- ( t = t || function () {} ),
- 'function' == typeof n && ( ( n = s ), ( s = i ) ),
- s
- ? r( p, e, t, n )
- : setTimeout( function () {
- r( p, e, t, n );
- }, 4 ),
- o
- );
- } ),
- ( o.config = function ( e ) {
- return o( e );
- } ),
- ( e._defined = g ),
- ( ( s = function ( e, t, n ) {
- if ( 'string' != typeof e )
- throw new Error(
- 'See almond README: incorrect module build, no module name'
- );
- t.splice || ( ( n = t ), ( t = [] ) ),
- b( g, e ) || b( m, e ) || ( m[ e ] = [ e, t, n ] );
- } ).amd = { jQuery: ! 0 } ),
- ( u.requirejs = e ),
- ( u.require = n ),
- ( u.define = s ) ),
- u.define( 'almond', function () {} ),
- u.define( 'jquery', [], function () {
- var e = t || $;
- return (
- null == e &&
- console &&
- console.error &&
- console.error(
- 'Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page.'
- ),
- e
- );
- } ),
- u.define( 'select2/utils', [ 'jquery' ], function ( r ) {
- var s = {};
- function c( e ) {
- var t,
- n = e.prototype,
- s = [];
- for ( t in n )
- 'function' == typeof n[ t ] &&
- 'constructor' !== t &&
- s.push( t );
- return s;
- }
- ( s.Extend = function ( e, t ) {
- var n,
- s = {}.hasOwnProperty;
- function i() {
- this.constructor = e;
- }
- for ( n in t ) s.call( t, n ) && ( e[ n ] = t[ n ] );
- return (
- ( i.prototype = t.prototype ),
- ( e.prototype = new i() ),
- ( e.__super__ = t.prototype ),
- e
- );
- } ),
- ( s.Decorate = function ( s, i ) {
- var e = c( i ),
- t = c( s );
- function r() {
- var e = Array.prototype.unshift,
- t = i.prototype.constructor.length,
- n = s.prototype.constructor;
- 0 < t &&
- ( e.call( arguments, s.prototype.constructor ),
- ( n = i.prototype.constructor ) ),
- n.apply( this, arguments );
- }
- ( i.displayName = s.displayName ),
- ( r.prototype = new ( function () {
- this.constructor = r;
- } )() );
- for ( var n = 0; n < t.length; n++ ) {
- var o = t[ n ];
- r.prototype[ o ] = s.prototype[ o ];
- }
- for ( var a = 0; a < e.length; a++ ) {
- var l = e[ a ];
- r.prototype[ l ] = ( function ( e ) {
- var t = function () {};
- e in r.prototype && ( t = r.prototype[ e ] );
- var n = i.prototype[ e ];
- return function () {
- return (
- Array.prototype.unshift.call(
- arguments,
- t
- ),
- n.apply( this, arguments )
- );
- };
- } )( l );
- }
- return r;
- } );
- function e() {
- this.listeners = {};
- }
- ( e.prototype.on = function ( e, t ) {
- ( this.listeners = this.listeners || {} ),
- e in this.listeners
- ? this.listeners[ e ].push( t )
- : ( this.listeners[ e ] = [ t ] );
- } ),
- ( e.prototype.trigger = function ( e ) {
- var t = Array.prototype.slice,
- n = t.call( arguments, 1 );
- ( this.listeners = this.listeners || {} ),
- null == n && ( n = [] ),
- 0 === n.length && n.push( {} ),
- ( n[ 0 ]._type = e ) in this.listeners &&
- this.invoke(
- this.listeners[ e ],
- t.call( arguments, 1 )
- ),
- '*' in this.listeners &&
- this.invoke( this.listeners[ '*' ], arguments );
- } ),
- ( e.prototype.invoke = function ( e, t ) {
- for ( var n = 0, s = e.length; n < s; n++ )
- e[ n ].apply( this, t );
- } ),
- ( s.Observable = e ),
- ( s.generateChars = function ( e ) {
- for ( var t = '', n = 0; n < e; n++ )
- t += Math.floor( 36 * Math.random() ).toString(
- 36
- );
- return t;
- } ),
- ( s.bind = function ( e, t ) {
- return function () {
- e.apply( t, arguments );
- };
- } ),
- ( s._convertData = function ( e ) {
- for ( var t in e ) {
- var n = t.split( '-' ),
- s = e;
- if ( 1 !== n.length ) {
- for ( var i = 0; i < n.length; i++ ) {
- var r = n[ i ];
- ( r =
- r.substring( 0, 1 ).toLowerCase() +
- r.substring( 1 ) ) in s ||
- ( s[ r ] = {} ),
- i == n.length - 1 &&
- ( s[ r ] = e[ t ] ),
- ( s = s[ r ] );
- }
- delete e[ t ];
- }
- }
- return e;
- } ),
- ( s.hasScroll = function ( e, t ) {
- var n = r( t ),
- s = t.style.overflowX,
- i = t.style.overflowY;
- return (
- ( s !== i ||
- ( 'hidden' !== i && 'visible' !== i ) ) &&
- ( 'scroll' === s ||
- 'scroll' === i ||
- n.innerHeight() < t.scrollHeight ||
- n.innerWidth() < t.scrollWidth )
- );
- } ),
- ( s.escapeMarkup = function ( e ) {
- var t = {
- '\\': '\',
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '/': '/',
- };
- return 'string' != typeof e
- ? e
- : String( e ).replace(
- /[&<>"'\/\\]/g,
- function ( e ) {
- return t[ e ];
- }
- );
- } ),
- ( s.__cache = {} );
- var n = 0;
- return (
- ( s.GetUniqueElementId = function ( e ) {
- var t = e.getAttribute( 'data-select2-id' );
- return (
- null != t ||
- ( ( t = e.id
- ? 'select2-data-' + e.id
- : 'select2-data-' +
- ( ++n ).toString() +
- '-' +
- s.generateChars( 4 ) ),
- e.setAttribute( 'data-select2-id', t ) ),
- t
- );
- } ),
- ( s.StoreData = function ( e, t, n ) {
- e = s.GetUniqueElementId( e );
- s.__cache[ e ] || ( s.__cache[ e ] = {} ),
- ( s.__cache[ e ][ t ] = n );
- } ),
- ( s.GetData = function ( e, t ) {
- var n = s.GetUniqueElementId( e );
- return t
- ? s.__cache[ n ] && null != s.__cache[ n ][ t ]
- ? s.__cache[ n ][ t ]
- : r( e ).data( t )
- : s.__cache[ n ];
- } ),
- ( s.RemoveData = function ( e ) {
- var t = s.GetUniqueElementId( e );
- null != s.__cache[ t ] && delete s.__cache[ t ],
- e.removeAttribute( 'data-select2-id' );
- } ),
- ( s.copyNonInternalCssClasses = function ( e, t ) {
- var n = ( n = e
- .getAttribute( 'class' )
- .trim()
- .split( /\s+/ ) ).filter( function ( e ) {
- return 0 === e.indexOf( 'select2-' );
- } ),
- t = ( t = t
- .getAttribute( 'class' )
- .trim()
- .split( /\s+/ ) ).filter( function ( e ) {
- return 0 !== e.indexOf( 'select2-' );
- } ),
- t = n.concat( t );
- e.setAttribute( 'class', t.join( ' ' ) );
- } ),
- s
- );
- } ),
- u.define(
- 'select2/results',
- [ 'jquery', './utils' ],
- function ( d, p ) {
- function s( e, t, n ) {
- ( this.$element = e ),
- ( this.data = n ),
- ( this.options = t ),
- s.__super__.constructor.call( this );
- }
- return (
- p.Extend( s, p.Observable ),
- ( s.prototype.render = function () {
- var e = d(
- '<ul class="select2-results__options" role="listbox"></ul>'
- );
- return (
- this.options.get( 'multiple' ) &&
- e.attr( 'aria-multiselectable', 'true' ),
- ( this.$results = e )
- );
- } ),
- ( s.prototype.clear = function () {
- this.$results.empty();
- } ),
- ( s.prototype.displayMessage = function ( e ) {
- var t = this.options.get( 'escapeMarkup' );
- this.clear(), this.hideLoading();
- var n = d(
- '<li role="alert" aria-live="assertive" class="select2-results__option"></li>'
- ),
- s = this.options
- .get( 'translations' )
- .get( e.message );
- n.append( t( s( e.args ) ) ),
- ( n[ 0 ].className +=
- ' select2-results__message' ),
- this.$results.append( n );
- } ),
- ( s.prototype.hideMessages = function () {
- this.$results
- .find( '.select2-results__message' )
- .remove();
- } ),
- ( s.prototype.append = function ( e ) {
- this.hideLoading();
- var t = [];
- if ( null != e.results && 0 !== e.results.length ) {
- e.results = this.sort( e.results );
- for ( var n = 0; n < e.results.length; n++ ) {
- var s = e.results[ n ],
- s = this.option( s );
- t.push( s );
- }
- this.$results.append( t );
- } else
- 0 === this.$results.children().length &&
- this.trigger( 'results:message', {
- message: 'noResults',
- } );
- } ),
- ( s.prototype.position = function ( e, t ) {
- t.find( '.select2-results' ).append( e );
- } ),
- ( s.prototype.sort = function ( e ) {
- return this.options.get( 'sorter' )( e );
- } ),
- ( s.prototype.highlightFirstItem = function () {
- var e = this.$results.find(
- '.select2-results__option--selectable'
- ),
- t = e.filter(
- '.select2-results__option--selected'
- );
- ( 0 < t.length ? t : e )
- .first()
- .trigger( 'mouseenter' ),
- this.ensureHighlightVisible();
- } ),
- ( s.prototype.setClasses = function () {
- var t = this;
- this.data.current( function ( e ) {
- var s = e.map( function ( e ) {
- return e.id.toString();
- } );
- t.$results
- .find(
- '.select2-results__option--selectable'
- )
- .each( function () {
- var e = d( this ),
- t = p.GetData( this, 'data' ),
- n = '' + t.id;
- ( null != t.element &&
- t.element.selected ) ||
- ( null == t.element &&
- -1 < s.indexOf( n ) )
- ? ( this.classList.add(
- 'select2-results__option--selected'
- ),
- e.attr(
- 'aria-selected',
- 'true'
- ) )
- : ( this.classList.remove(
- 'select2-results__option--selected'
- ),
- e.attr(
- 'aria-selected',
- 'false'
- ) );
- } );
- } );
- } ),
- ( s.prototype.showLoading = function ( e ) {
- this.hideLoading();
- ( e = {
- disabled: ! 0,
- loading: ! 0,
- text: this.options
- .get( 'translations' )
- .get( 'searching' )( e ),
- } ),
- ( e = this.option( e ) );
- ( e.className += ' loading-results' ),
- this.$results.prepend( e );
- } ),
- ( s.prototype.hideLoading = function () {
- this.$results.find( '.loading-results' ).remove();
- } ),
- ( s.prototype.option = function ( e ) {
- var t = document.createElement( 'li' );
- t.classList.add( 'select2-results__option' ),
- t.classList.add(
- 'select2-results__option--selectable'
- );
- var n,
- s = { role: 'option' },
- i =
- window.Element.prototype.matches ||
- window.Element.prototype
- .msMatchesSelector ||
- window.Element.prototype
- .webkitMatchesSelector;
- for ( n in ( ( ( null != e.element &&
- i.call( e.element, ':disabled' ) ) ||
- ( null == e.element && e.disabled ) ) &&
- ( ( s[ 'aria-disabled' ] = 'true' ),
- t.classList.remove(
- 'select2-results__option--selectable'
- ),
- t.classList.add(
- 'select2-results__option--disabled'
- ) ),
- null == e.id &&
- t.classList.remove(
- 'select2-results__option--selectable'
- ),
- null != e._resultId && ( t.id = e._resultId ),
- e.title && ( t.title = e.title ),
- e.children &&
- ( ( s.role = 'group' ),
- ( s[ 'aria-label' ] = e.text ),
- t.classList.remove(
- 'select2-results__option--selectable'
- ),
- t.classList.add(
- 'select2-results__option--group'
- ) ),
- s ) ) {
- var r = s[ n ];
- t.setAttribute( n, r );
- }
- if ( e.children ) {
- var o = d( t ),
- a = document.createElement( 'strong' );
- ( a.className = 'select2-results__group' ),
- this.template( e, a );
- for (
- var l = [], c = 0;
- c < e.children.length;
- c++
- ) {
- var u = e.children[ c ],
- u = this.option( u );
- l.push( u );
- }
- i = d( '<ul></ul>', {
- class:
- 'select2-results__options select2-results__options--nested',
- role: 'none',
- } );
- i.append( l ), o.append( a ), o.append( i );
- } else this.template( e, t );
- return p.StoreData( t, 'data', e ), t;
- } ),
- ( s.prototype.bind = function ( t, e ) {
- var i = this,
- n = t.id + '-results';
- this.$results.attr( 'id', n ),
- t.on( 'results:all', function ( e ) {
- i.clear(),
- i.append( e.data ),
- t.isOpen() &&
- ( i.setClasses(),
- i.highlightFirstItem() );
- } ),
- t.on( 'results:append', function ( e ) {
- i.append( e.data ),
- t.isOpen() && i.setClasses();
- } ),
- t.on( 'query', function ( e ) {
- i.hideMessages(), i.showLoading( e );
- } ),
- t.on( 'select', function () {
- t.isOpen() &&
- ( i.setClasses(),
- i.options.get( 'scrollAfterSelect' ) &&
- i.highlightFirstItem() );
- } ),
- t.on( 'unselect', function () {
- t.isOpen() &&
- ( i.setClasses(),
- i.options.get( 'scrollAfterSelect' ) &&
- i.highlightFirstItem() );
- } ),
- t.on( 'open', function () {
- i.$results.attr( 'aria-expanded', 'true' ),
- i.$results.attr(
- 'aria-hidden',
- 'false'
- ),
- i.setClasses(),
- i.ensureHighlightVisible();
- } ),
- t.on( 'close', function () {
- i.$results.attr( 'aria-expanded', 'false' ),
- i.$results.attr(
- 'aria-hidden',
- 'true'
- ),
- i.$results.removeAttr(
- 'aria-activedescendant'
- );
- } ),
- t.on( 'results:toggle', function () {
- var e = i.getHighlightedResults();
- 0 !== e.length && e.trigger( 'mouseup' );
- } ),
- t.on( 'results:select', function () {
- var e,
- t = i.getHighlightedResults();
- 0 !== t.length &&
- ( ( e = p.GetData( t[ 0 ], 'data' ) ),
- t.hasClass(
- 'select2-results__option--selected'
- )
- ? i.trigger( 'close', {} )
- : i.trigger( 'select', {
- data: e,
- } ) );
- } ),
- t.on( 'results:previous', function () {
- var e,
- t = i.getHighlightedResults(),
- n = i.$results.find(
- '.select2-results__option--selectable'
- ),
- s = n.index( t );
- s <= 0 ||
- ( ( e = s - 1 ),
- 0 === t.length && ( e = 0 ),
- ( s = n.eq( e ) ).trigger(
- 'mouseenter'
- ),
- ( t = i.$results.offset().top ),
- ( n = s.offset().top ),
- ( s =
- i.$results.scrollTop() +
- ( n - t ) ),
- 0 === e
- ? i.$results.scrollTop( 0 )
- : n - t < 0 &&
- i.$results.scrollTop( s ) );
- } ),
- t.on( 'results:next', function () {
- var e,
- t = i.getHighlightedResults(),
- n = i.$results.find(
- '.select2-results__option--selectable'
- ),
- s = n.index( t ) + 1;
- s >= n.length ||
- ( ( e = n.eq( s ) ).trigger(
- 'mouseenter'
- ),
- ( t =
- i.$results.offset().top +
- i.$results.outerHeight( ! 1 ) ),
- ( n =
- e.offset().top +
- e.outerHeight( ! 1 ) ),
- ( e = i.$results.scrollTop() + n - t ),
- 0 === s
- ? i.$results.scrollTop( 0 )
- : t < n &&
- i.$results.scrollTop( e ) );
- } ),
- t.on( 'results:focus', function ( e ) {
- e.element[ 0 ].classList.add(
- 'select2-results__option--highlighted'
- ),
- e.element[ 0 ].setAttribute(
- 'aria-selected',
- 'true'
- );
- } ),
- t.on( 'results:message', function ( e ) {
- i.displayMessage( e );
- } ),
- d.fn.mousewheel &&
- this.$results.on(
- 'mousewheel',
- function ( e ) {
- var t = i.$results.scrollTop(),
- n =
- i.$results.get( 0 )
- .scrollHeight -
- t +
- e.deltaY,
- t =
- 0 < e.deltaY &&
- t - e.deltaY <= 0,
- n =
- e.deltaY < 0 &&
- n <= i.$results.height();
- t
- ? ( i.$results.scrollTop( 0 ),
- e.preventDefault(),
- e.stopPropagation() )
- : n &&
- ( i.$results.scrollTop(
- i.$results.get( 0 )
- .scrollHeight -
- i.$results.height()
- ),
- e.preventDefault(),
- e.stopPropagation() );
- }
- ),
- this.$results.on(
- 'mouseup',
- '.select2-results__option--selectable',
- function ( e ) {
- var t = d( this ),
- n = p.GetData( this, 'data' );
- t.hasClass(
- 'select2-results__option--selected'
- )
- ? i.options.get( 'multiple' )
- ? i.trigger( 'unselect', {
- originalEvent: e,
- data: n,
- } )
- : i.trigger( 'close', {} )
- : i.trigger( 'select', {
- originalEvent: e,
- data: n,
- } );
- }
- ),
- this.$results.on(
- 'mouseenter',
- '.select2-results__option--selectable',
- function ( e ) {
- var t = p.GetData( this, 'data' );
- i
- .getHighlightedResults()
- .removeClass(
- 'select2-results__option--highlighted'
- )
- .attr( 'aria-selected', 'false' ),
- i.trigger( 'results:focus', {
- data: t,
- element: d( this ),
- } );
- }
- );
- } ),
- ( s.prototype.getHighlightedResults = function () {
- return this.$results.find(
- '.select2-results__option--highlighted'
- );
- } ),
- ( s.prototype.destroy = function () {
- this.$results.remove();
- } ),
- ( s.prototype.ensureHighlightVisible = function () {
- var e,
- t,
- n,
- s,
- i = this.getHighlightedResults();
- 0 !== i.length &&
- ( ( e = this.$results
- .find(
- '.select2-results__option--selectable'
- )
- .index( i ) ),
- ( s = this.$results.offset().top ),
- ( t = i.offset().top ),
- ( n = this.$results.scrollTop() + ( t - s ) ),
- ( s = t - s ),
- ( n -= 2 * i.outerHeight( ! 1 ) ),
- e <= 2
- ? this.$results.scrollTop( 0 )
- : ( s > this.$results.outerHeight() ||
- s < 0 ) &&
- this.$results.scrollTop( n ) );
- } ),
- ( s.prototype.template = function ( e, t ) {
- var n = this.options.get( 'templateResult' ),
- s = this.options.get( 'escapeMarkup' ),
- e = n( e, t );
- null == e
- ? ( t.style.display = 'none' )
- : 'string' == typeof e
- ? ( t.innerHTML = s( e ) )
- : d( t ).append( e );
- } ),
- s
- );
- }
- ),
- u.define( 'select2/keys', [], function () {
- return {
- BACKSPACE: 8,
- TAB: 9,
- ENTER: 13,
- SHIFT: 16,
- CTRL: 17,
- ALT: 18,
- ESC: 27,
- SPACE: 32,
- PAGE_UP: 33,
- PAGE_DOWN: 34,
- END: 35,
- HOME: 36,
- LEFT: 37,
- UP: 38,
- RIGHT: 39,
- DOWN: 40,
- DELETE: 46,
- };
- } ),
- u.define(
- 'select2/selection/base',
- [ 'jquery', '../utils', '../keys' ],
- function ( n, s, i ) {
- function r( e, t ) {
- ( this.$element = e ),
- ( this.options = t ),
- r.__super__.constructor.call( this );
- }
- return (
- s.Extend( r, s.Observable ),
- ( r.prototype.render = function () {
- var e = n(
- '<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>'
- );
- return (
- ( this._tabindex = 0 ),
- null !=
- s.GetData( this.$element[ 0 ], 'old-tabindex' )
- ? ( this._tabindex = s.GetData(
- this.$element[ 0 ],
- 'old-tabindex'
- ) )
- : null !=
- this.$element.attr( 'tabindex' ) &&
- ( this._tabindex = this.$element.attr(
- 'tabindex'
- ) ),
- e.attr(
- 'title',
- this.$element.attr( 'title' )
- ),
- e.attr( 'tabindex', this._tabindex ),
- e.attr( 'aria-disabled', 'false' ),
- ( this.$selection = e )
- );
- } ),
- ( r.prototype.bind = function ( e, t ) {
- var n = this,
- s = e.id + '-results';
- ( this.container = e ),
- this.$selection.on( 'focus', function ( e ) {
- n.trigger( 'focus', e );
- } ),
- this.$selection.on( 'blur', function ( e ) {
- n._handleBlur( e );
- } ),
- this.$selection.on( 'keydown', function ( e ) {
- n.trigger( 'keypress', e ),
- e.which === i.SPACE &&
- e.preventDefault();
- } ),
- e.on( 'results:focus', function ( e ) {
- n.$selection.attr(
- 'aria-activedescendant',
- e.data._resultId
- );
- } ),
- e.on( 'selection:update', function ( e ) {
- n.update( e.data );
- } ),
- e.on( 'open', function () {
- n.$selection.attr(
- 'aria-expanded',
- 'true'
- ),
- n.$selection.attr( 'aria-owns', s ),
- n._attachCloseHandler( e );
- } ),
- e.on( 'close', function () {
- n.$selection.attr(
- 'aria-expanded',
- 'false'
- ),
- n.$selection.removeAttr(
- 'aria-activedescendant'
- ),
- n.$selection.removeAttr( 'aria-owns' ),
- n.$selection.trigger( 'focus' ),
- n._detachCloseHandler( e );
- } ),
- e.on( 'enable', function () {
- n.$selection.attr(
- 'tabindex',
- n._tabindex
- ),
- n.$selection.attr(
- 'aria-disabled',
- 'false'
- );
- } ),
- e.on( 'disable', function () {
- n.$selection.attr( 'tabindex', '-1' ),
- n.$selection.attr(
- 'aria-disabled',
- 'true'
- );
- } );
- } ),
- ( r.prototype._handleBlur = function ( e ) {
- var t = this;
- window.setTimeout( function () {
- document.activeElement == t.$selection[ 0 ] ||
- n.contains(
- t.$selection[ 0 ],
- document.activeElement
- ) ||
- t.trigger( 'blur', e );
- }, 1 );
- } ),
- ( r.prototype._attachCloseHandler = function ( e ) {
- n( document.body ).on(
- 'mousedown.select2.' + e.id,
- function ( e ) {
- var t = n( e.target ).closest( '.select2' );
- n(
- '.select2.select2-container--open'
- ).each( function () {
- this != t[ 0 ] &&
- s
- .GetData( this, 'element' )
- .select2( 'close' );
- } );
- }
- );
- } ),
- ( r.prototype._detachCloseHandler = function ( e ) {
- n( document.body ).off(
- 'mousedown.select2.' + e.id
- );
- } ),
- ( r.prototype.position = function ( e, t ) {
- t.find( '.selection' ).append( e );
- } ),
- ( r.prototype.destroy = function () {
- this._detachCloseHandler( this.container );
- } ),
- ( r.prototype.update = function ( e ) {
- throw new Error(
- 'The `update` method must be defined in child classes.'
- );
- } ),
- ( r.prototype.isEnabled = function () {
- return ! this.isDisabled();
- } ),
- ( r.prototype.isDisabled = function () {
- return this.options.get( 'disabled' );
- } ),
- r
- );
- }
- ),
- u.define(
- 'select2/selection/single',
- [ 'jquery', './base', '../utils', '../keys' ],
- function ( e, t, n, s ) {
- function i() {
- i.__super__.constructor.apply( this, arguments );
- }
- return (
- n.Extend( i, t ),
- ( i.prototype.render = function () {
- var e = i.__super__.render.call( this );
- return (
- e[ 0 ].classList.add(
- 'select2-selection--single'
- ),
- e.html(
- '<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'
- ),
- e
- );
- } ),
- ( i.prototype.bind = function ( t, e ) {
- var n = this;
- i.__super__.bind.apply( this, arguments );
- var s = t.id + '-container';
- this.$selection
- .find( '.select2-selection__rendered' )
- .attr( 'id', s )
- .attr( 'role', 'textbox' )
- .attr( 'aria-readonly', 'true' ),
- this.$selection.attr( 'aria-labelledby', s ),
- this.$selection.attr( 'aria-controls', s ),
- this.$selection.on(
- 'mousedown',
- function ( e ) {
- 1 === e.which &&
- n.trigger( 'toggle', {
- originalEvent: e,
- } );
- }
- ),
- this.$selection.on(
- 'focus',
- function ( e ) {}
- ),
- this.$selection.on( 'blur', function ( e ) {} ),
- t.on( 'focus', function ( e ) {
- t.isOpen() ||
- n.$selection.trigger( 'focus' );
- } );
- } ),
- ( i.prototype.clear = function () {
- var e = this.$selection.find(
- '.select2-selection__rendered'
- );
- e.empty(), e.removeAttr( 'title' );
- } ),
- ( i.prototype.display = function ( e, t ) {
- var n = this.options.get( 'templateSelection' );
- return this.options.get( 'escapeMarkup' )(
- n( e, t )
- );
- } ),
- ( i.prototype.selectionContainer = function () {
- return e( '<span></span>' );
- } ),
- ( i.prototype.update = function ( e ) {
- var t, n;
- 0 !== e.length
- ? ( ( n = e[ 0 ] ),
- ( t = this.$selection.find(
- '.select2-selection__rendered'
- ) ),
- ( e = this.display( n, t ) ),
- t.empty().append( e ),
- ( n = n.title || n.text )
- ? t.attr( 'title', n )
- : t.removeAttr( 'title' ) )
- : this.clear();
- } ),
- i
- );
- }
- ),
- u.define(
- 'select2/selection/multiple',
- [ 'jquery', './base', '../utils' ],
- function ( i, e, c ) {
- function r( e, t ) {
- r.__super__.constructor.apply( this, arguments );
- }
- return (
- c.Extend( r, e ),
- ( r.prototype.render = function () {
- var e = r.__super__.render.call( this );
- return (
- e[ 0 ].classList.add(
- 'select2-selection--multiple'
- ),
- e.html(
- '<ul class="select2-selection__rendered"></ul>'
- ),
- e
- );
- } ),
- ( r.prototype.bind = function ( e, t ) {
- var n = this;
- r.__super__.bind.apply( this, arguments );
- var s = e.id + '-container';
- this.$selection
- .find( '.select2-selection__rendered' )
- .attr( 'id', s ),
- this.$selection.on( 'click', function ( e ) {
- n.trigger( 'toggle', { originalEvent: e } );
- } ),
- this.$selection.on(
- 'click',
- '.select2-selection__choice__remove',
- function ( e ) {
- var t;
- n.isDisabled() ||
- ( ( t = i( this ).parent() ),
- ( t = c.GetData( t[ 0 ], 'data' ) ),
- n.trigger( 'unselect', {
- originalEvent: e,
- data: t,
- } ) );
- }
- ),
- this.$selection.on(
- 'keydown',
- '.select2-selection__choice__remove',
- function ( e ) {
- n.isDisabled() || e.stopPropagation();
- }
- );
- } ),
- ( r.prototype.clear = function () {
- var e = this.$selection.find(
- '.select2-selection__rendered'
- );
- e.empty(), e.removeAttr( 'title' );
- } ),
- ( r.prototype.display = function ( e, t ) {
- var n = this.options.get( 'templateSelection' );
- return this.options.get( 'escapeMarkup' )(
- n( e, t )
- );
- } ),
- ( r.prototype.selectionContainer = function () {
- return i(
- '<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">×</span></button><span class="select2-selection__choice__display"></span></li>'
- );
- } ),
- ( r.prototype.update = function ( e ) {
- if ( ( this.clear(), 0 !== e.length ) ) {
- for (
- var t = [],
- n =
- this.$selection
- .find(
- '.select2-selection__rendered'
- )
- .attr( 'id' ) + '-choice-',
- s = 0;
- s < e.length;
- s++
- ) {
- var i = e[ s ],
- r = this.selectionContainer(),
- o = this.display( i, r ),
- a = n + c.generateChars( 4 ) + '-';
- i.id
- ? ( a += i.id )
- : ( a += c.generateChars( 4 ) ),
- r
- .find(
- '.select2-selection__choice__display'
- )
- .append( o )
- .attr( 'id', a );
- var l = i.title || i.text;
- l && r.attr( 'title', l );
- ( o = this.options
- .get( 'translations' )
- .get( 'removeItem' ) ),
- ( l = r.find(
- '.select2-selection__choice__remove'
- ) );
- l.attr( 'title', o() ),
- l.attr( 'aria-label', o() ),
- l.attr( 'aria-describedby', a ),
- c.StoreData( r[ 0 ], 'data', i ),
- t.push( r );
- }
- this.$selection
- .find( '.select2-selection__rendered' )
- .append( t );
- }
- } ),
- r
- );
- }
- ),
- u.define( 'select2/selection/placeholder', [], function () {
- function e( e, t, n ) {
- ( this.placeholder = this.normalizePlaceholder(
- n.get( 'placeholder' )
- ) ),
- e.call( this, t, n );
- }
- return (
- ( e.prototype.normalizePlaceholder = function ( e, t ) {
- return (
- 'string' == typeof t && ( t = { id: '', text: t } ),
- t
- );
- } ),
- ( e.prototype.createPlaceholder = function ( e, t ) {
- var n = this.selectionContainer();
- n.html( this.display( t ) ),
- n[ 0 ].classList.add(
- 'select2-selection__placeholder'
- ),
- n[ 0 ].classList.remove(
- 'select2-selection__choice'
- );
- t = t.title || t.text || n.text();
- return (
- this.$selection
- .find( '.select2-selection__rendered' )
- .attr( 'title', t ),
- n
- );
- } ),
- ( e.prototype.update = function ( e, t ) {
- var n =
- 1 == t.length && t[ 0 ].id != this.placeholder.id;
- if ( 1 < t.length || n ) return e.call( this, t );
- this.clear();
- t = this.createPlaceholder( this.placeholder );
- this.$selection
- .find( '.select2-selection__rendered' )
- .append( t );
- } ),
- e
- );
- } ),
- u.define(
- 'select2/selection/allowClear',
- [ 'jquery', '../keys', '../utils' ],
- function ( i, s, a ) {
- function e() {}
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this;
- e.call( this, t, n ),
- null == this.placeholder &&
- this.options.get( 'debug' ) &&
- window.console &&
- console.error &&
- console.error(
- 'Select2: The `allowClear` option should be used in combination with the `placeholder` option.'
- ),
- this.$selection.on(
- 'mousedown',
- '.select2-selection__clear',
- function ( e ) {
- s._handleClear( e );
- }
- ),
- t.on( 'keypress', function ( e ) {
- s._handleKeyboardClear( e, t );
- } );
- } ),
- ( e.prototype._handleClear = function ( e, t ) {
- if ( ! this.isDisabled() ) {
- var n = this.$selection.find(
- '.select2-selection__clear'
- );
- if ( 0 !== n.length ) {
- t.stopPropagation();
- var s = a.GetData( n[ 0 ], 'data' ),
- i = this.$element.val();
- this.$element.val( this.placeholder.id );
- var r = { data: s };
- if (
- ( this.trigger( 'clear', r ),
- r.prevented )
- )
- this.$element.val( i );
- else {
- for ( var o = 0; o < s.length; o++ )
- if (
- ( ( r = { data: s[ o ] } ),
- this.trigger( 'unselect', r ),
- r.prevented )
- )
- return void this.$element.val(
- i
- );
- this.$element
- .trigger( 'input' )
- .trigger( 'change' ),
- this.trigger( 'toggle', {} );
- }
- }
- }
- } ),
- ( e.prototype._handleKeyboardClear = function (
- e,
- t,
- n
- ) {
- n.isOpen() ||
- ( t.which != s.DELETE &&
- t.which != s.BACKSPACE ) ||
- this._handleClear( t );
- } ),
- ( e.prototype.update = function ( e, t ) {
- var n, s;
- e.call( this, t ),
- this.$selection
- .find( '.select2-selection__clear' )
- .remove(),
- this.$selection[ 0 ].classList.remove(
- 'select2-selection--clearable'
- ),
- 0 <
- this.$selection.find(
- '.select2-selection__placeholder'
- ).length ||
- 0 === t.length ||
- ( ( n = this.$selection
- .find( '.select2-selection__rendered' )
- .attr( 'id' ) ),
- ( s = this.options
- .get( 'translations' )
- .get( 'removeAllItems' ) ),
- ( e = i(
- '<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">×</span></button>'
- ) ).attr( 'title', s() ),
- e.attr( 'aria-label', s() ),
- e.attr( 'aria-describedby', n ),
- a.StoreData( e[ 0 ], 'data', t ),
- this.$selection.prepend( e ),
- this.$selection[ 0 ].classList.add(
- 'select2-selection--clearable'
- ) );
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/selection/search',
- [ 'jquery', '../utils', '../keys' ],
- function ( s, a, l ) {
- function e( e, t, n ) {
- e.call( this, t, n );
- }
- return (
- ( e.prototype.render = function ( e ) {
- var t = this.options
- .get( 'translations' )
- .get( 'search' ),
- n = s(
- '<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>'
- );
- ( this.$searchContainer = n ),
- ( this.$search = n.find( 'textarea' ) ),
- this.$search.prop(
- 'autocomplete',
- this.options.get( 'autocomplete' )
- ),
- this.$search.attr( 'aria-label', t() );
- e = e.call( this );
- return (
- this._transferTabIndex(),
- e.append( this.$searchContainer ),
- e
- );
- } ),
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this,
- i = t.id + '-results',
- r = t.id + '-container';
- e.call( this, t, n ),
- s.$search.attr( 'aria-describedby', r ),
- t.on( 'open', function () {
- s.$search.attr( 'aria-controls', i ),
- s.$search.trigger( 'focus' );
- } ),
- t.on( 'close', function () {
- s.$search.val( '' ),
- s.resizeSearch(),
- s.$search.removeAttr( 'aria-controls' ),
- s.$search.removeAttr(
- 'aria-activedescendant'
- ),
- s.$search.trigger( 'focus' );
- } ),
- t.on( 'enable', function () {
- s.$search.prop( 'disabled', ! 1 ),
- s._transferTabIndex();
- } ),
- t.on( 'disable', function () {
- s.$search.prop( 'disabled', ! 0 );
- } ),
- t.on( 'focus', function ( e ) {
- s.$search.trigger( 'focus' );
- } ),
- t.on( 'results:focus', function ( e ) {
- e.data._resultId
- ? s.$search.attr(
- 'aria-activedescendant',
- e.data._resultId
- )
- : s.$search.removeAttr(
- 'aria-activedescendant'
- );
- } ),
- this.$selection.on(
- 'focusin',
- '.select2-search--inline',
- function ( e ) {
- s.trigger( 'focus', e );
- }
- ),
- this.$selection.on(
- 'focusout',
- '.select2-search--inline',
- function ( e ) {
- s._handleBlur( e );
- }
- ),
- this.$selection.on(
- 'keydown',
- '.select2-search--inline',
- function ( e ) {
- var t;
- e.stopPropagation(),
- s.trigger( 'keypress', e ),
- ( s._keyUpPrevented = e.isDefaultPrevented() ),
- e.which !== l.BACKSPACE ||
- '' !== s.$search.val() ||
- ( 0 <
- ( t = s.$selection
- .find(
- '.select2-selection__choice'
- )
- .last() ).length &&
- ( ( t = a.GetData(
- t[ 0 ],
- 'data'
- ) ),
- s.searchRemoveChoice( t ),
- e.preventDefault() ) );
- }
- ),
- this.$selection.on(
- 'click',
- '.select2-search--inline',
- function ( e ) {
- s.$search.val() && e.stopPropagation();
- }
- );
- var t = document.documentMode,
- o = t && t <= 11;
- this.$selection.on(
- 'input.searchcheck',
- '.select2-search--inline',
- function ( e ) {
- o
- ? s.$selection.off(
- 'input.search input.searchcheck'
- )
- : s.$selection.off( 'keyup.search' );
- }
- ),
- this.$selection.on(
- 'keyup.search input.search',
- '.select2-search--inline',
- function ( e ) {
- var t;
- o && 'input' === e.type
- ? s.$selection.off(
- 'input.search input.searchcheck'
- )
- : ( t = e.which ) != l.SHIFT &&
- t != l.CTRL &&
- t != l.ALT &&
- t != l.TAB &&
- s.handleSearch( e );
- }
- );
- } ),
- ( e.prototype._transferTabIndex = function ( e ) {
- this.$search.attr(
- 'tabindex',
- this.$selection.attr( 'tabindex' )
- ),
- this.$selection.attr( 'tabindex', '-1' );
- } ),
- ( e.prototype.createPlaceholder = function ( e, t ) {
- this.$search.attr( 'placeholder', t.text );
- } ),
- ( e.prototype.update = function ( e, t ) {
- var n = this.$search[ 0 ] == document.activeElement;
- this.$search.attr( 'placeholder', '' ),
- e.call( this, t ),
- this.resizeSearch(),
- n && this.$search.trigger( 'focus' );
- } ),
- ( e.prototype.handleSearch = function () {
- var e;
- this.resizeSearch(),
- this._keyUpPrevented ||
- ( ( e = this.$search.val() ),
- this.trigger( 'query', { term: e } ) ),
- ( this._keyUpPrevented = ! 1 );
- } ),
- ( e.prototype.searchRemoveChoice = function ( e, t ) {
- this.trigger( 'unselect', { data: t } ),
- this.$search.val( t.text ),
- this.handleSearch();
- } ),
- ( e.prototype.resizeSearch = function () {
- this.$search.css( 'width', '25px' );
- var e = '100%';
- '' === this.$search.attr( 'placeholder' ) &&
- ( e =
- 0.75 * ( this.$search.val().length + 1 ) +
- 'em' ),
- this.$search.css( 'width', e );
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/selection/selectionCss',
- [ '../utils' ],
- function ( n ) {
- function e() {}
- return (
- ( e.prototype.render = function ( e ) {
- var t = e.call( this ),
- e =
- this.options.get( 'selectionCssClass' ) ||
- '';
- return (
- -1 !== e.indexOf( ':all:' ) &&
- ( ( e = e.replace( ':all:', '' ) ),
- n.copyNonInternalCssClasses(
- t[ 0 ],
- this.$element[ 0 ]
- ) ),
- t.addClass( e ),
- t
- );
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/selection/eventRelay',
- [ 'jquery' ],
- function ( o ) {
- function e() {}
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this,
- i = [
- 'open',
- 'opening',
- 'close',
- 'closing',
- 'select',
- 'selecting',
- 'unselect',
- 'unselecting',
- 'clear',
- 'clearing',
- ],
- r = [
- 'opening',
- 'closing',
- 'selecting',
- 'unselecting',
- 'clearing',
- ];
- e.call( this, t, n ),
- t.on( '*', function ( e, t ) {
- var n;
- -1 !== i.indexOf( e ) &&
- ( ( t = t || {} ),
- ( n = o.Event( 'select2:' + e, {
- params: t,
- } ) ),
- s.$element.trigger( n ),
- -1 !== r.indexOf( e ) &&
- ( t.prevented = n.isDefaultPrevented() ) );
- } );
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/translation',
- [ 'jquery', 'require' ],
- function ( t, n ) {
- function s( e ) {
- this.dict = e || {};
- }
- return (
- ( s.prototype.all = function () {
- return this.dict;
- } ),
- ( s.prototype.get = function ( e ) {
- return this.dict[ e ];
- } ),
- ( s.prototype.extend = function ( e ) {
- this.dict = t.extend( {}, e.all(), this.dict );
- } ),
- ( s._cache = {} ),
- ( s.loadPath = function ( e ) {
- var t;
- return (
- e in s._cache ||
- ( ( t = n( e ) ), ( s._cache[ e ] = t ) ),
- new s( s._cache[ e ] )
- );
- } ),
- s
- );
- }
- ),
- u.define( 'select2/diacritics', [], function () {
- return {
- 'Ⓐ': 'A',
- A: 'A',
- À: 'A',
- Á: 'A',
- Â: 'A',
- Ầ: 'A',
- Ấ: 'A',
- Ẫ: 'A',
- Ẩ: 'A',
- Ã: 'A',
- Ā: 'A',
- Ă: 'A',
- Ằ: 'A',
- Ắ: 'A',
- Ẵ: 'A',
- Ẳ: 'A',
- Ȧ: 'A',
- Ǡ: 'A',
- Ä: 'A',
- Ǟ: 'A',
- Ả: 'A',
- Å: 'A',
- Ǻ: 'A',
- Ǎ: 'A',
- Ȁ: 'A',
- Ȃ: 'A',
- Ạ: 'A',
- Ậ: 'A',
- Ặ: 'A',
- Ḁ: 'A',
- Ą: 'A',
- Ⱥ: 'A',
- Ɐ: 'A',
- Ꜳ: 'AA',
- Æ: 'AE',
- Ǽ: 'AE',
- Ǣ: 'AE',
- Ꜵ: 'AO',
- Ꜷ: 'AU',
- Ꜹ: 'AV',
- Ꜻ: 'AV',
- Ꜽ: 'AY',
- 'Ⓑ': 'B',
- B: 'B',
- Ḃ: 'B',
- Ḅ: 'B',
- Ḇ: 'B',
- Ƀ: 'B',
- Ƃ: 'B',
- Ɓ: 'B',
- 'Ⓒ': 'C',
- C: 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Z',
- Ȥ: 'Z',
- Ɀ: 'Z',
- Ⱬ: 'Z',
- Ꝣ: 'Z',
- 'ⓐ': 'a',
- a: 'a',
- ẚ: 'a',
- à: 'a',
- á: 'a',
- â: 'a',
- ầ: 'a',
- ấ: 'a',
- ẫ: 'a',
- ẩ: 'a',
- ã: 'a',
- ā: 'a',
- ă: 'a',
- ằ: 'a',
- ắ: 'a',
- ẵ: 'a',
- ẳ: 'a',
- ȧ: 'a',
- ǡ: 'a',
- ä: 'a',
- ǟ: 'a',
- ả: 'a',
- å: 'a',
- ǻ: 'a',
- ǎ: 'a',
- ȁ: 'a',
- ȃ: 'a',
- ạ: 'a',
- ậ: 'a',
- ặ: 'a',
- ḁ: 'a',
- ą: 'a',
- ⱥ: 'a',
- ɐ: 'a',
- ꜳ: 'aa',
- æ: 'ae',
- ǽ: 'ae',
- ǣ: 'ae',
- ꜵ: 'ao',
- ꜷ: 'au',
- ꜹ: 'av',
- ꜻ: 'av',
- ꜽ: 'ay',
- 'ⓑ': 'b',
- b: 'b',
- ḃ: 'b',
- ḅ: 'b',
- ḇ: 'b',
- ƀ: 'b',
- ƃ: 'b',
- ɓ: 'b',
- 'ⓒ': 'c',
- c: 'c',
- ć: 'c',
- ĉ: 'c',
- ċ: 'c',
- č: 'c',
- ç: 'c',
- ḉ: 'c',
- ƈ: 'c',
- ȼ: 'c',
- ꜿ: 'c',
- ↄ: 'c',
- 'ⓓ': 'd',
- d: 'd',
- ḋ: 'd',
- ď: 'd',
- ḍ: 'd',
- ḑ: 'd',
- ḓ: 'd',
- ḏ: 'd',
- đ: 'd',
- ƌ: 'd',
- ɖ: 'd',
- ɗ: 'd',
- ꝺ: 'd',
- dz: 'dz',
- dž: 'dz',
- 'ⓔ': 'e',
- e: 'e',
- è: 'e',
- é: 'e',
- ê: 'e',
- ề: 'e',
- ế: 'e',
- ễ: 'e',
- ể: 'e',
- ẽ: 'e',
- ē: 'e',
- ḕ: 'e',
- ḗ: 'e',
- ĕ: 'e',
- ė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': 'r',
- r: 'r',
- ŕ: 'r',
- ṙ: 'r',
- ř: 'r',
- ȑ: 'r',
- ȓ: 'r',
- ṛ: 'r',
- ṝ: 'r',
- ŗ: 'r',
- ṟ: 'r',
- ɍ: 'r',
- ɽ: 'r',
- ꝛ: 'r',
- ꞧ: 'r',
- ꞃ: 'r',
- 'ⓢ': 's',
- s: 's',
- ß: 's',
- ś: 's',
- ṥ: 's',
- ŝ: 's',
- ṡ: 's',
- š: 's',
- ṧ: 's',
- ṣ: 's',
- ṩ: 's',
- ș: 's',
- ş: 's',
- ȿ: 's',
- ꞩ: 's',
- ꞅ: 's',
- ẛ: 's',
- 'ⓣ': 't',
- t: 't',
- ṫ: 't',
- ẗ: 't',
- ť: 't',
- ṭ: 't',
- ț: 't',
- ţ: 't',
- ṱ: 't',
- ṯ: 't',
- ŧ: 't',
- ƭ: 't',
- ʈ: 't',
- ⱦ: 't',
- ꞇ: 't',
- ꜩ: 'tz',
- 'ⓤ': 'u',
- u: 'u',
- ù: 'u',
- ú: 'u',
- û: 'u',
- ũ: 'u',
- ṹ: 'u',
- ū: 'u',
- ṻ: 'u',
- ŭ: 'u',
- ü: 'u',
- ǜ: 'u',
- ǘ: 'u',
- ǖ: 'u',
- ǚ: 'u',
- ủ: 'u',
- ů: 'u',
- ű: 'u',
- ǔ: 'u',
- ȕ: 'u',
- ȗ: 'u',
- ư: 'u',
- ừ: 'u',
- ứ: 'u',
- ữ: 'u',
- ử: 'u',
- ự: 'u',
- ụ: 'u',
- ṳ: 'u',
- ų: 'u',
- ṷ: 'u',
- ṵ: 'u',
- ʉ: 'u',
- 'ⓥ': 'v',
- v: 'v',
- ṽ: 'v',
- ṿ: 'v',
- ʋ: 'v',
- ꝟ: 'v',
- ʌ: 'v',
- ꝡ: 'vy',
- 'ⓦ': 'w',
- w: 'w',
- ẁ: 'w',
- ẃ: 'w',
- ŵ: 'w',
- ẇ: 'w',
- ẅ: 'w',
- ẘ: 'w',
- ẉ: 'w',
- ⱳ: 'w',
- 'ⓧ': 'x',
- x: 'x',
- ẋ: 'x',
- ẍ: 'x',
- 'ⓨ': 'y',
- y: 'y',
- ỳ: 'y',
- ý: 'y',
- ŷ: 'y',
- ỹ: 'y',
- ȳ: 'y',
- ẏ: 'y',
- ÿ: 'y',
- ỷ: 'y',
- ẙ: 'y',
- ỵ: 'y',
- ƴ: 'y',
- ɏ: 'y',
- ỿ: 'y',
- 'ⓩ': 'z',
- z: 'z',
- ź: 'z',
- ẑ: 'z',
- ż: 'z',
- ž: 'z',
- ẓ: 'z',
- ẕ: 'z',
- ƶ: 'z',
- ȥ: 'z',
- ɀ: 'z',
- ⱬ: 'z',
- ꝣ: 'z',
- Ά: 'Α',
- Έ: 'Ε',
- Ή: 'Η',
- Ί: 'Ι',
- Ϊ: 'Ι',
- Ό: 'Ο',
- Ύ: 'Υ',
- Ϋ: 'Υ',
- Ώ: 'Ω',
- ά: 'α',
- έ: 'ε',
- ή: 'η',
- ί: 'ι',
- ϊ: 'ι',
- ΐ: 'ι',
- ό: 'ο',
- ύ: 'υ',
- ϋ: 'υ',
- ΰ: 'υ',
- ώ: 'ω',
- ς: 'σ',
- '’': "'",
- };
- } ),
- u.define( 'select2/data/base', [ '../utils' ], function ( n ) {
- function s( e, t ) {
- s.__super__.constructor.call( this );
- }
- return (
- n.Extend( s, n.Observable ),
- ( s.prototype.current = function ( e ) {
- throw new Error(
- 'The `current` method must be defined in child classes.'
- );
- } ),
- ( s.prototype.query = function ( e, t ) {
- throw new Error(
- 'The `query` method must be defined in child classes.'
- );
- } ),
- ( s.prototype.bind = function ( e, t ) {} ),
- ( s.prototype.destroy = function () {} ),
- ( s.prototype.generateResultId = function ( e, t ) {
- e = e.id + '-result-';
- return (
- ( e += n.generateChars( 4 ) ),
- null != t.id
- ? ( e += '-' + t.id.toString() )
- : ( e += '-' + n.generateChars( 4 ) ),
- e
- );
- } ),
- s
- );
- } ),
- u.define(
- 'select2/data/select',
- [ './base', '../utils', 'jquery' ],
- function ( e, a, l ) {
- function n( e, t ) {
- ( this.$element = e ),
- ( this.options = t ),
- n.__super__.constructor.call( this );
- }
- return (
- a.Extend( n, e ),
- ( n.prototype.current = function ( e ) {
- var t = this;
- e(
- Array.prototype.map.call(
- this.$element[ 0 ].querySelectorAll(
- ':checked'
- ),
- function ( e ) {
- return t.item( l( e ) );
- }
- )
- );
- } ),
- ( n.prototype.select = function ( i ) {
- var e,
- r = this;
- if (
- ( ( i.selected = ! 0 ),
- null != i.element &&
- 'option' ===
- i.element.tagName.toLowerCase() )
- )
- return (
- ( i.element.selected = ! 0 ),
- void this.$element
- .trigger( 'input' )
- .trigger( 'change' )
- );
- this.$element.prop( 'multiple' )
- ? this.current( function ( e ) {
- var t = [];
- ( i = [ i ] ).push.apply( i, e );
- for ( var n = 0; n < i.length; n++ ) {
- var s = i[ n ].id;
- -1 === t.indexOf( s ) &&
- t.push( s );
- }
- r.$element.val( t ),
- r.$element
- .trigger( 'input' )
- .trigger( 'change' );
- } )
- : ( ( e = i.id ),
- this.$element.val( e ),
- this.$element
- .trigger( 'input' )
- .trigger( 'change' ) );
- } ),
- ( n.prototype.unselect = function ( i ) {
- var r = this;
- if ( this.$element.prop( 'multiple' ) ) {
- if (
- ( ( i.selected = ! 1 ),
- null != i.element &&
- 'option' ===
- i.element.tagName.toLowerCase() )
- )
- return (
- ( i.element.selected = ! 1 ),
- void this.$element
- .trigger( 'input' )
- .trigger( 'change' )
- );
- this.current( function ( e ) {
- for (
- var t = [], n = 0;
- n < e.length;
- n++
- ) {
- var s = e[ n ].id;
- s !== i.id &&
- -1 === t.indexOf( s ) &&
- t.push( s );
- }
- r.$element.val( t ),
- r.$element
- .trigger( 'input' )
- .trigger( 'change' );
- } );
- }
- } ),
- ( n.prototype.bind = function ( e, t ) {
- var n = this;
- ( this.container = e ).on(
- 'select',
- function ( e ) {
- n.select( e.data );
- }
- ),
- e.on( 'unselect', function ( e ) {
- n.unselect( e.data );
- } );
- } ),
- ( n.prototype.destroy = function () {
- this.$element.find( '*' ).each( function () {
- a.RemoveData( this );
- } );
- } ),
- ( n.prototype.query = function ( t, e ) {
- var n = [],
- s = this;
- this.$element.children().each( function () {
- var e;
- ( 'option' !== this.tagName.toLowerCase() &&
- 'optgroup' !==
- this.tagName.toLowerCase() ) ||
- ( ( e = l( this ) ),
- ( e = s.item( e ) ),
- null !== ( e = s.matches( t, e ) ) &&
- n.push( e ) );
- } ),
- e( { results: n } );
- } ),
- ( n.prototype.addOptions = function ( e ) {
- this.$element.append( e );
- } ),
- ( n.prototype.option = function ( e ) {
- var t;
- e.children
- ? ( ( t = document.createElement(
- 'optgroup'
- ) ).label = e.text )
- : void 0 !==
- ( t = document.createElement( 'option' ) )
- .textContent
- ? ( t.textContent = e.text )
- : ( t.innerText = e.text ),
- void 0 !== e.id && ( t.value = e.id ),
- e.disabled && ( t.disabled = ! 0 ),
- e.selected && ( t.selected = ! 0 ),
- e.title && ( t.title = e.title );
- e = this._normalizeItem( e );
- return (
- ( e.element = t ),
- a.StoreData( t, 'data', e ),
- l( t )
- );
- } ),
- ( n.prototype.item = function ( e ) {
- var t = {};
- if ( null != ( t = a.GetData( e[ 0 ], 'data' ) ) )
- return t;
- var n = e[ 0 ];
- if ( 'option' === n.tagName.toLowerCase() )
- t = {
- id: e.val(),
- text: e.text(),
- disabled: e.prop( 'disabled' ),
- selected: e.prop( 'selected' ),
- title: e.prop( 'title' ),
- };
- else if ( 'optgroup' === n.tagName.toLowerCase() ) {
- t = {
- text: e.prop( 'label' ),
- children: [],
- title: e.prop( 'title' ),
- };
- for (
- var s = e.children( 'option' ),
- i = [],
- r = 0;
- r < s.length;
- r++
- ) {
- var o = l( s[ r ] ),
- o = this.item( o );
- i.push( o );
- }
- t.children = i;
- }
- return (
- ( ( t = this._normalizeItem( t ) ).element =
- e[ 0 ] ),
- a.StoreData( e[ 0 ], 'data', t ),
- t
- );
- } ),
- ( n.prototype._normalizeItem = function ( e ) {
- e !== Object( e ) && ( e = { id: e, text: e } );
- return (
- null !=
- ( e = l.extend( {}, { text: '' }, e ) )
- .id && ( e.id = e.id.toString() ),
- null != e.text &&
- ( e.text = e.text.toString() ),
- null == e._resultId &&
- e.id &&
- null != this.container &&
- ( e._resultId = this.generateResultId(
- this.container,
- e
- ) ),
- l.extend(
- {},
- { selected: ! 1, disabled: ! 1 },
- e
- )
- );
- } ),
- ( n.prototype.matches = function ( e, t ) {
- return this.options.get( 'matcher' )( e, t );
- } ),
- n
- );
- }
- ),
- u.define(
- 'select2/data/array',
- [ './select', '../utils', 'jquery' ],
- function ( e, t, c ) {
- function s( e, t ) {
- ( this._dataToConvert = t.get( 'data' ) || [] ),
- s.__super__.constructor.call( this, e, t );
- }
- return (
- t.Extend( s, e ),
- ( s.prototype.bind = function ( e, t ) {
- s.__super__.bind.call( this, e, t ),
- this.addOptions(
- this.convertToOptions( this._dataToConvert )
- );
- } ),
- ( s.prototype.select = function ( n ) {
- var e = this.$element
- .find( 'option' )
- .filter( function ( e, t ) {
- return t.value == n.id.toString();
- } );
- 0 === e.length &&
- ( ( e = this.option( n ) ),
- this.addOptions( e ) ),
- s.__super__.select.call( this, n );
- } ),
- ( s.prototype.convertToOptions = function ( e ) {
- var t = this,
- n = this.$element.find( 'option' ),
- s = n
- .map( function () {
- return t.item( c( this ) ).id;
- } )
- .get(),
- i = [];
- for ( var r = 0; r < e.length; r++ ) {
- var o,
- a,
- l = this._normalizeItem( e[ r ] );
- 0 <= s.indexOf( l.id )
- ? ( ( o = n.filter(
- ( function ( e ) {
- return function () {
- return (
- c( this ).val() == e.id
- );
- };
- } )( l )
- ) ),
- ( a = this.item( o ) ),
- ( a = c.extend( ! 0, {}, l, a ) ),
- ( a = this.option( a ) ),
- o.replaceWith( a ) )
- : ( ( a = this.option( l ) ),
- l.children &&
- ( ( l = this.convertToOptions(
- l.children
- ) ),
- a.append( l ) ),
- i.push( a ) );
- }
- return i;
- } ),
- s
- );
- }
- ),
- u.define(
- 'select2/data/ajax',
- [ './array', '../utils', 'jquery' ],
- function ( e, t, r ) {
- function n( e, t ) {
- ( this.ajaxOptions = this._applyDefaults(
- t.get( 'ajax' )
- ) ),
- null != this.ajaxOptions.processResults &&
- ( this.processResults = this.ajaxOptions.processResults ),
- n.__super__.constructor.call( this, e, t );
- }
- return (
- t.Extend( n, e ),
- ( n.prototype._applyDefaults = function ( e ) {
- var t = {
- data: function ( e ) {
- return r.extend( {}, e, { q: e.term } );
- },
- transport: function ( e, t, n ) {
- e = r.ajax( e );
- return e.then( t ), e.fail( n ), e;
- },
- };
- return r.extend( {}, t, e, ! 0 );
- } ),
- ( n.prototype.processResults = function ( e ) {
- return e;
- } ),
- ( n.prototype.query = function ( t, n ) {
- var s = this;
- null != this._request &&
- ( 'function' == typeof this._request.abort &&
- this._request.abort(),
- ( this._request = null ) );
- var i = r.extend(
- { type: 'GET' },
- this.ajaxOptions
- );
- function e() {
- var e = i.transport(
- i,
- function ( e ) {
- e = s.processResults( e, t );
- s.options.get( 'debug' ) &&
- window.console &&
- console.error &&
- ( ( e &&
- e.results &&
- Array.isArray( e.results ) ) ||
- console.error(
- 'Select2: The AJAX results did not return an array in the `results` key of the response.'
- ) ),
- n( e );
- },
- function () {
- ( 'status' in e &&
- ( 0 === e.status ||
- '0' === e.status ) ) ||
- s.trigger( 'results:message', {
- message: 'errorLoading',
- } );
- }
- );
- s._request = e;
- }
- 'function' == typeof i.url &&
- ( i.url = i.url.call( this.$element, t ) ),
- 'function' == typeof i.data &&
- ( i.data = i.data.call(
- this.$element,
- t
- ) ),
- this.ajaxOptions.delay && null != t.term
- ? ( this._queryTimeout &&
- window.clearTimeout(
- this._queryTimeout
- ),
- ( this._queryTimeout = window.setTimeout(
- e,
- this.ajaxOptions.delay
- ) ) )
- : e();
- } ),
- n
- );
- }
- ),
- u.define( 'select2/data/tags', [ 'jquery' ], function ( t ) {
- function e( e, t, n ) {
- var s = n.get( 'tags' ),
- i = n.get( 'createTag' );
- void 0 !== i && ( this.createTag = i );
- i = n.get( 'insertTag' );
- if (
- ( void 0 !== i && ( this.insertTag = i ),
- e.call( this, t, n ),
- Array.isArray( s ) )
- )
- for ( var r = 0; r < s.length; r++ ) {
- var o = s[ r ],
- o = this._normalizeItem( o ),
- o = this.option( o );
- this.$element.append( o );
- }
- }
- return (
- ( e.prototype.query = function ( e, c, u ) {
- var d = this;
- this._removeOldTags(),
- null != c.term && null == c.page
- ? e.call( this, c, function e( t, n ) {
- for (
- var s = t.results, i = 0;
- i < s.length;
- i++
- ) {
- var r = s[ i ],
- o =
- null != r.children &&
- ! e(
- { results: r.children },
- ! 0
- );
- if (
- (
- r.text || ''
- ).toUpperCase() ===
- (
- c.term || ''
- ).toUpperCase() ||
- o
- )
- return (
- ! n &&
- ( ( t.data = s ),
- void u( t ) )
- );
- }
- if ( n ) return ! 0;
- var a,
- l = d.createTag( c );
- null != l &&
- ( ( a = d.option( l ) ).attr(
- 'data-select2-tag',
- 'true'
- ),
- d.addOptions( [ a ] ),
- d.insertTag( s, l ) ),
- ( t.results = s ),
- u( t );
- } )
- : e.call( this, c, u );
- } ),
- ( e.prototype.createTag = function ( e, t ) {
- if ( null == t.term ) return null;
- t = t.term.trim();
- return '' === t ? null : { id: t, text: t };
- } ),
- ( e.prototype.insertTag = function ( e, t, n ) {
- t.unshift( n );
- } ),
- ( e.prototype._removeOldTags = function ( e ) {
- this.$element
- .find( 'option[data-select2-tag]' )
- .each( function () {
- this.selected || t( this ).remove();
- } );
- } ),
- e
- );
- } ),
- u.define( 'select2/data/tokenizer', [ 'jquery' ], function ( c ) {
- function e( e, t, n ) {
- var s = n.get( 'tokenizer' );
- void 0 !== s && ( this.tokenizer = s ),
- e.call( this, t, n );
- }
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- e.call( this, t, n ),
- ( this.$search =
- t.dropdown.$search ||
- t.selection.$search ||
- n.find( '.select2-search__field' ) );
- } ),
- ( e.prototype.query = function ( e, t, n ) {
- var s = this;
- t.term = t.term || '';
- var i = this.tokenizer(
- t,
- this.options,
- function ( e ) {
- var t,
- n = s._normalizeItem( e );
- s.$element
- .find( 'option' )
- .filter( function () {
- return c( this ).val() === n.id;
- } ).length ||
- ( ( t = s.option( n ) ).attr(
- 'data-select2-tag',
- ! 0
- ),
- s._removeOldTags(),
- s.addOptions( [ t ] ) ),
- ( t = n ),
- s.trigger( 'select', { data: t } );
- }
- );
- i.term !== t.term &&
- ( this.$search.length &&
- ( this.$search.val( i.term ),
- this.$search.trigger( 'focus' ) ),
- ( t.term = i.term ) ),
- e.call( this, t, n );
- } ),
- ( e.prototype.tokenizer = function ( e, t, n, s ) {
- for (
- var i = n.get( 'tokenSeparators' ) || [],
- r = t.term,
- o = 0,
- a =
- this.createTag ||
- function ( e ) {
- return { id: e.term, text: e.term };
- };
- o < r.length;
- ) {
- var l = r[ o ];
- -1 !== i.indexOf( l )
- ? ( ( l = r.substr( 0, o ) ),
- null !=
- ( l = a( c.extend( {}, t, { term: l } ) ) )
- ? ( s( l ),
- ( r = r.substr( o + 1 ) || '' ),
- ( o = 0 ) )
- : o++ )
- : o++;
- }
- return { term: r };
- } ),
- e
- );
- } ),
- u.define( 'select2/data/minimumInputLength', [], function () {
- function e( e, t, n ) {
- ( this.minimumInputLength = n.get( 'minimumInputLength' ) ),
- e.call( this, t, n );
- }
- return (
- ( e.prototype.query = function ( e, t, n ) {
- ( t.term = t.term || '' ),
- t.term.length < this.minimumInputLength
- ? this.trigger( 'results:message', {
- message: 'inputTooShort',
- args: {
- minimum: this.minimumInputLength,
- input: t.term,
- params: t,
- },
- } )
- : e.call( this, t, n );
- } ),
- e
- );
- } ),
- u.define( 'select2/data/maximumInputLength', [], function () {
- function e( e, t, n ) {
- ( this.maximumInputLength = n.get( 'maximumInputLength' ) ),
- e.call( this, t, n );
- }
- return (
- ( e.prototype.query = function ( e, t, n ) {
- ( t.term = t.term || '' ),
- 0 < this.maximumInputLength &&
- t.term.length > this.maximumInputLength
- ? this.trigger( 'results:message', {
- message: 'inputTooLong',
- args: {
- maximum: this.maximumInputLength,
- input: t.term,
- params: t,
- },
- } )
- : e.call( this, t, n );
- } ),
- e
- );
- } ),
- u.define( 'select2/data/maximumSelectionLength', [], function () {
- function e( e, t, n ) {
- ( this.maximumSelectionLength = n.get(
- 'maximumSelectionLength'
- ) ),
- e.call( this, t, n );
- }
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this;
- e.call( this, t, n ),
- t.on( 'select', function () {
- s._checkIfMaximumSelected();
- } );
- } ),
- ( e.prototype.query = function ( e, t, n ) {
- var s = this;
- this._checkIfMaximumSelected( function () {
- e.call( s, t, n );
- } );
- } ),
- ( e.prototype._checkIfMaximumSelected = function ( e, t ) {
- var n = this;
- this.current( function ( e ) {
- e = null != e ? e.length : 0;
- 0 < n.maximumSelectionLength &&
- e >= n.maximumSelectionLength
- ? n.trigger( 'results:message', {
- message: 'maximumSelected',
- args: {
- maximum: n.maximumSelectionLength,
- },
- } )
- : t && t();
- } );
- } ),
- e
- );
- } ),
- u.define(
- 'select2/dropdown',
- [ 'jquery', './utils' ],
- function ( t, e ) {
- function n( e, t ) {
- ( this.$element = e ),
- ( this.options = t ),
- n.__super__.constructor.call( this );
- }
- return (
- e.Extend( n, e.Observable ),
- ( n.prototype.render = function () {
- var e = t(
- '<span class="select2-dropdown"><span class="select2-results"></span></span>'
- );
- return (
- e.attr( 'dir', this.options.get( 'dir' ) ),
- ( this.$dropdown = e )
- );
- } ),
- ( n.prototype.bind = function () {} ),
- ( n.prototype.position = function ( e, t ) {} ),
- ( n.prototype.destroy = function () {
- this.$dropdown.remove();
- } ),
- n
- );
- }
- ),
- u.define( 'select2/dropdown/search', [ 'jquery' ], function ( r ) {
- function e() {}
- return (
- ( e.prototype.render = function ( e ) {
- var t = e.call( this ),
- n = this.options
- .get( 'translations' )
- .get( 'search' ),
- e = r(
- '<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>'
- );
- return (
- ( this.$searchContainer = e ),
- ( this.$search = e.find( 'input' ) ),
- this.$search.prop(
- 'autocomplete',
- this.options.get( 'autocomplete' )
- ),
- this.$search.attr( 'aria-label', n() ),
- t.prepend( e ),
- t
- );
- } ),
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this,
- i = t.id + '-results';
- e.call( this, t, n ),
- this.$search.on( 'keydown', function ( e ) {
- s.trigger( 'keypress', e ),
- ( s._keyUpPrevented = e.isDefaultPrevented() );
- } ),
- this.$search.on( 'input', function ( e ) {
- r( this ).off( 'keyup' );
- } ),
- this.$search.on( 'keyup input', function ( e ) {
- s.handleSearch( e );
- } ),
- t.on( 'open', function () {
- s.$search.attr( 'tabindex', 0 ),
- s.$search.attr( 'aria-controls', i ),
- s.$search.trigger( 'focus' ),
- window.setTimeout( function () {
- s.$search.trigger( 'focus' );
- }, 0 );
- } ),
- t.on( 'close', function () {
- s.$search.attr( 'tabindex', -1 ),
- s.$search.removeAttr( 'aria-controls' ),
- s.$search.removeAttr(
- 'aria-activedescendant'
- ),
- s.$search.val( '' ),
- s.$search.trigger( 'blur' );
- } ),
- t.on( 'focus', function () {
- t.isOpen() || s.$search.trigger( 'focus' );
- } ),
- t.on( 'results:all', function ( e ) {
- ( null != e.query.term &&
- '' !== e.query.term ) ||
- ( s.showSearch( e )
- ? s.$searchContainer[ 0 ].classList.remove(
- 'select2-search--hide'
- )
- : s.$searchContainer[ 0 ].classList.add(
- 'select2-search--hide'
- ) );
- } ),
- t.on( 'results:focus', function ( e ) {
- e.data._resultId
- ? s.$search.attr(
- 'aria-activedescendant',
- e.data._resultId
- )
- : s.$search.removeAttr(
- 'aria-activedescendant'
- );
- } );
- } ),
- ( e.prototype.handleSearch = function ( e ) {
- var t;
- this._keyUpPrevented ||
- ( ( t = this.$search.val() ),
- this.trigger( 'query', { term: t } ) ),
- ( this._keyUpPrevented = ! 1 );
- } ),
- ( e.prototype.showSearch = function ( e, t ) {
- return ! 0;
- } ),
- e
- );
- } ),
- u.define( 'select2/dropdown/hidePlaceholder', [], function () {
- function e( e, t, n, s ) {
- ( this.placeholder = this.normalizePlaceholder(
- n.get( 'placeholder' )
- ) ),
- e.call( this, t, n, s );
- }
- return (
- ( e.prototype.append = function ( e, t ) {
- ( t.results = this.removePlaceholder( t.results ) ),
- e.call( this, t );
- } ),
- ( e.prototype.normalizePlaceholder = function ( e, t ) {
- return (
- 'string' == typeof t && ( t = { id: '', text: t } ),
- t
- );
- } ),
- ( e.prototype.removePlaceholder = function ( e, t ) {
- for (
- var n = t.slice( 0 ), s = t.length - 1;
- 0 <= s;
- s--
- ) {
- var i = t[ s ];
- this.placeholder.id === i.id && n.splice( s, 1 );
- }
- return n;
- } ),
- e
- );
- } ),
- u.define(
- 'select2/dropdown/infiniteScroll',
- [ 'jquery' ],
- function ( n ) {
- function e( e, t, n, s ) {
- ( this.lastParams = {} ),
- e.call( this, t, n, s ),
- ( this.$loadingMore = this.createLoadingMore() ),
- ( this.loading = ! 1 );
- }
- return (
- ( e.prototype.append = function ( e, t ) {
- this.$loadingMore.remove(),
- ( this.loading = ! 1 ),
- e.call( this, t ),
- this.showLoadingMore( t ) &&
- ( this.$results.append( this.$loadingMore ),
- this.loadMoreIfNeeded() );
- } ),
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this;
- e.call( this, t, n ),
- t.on( 'query', function ( e ) {
- ( s.lastParams = e ), ( s.loading = ! 0 );
- } ),
- t.on( 'query:append', function ( e ) {
- ( s.lastParams = e ), ( s.loading = ! 0 );
- } ),
- this.$results.on(
- 'scroll',
- this.loadMoreIfNeeded.bind( this )
- );
- } ),
- ( e.prototype.loadMoreIfNeeded = function () {
- var e = n.contains(
- document.documentElement,
- this.$loadingMore[ 0 ]
- );
- ! this.loading &&
- e &&
- ( ( e =
- this.$results.offset().top +
- this.$results.outerHeight( ! 1 ) ),
- this.$loadingMore.offset().top +
- this.$loadingMore.outerHeight( ! 1 ) <=
- e + 50 && this.loadMore() );
- } ),
- ( e.prototype.loadMore = function () {
- this.loading = ! 0;
- var e = n.extend(
- {},
- { page: 1 },
- this.lastParams
- );
- e.page++, this.trigger( 'query:append', e );
- } ),
- ( e.prototype.showLoadingMore = function ( e, t ) {
- return t.pagination && t.pagination.more;
- } ),
- ( e.prototype.createLoadingMore = function () {
- var e = n(
- '<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'
- ),
- t = this.options
- .get( 'translations' )
- .get( 'loadingMore' );
- return e.html( t( this.lastParams ) ), e;
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/dropdown/attachBody',
- [ 'jquery', '../utils' ],
- function ( u, o ) {
- function e( e, t, n ) {
- ( this.$dropdownParent = u(
- n.get( 'dropdownParent' ) || document.body
- ) ),
- e.call( this, t, n );
- }
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this;
- e.call( this, t, n ),
- t.on( 'open', function () {
- s._showDropdown(),
- s._attachPositioningHandler( t ),
- s._bindContainerResultHandlers( t );
- } ),
- t.on( 'close', function () {
- s._hideDropdown(),
- s._detachPositioningHandler( t );
- } ),
- this.$dropdownContainer.on(
- 'mousedown',
- function ( e ) {
- e.stopPropagation();
- }
- );
- } ),
- ( e.prototype.destroy = function ( e ) {
- e.call( this ), this.$dropdownContainer.remove();
- } ),
- ( e.prototype.position = function ( e, t, n ) {
- t.attr( 'class', n.attr( 'class' ) ),
- t[ 0 ].classList.remove( 'select2' ),
- t[ 0 ].classList.add(
- 'select2-container--open'
- ),
- t.css( { position: 'absolute', top: -999999 } ),
- ( this.$container = n );
- } ),
- ( e.prototype.render = function ( e ) {
- var t = u( '<span></span>' ),
- e = e.call( this );
- return (
- t.append( e ), ( this.$dropdownContainer = t )
- );
- } ),
- ( e.prototype._hideDropdown = function ( e ) {
- this.$dropdownContainer.detach();
- } ),
- ( e.prototype._bindContainerResultHandlers = function (
- e,
- t
- ) {
- var n;
- this._containerResultsHandlersBound ||
- ( ( n = this ),
- t.on( 'results:all', function () {
- n._positionDropdown(), n._resizeDropdown();
- } ),
- t.on( 'results:append', function () {
- n._positionDropdown(), n._resizeDropdown();
- } ),
- t.on( 'results:message', function () {
- n._positionDropdown(), n._resizeDropdown();
- } ),
- t.on( 'select', function () {
- n._positionDropdown(), n._resizeDropdown();
- } ),
- t.on( 'unselect', function () {
- n._positionDropdown(), n._resizeDropdown();
- } ),
- ( this._containerResultsHandlersBound = ! 0 ) );
- } ),
- ( e.prototype._attachPositioningHandler = function (
- e,
- t
- ) {
- var n = this,
- s = 'scroll.select2.' + t.id,
- i = 'resize.select2.' + t.id,
- r = 'orientationchange.select2.' + t.id,
- t = this.$container
- .parents()
- .filter( o.hasScroll );
- t.each( function () {
- o.StoreData( this, 'select2-scroll-position', {
- x: u( this ).scrollLeft(),
- y: u( this ).scrollTop(),
- } );
- } ),
- t.on( s, function ( e ) {
- var t = o.GetData(
- this,
- 'select2-scroll-position'
- );
- u( this ).scrollTop( t.y );
- } ),
- u( window ).on(
- s + ' ' + i + ' ' + r,
- function ( e ) {
- n._positionDropdown(),
- n._resizeDropdown();
- }
- );
- } ),
- ( e.prototype._detachPositioningHandler = function (
- e,
- t
- ) {
- var n = 'scroll.select2.' + t.id,
- s = 'resize.select2.' + t.id,
- t = 'orientationchange.select2.' + t.id;
- this.$container
- .parents()
- .filter( o.hasScroll )
- .off( n ),
- u( window ).off( n + ' ' + s + ' ' + t );
- } ),
- ( e.prototype._positionDropdown = function () {
- var e = u( window ),
- t = this.$dropdown[ 0 ].classList.contains(
- 'select2-dropdown--above'
- ),
- n = this.$dropdown[ 0 ].classList.contains(
- 'select2-dropdown--below'
- ),
- s = null,
- i = this.$container.offset();
- i.bottom =
- i.top + this.$container.outerHeight( ! 1 );
- var r = {
- height: this.$container.outerHeight( ! 1 ),
- };
- ( r.top = i.top ), ( r.bottom = i.top + r.height );
- var o = this.$dropdown.outerHeight( ! 1 ),
- a = e.scrollTop(),
- l = e.scrollTop() + e.height(),
- c = a < i.top - o,
- e = l > i.bottom + o,
- a = { left: i.left, top: r.bottom },
- l = this.$dropdownParent;
- 'static' === l.css( 'position' ) &&
- ( l = l.offsetParent() );
- i = { top: 0, left: 0 };
- ( u.contains( document.body, l[ 0 ] ) ||
- l[ 0 ].isConnected ) &&
- ( i = l.offset() ),
- ( a.top -= i.top ),
- ( a.left -= i.left ),
- t || n || ( s = 'below' ),
- e || ! c || t
- ? ! c && e && t && ( s = 'below' )
- : ( s = 'above' ),
- ( 'above' == s || ( t && 'below' !== s ) ) &&
- ( a.top = r.top - i.top - o ),
- null != s &&
- ( this.$dropdown[ 0 ].classList.remove(
- 'select2-dropdown--below'
- ),
- this.$dropdown[ 0 ].classList.remove(
- 'select2-dropdown--above'
- ),
- this.$dropdown[ 0 ].classList.add(
- 'select2-dropdown--' + s
- ),
- this.$container[ 0 ].classList.remove(
- 'select2-container--below'
- ),
- this.$container[ 0 ].classList.remove(
- 'select2-container--above'
- ),
- this.$container[ 0 ].classList.add(
- 'select2-container--' + s
- ) ),
- this.$dropdownContainer.css( a );
- } ),
- ( e.prototype._resizeDropdown = function () {
- var e = {
- width: this.$container.outerWidth( ! 1 ) + 'px',
- };
- this.options.get( 'dropdownAutoWidth' ) &&
- ( ( e.minWidth = e.width ),
- ( e.position = 'relative' ),
- ( e.width = 'auto' ) ),
- this.$dropdown.css( e );
- } ),
- ( e.prototype._showDropdown = function ( e ) {
- this.$dropdownContainer.appendTo(
- this.$dropdownParent
- ),
- this._positionDropdown(),
- this._resizeDropdown();
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/dropdown/minimumResultsForSearch',
- [],
- function () {
- function e( e, t, n, s ) {
- ( this.minimumResultsForSearch = n.get(
- 'minimumResultsForSearch'
- ) ),
- this.minimumResultsForSearch < 0 &&
- ( this.minimumResultsForSearch = 1 / 0 ),
- e.call( this, t, n, s );
- }
- return (
- ( e.prototype.showSearch = function ( e, t ) {
- return (
- ! (
- ( function e( t ) {
- for (
- var n = 0, s = 0;
- s < t.length;
- s++
- ) {
- var i = t[ s ];
- i.children
- ? ( n += e( i.children ) )
- : n++;
- }
- return n;
- } )( t.data.results ) <
- this.minimumResultsForSearch
- ) && e.call( this, t )
- );
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/dropdown/selectOnClose',
- [ '../utils' ],
- function ( s ) {
- function e() {}
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this;
- e.call( this, t, n ),
- t.on( 'close', function ( e ) {
- s._handleSelectOnClose( e );
- } );
- } ),
- ( e.prototype._handleSelectOnClose = function ( e, t ) {
- if ( t && null != t.originalSelect2Event ) {
- var n = t.originalSelect2Event;
- if (
- 'select' === n._type ||
- 'unselect' === n._type
- )
- return;
- }
- n = this.getHighlightedResults();
- n.length < 1 ||
- ( null !=
- ( n = s.GetData( n[ 0 ], 'data' ) )
- .element &&
- n.element.selected ) ||
- ( null == n.element && n.selected ) ||
- this.trigger( 'select', { data: n } );
- } ),
- e
- );
- }
- ),
- u.define( 'select2/dropdown/closeOnSelect', [], function () {
- function e() {}
- return (
- ( e.prototype.bind = function ( e, t, n ) {
- var s = this;
- e.call( this, t, n ),
- t.on( 'select', function ( e ) {
- s._selectTriggered( e );
- } ),
- t.on( 'unselect', function ( e ) {
- s._selectTriggered( e );
- } );
- } ),
- ( e.prototype._selectTriggered = function ( e, t ) {
- var n = t.originalEvent;
- ( n && ( n.ctrlKey || n.metaKey ) ) ||
- this.trigger( 'close', {
- originalEvent: n,
- originalSelect2Event: t,
- } );
- } ),
- e
- );
- } ),
- u.define(
- 'select2/dropdown/dropdownCss',
- [ '../utils' ],
- function ( n ) {
- function e() {}
- return (
- ( e.prototype.render = function ( e ) {
- var t = e.call( this ),
- e =
- this.options.get( 'dropdownCssClass' ) ||
- '';
- return (
- -1 !== e.indexOf( ':all:' ) &&
- ( ( e = e.replace( ':all:', '' ) ),
- n.copyNonInternalCssClasses(
- t[ 0 ],
- this.$element[ 0 ]
- ) ),
- t.addClass( e ),
- t
- );
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/dropdown/tagsSearchHighlight',
- [ '../utils' ],
- function ( s ) {
- function e() {}
- return (
- ( e.prototype.highlightFirstItem = function ( e ) {
- var t = this.$results.find(
- '.select2-results__option--selectable:not(.select2-results__option--selected)'
- );
- if ( 0 < t.length ) {
- var n = t.first(),
- t = s.GetData( n[ 0 ], 'data' ).element;
- if (
- t &&
- t.getAttribute &&
- 'true' ===
- t.getAttribute( 'data-select2-tag' )
- )
- return void n.trigger( 'mouseenter' );
- }
- e.call( this );
- } ),
- e
- );
- }
- ),
- u.define( 'select2/i18n/en', [], function () {
- return {
- errorLoading: function () {
- return 'The results could not be loaded.';
- },
- inputTooLong: function ( e ) {
- var t = e.input.length - e.maximum,
- e = 'Please delete ' + t + ' character';
- return 1 != t && ( e += 's' ), e;
- },
- inputTooShort: function ( e ) {
- return (
- 'Please enter ' +
- ( e.minimum - e.input.length ) +
- ' or more characters'
- );
- },
- loadingMore: function () {
- return 'Loading more results…';
- },
- maximumSelected: function ( e ) {
- var t = 'You can only select ' + e.maximum + ' item';
- return 1 != e.maximum && ( t += 's' ), t;
- },
- noResults: function () {
- return 'No results found';
- },
- searching: function () {
- return 'Searching…';
- },
- removeAllItems: function () {
- return 'Remove all items';
- },
- removeItem: function () {
- return 'Remove item';
- },
- search: function () {
- return 'Search';
- },
- };
- } ),
- u.define(
- 'select2/defaults',
- [
- 'jquery',
- './results',
- './selection/single',
- './selection/multiple',
- './selection/placeholder',
- './selection/allowClear',
- './selection/search',
- './selection/selectionCss',
- './selection/eventRelay',
- './utils',
- './translation',
- './diacritics',
- './data/select',
- './data/array',
- './data/ajax',
- './data/tags',
- './data/tokenizer',
- './data/minimumInputLength',
- './data/maximumInputLength',
- './data/maximumSelectionLength',
- './dropdown',
- './dropdown/search',
- './dropdown/hidePlaceholder',
- './dropdown/infiniteScroll',
- './dropdown/attachBody',
- './dropdown/minimumResultsForSearch',
- './dropdown/selectOnClose',
- './dropdown/closeOnSelect',
- './dropdown/dropdownCss',
- './dropdown/tagsSearchHighlight',
- './i18n/en',
- ],
- function (
- l,
- r,
- o,
- a,
- c,
- u,
- d,
- p,
- h,
- f,
- g,
- t,
- m,
- y,
- v,
- _,
- b,
- $,
- w,
- x,
- A,
- D,
- S,
- E,
- O,
- C,
- L,
- T,
- q,
- I,
- e
- ) {
- function n() {
- this.reset();
- }
- return (
- ( n.prototype.apply = function ( e ) {
- var t;
- null ==
- ( e = l.extend( ! 0, {}, this.defaults, e ) )
- .dataAdapter &&
- ( null != e.ajax
- ? ( e.dataAdapter = v )
- : null != e.data
- ? ( e.dataAdapter = y )
- : ( e.dataAdapter = m ),
- 0 < e.minimumInputLength &&
- ( e.dataAdapter = f.Decorate(
- e.dataAdapter,
- $
- ) ),
- 0 < e.maximumInputLength &&
- ( e.dataAdapter = f.Decorate(
- e.dataAdapter,
- w
- ) ),
- 0 < e.maximumSelectionLength &&
- ( e.dataAdapter = f.Decorate(
- e.dataAdapter,
- x
- ) ),
- e.tags &&
- ( e.dataAdapter = f.Decorate(
- e.dataAdapter,
- _
- ) ),
- ( null == e.tokenSeparators &&
- null == e.tokenizer ) ||
- ( e.dataAdapter = f.Decorate(
- e.dataAdapter,
- b
- ) ) ),
- null == e.resultsAdapter &&
- ( ( e.resultsAdapter = r ),
- null != e.ajax &&
- ( e.resultsAdapter = f.Decorate(
- e.resultsAdapter,
- E
- ) ),
- null != e.placeholder &&
- ( e.resultsAdapter = f.Decorate(
- e.resultsAdapter,
- S
- ) ),
- e.selectOnClose &&
- ( e.resultsAdapter = f.Decorate(
- e.resultsAdapter,
- L
- ) ),
- e.tags &&
- ( e.resultsAdapter = f.Decorate(
- e.resultsAdapter,
- I
- ) ) ),
- null == e.dropdownAdapter &&
- ( e.multiple
- ? ( e.dropdownAdapter = A )
- : ( ( t = f.Decorate( A, D ) ),
- ( e.dropdownAdapter = t ) ),
- 0 !== e.minimumResultsForSearch &&
- ( e.dropdownAdapter = f.Decorate(
- e.dropdownAdapter,
- C
- ) ),
- e.closeOnSelect &&
- ( e.dropdownAdapter = f.Decorate(
- e.dropdownAdapter,
- T
- ) ),
- null != e.dropdownCssClass &&
- ( e.dropdownAdapter = f.Decorate(
- e.dropdownAdapter,
- q
- ) ),
- ( e.dropdownAdapter = f.Decorate(
- e.dropdownAdapter,
- O
- ) ) ),
- null == e.selectionAdapter &&
- ( e.multiple
- ? ( e.selectionAdapter = a )
- : ( e.selectionAdapter = o ),
- null != e.placeholder &&
- ( e.selectionAdapter = f.Decorate(
- e.selectionAdapter,
- c
- ) ),
- e.allowClear &&
- ( e.selectionAdapter = f.Decorate(
- e.selectionAdapter,
- u
- ) ),
- e.multiple &&
- ( e.selectionAdapter = f.Decorate(
- e.selectionAdapter,
- d
- ) ),
- null != e.selectionCssClass &&
- ( e.selectionAdapter = f.Decorate(
- e.selectionAdapter,
- p
- ) ),
- ( e.selectionAdapter = f.Decorate(
- e.selectionAdapter,
- h
- ) ) ),
- ( e.language = this._resolveLanguage(
- e.language
- ) ),
- e.language.push( 'en' );
- for (
- var n = [], s = 0;
- s < e.language.length;
- s++
- ) {
- var i = e.language[ s ];
- -1 === n.indexOf( i ) && n.push( i );
- }
- return (
- ( e.language = n ),
- ( e.translations = this._processTranslations(
- e.language,
- e.debug
- ) ),
- e
- );
- } ),
- ( n.prototype.reset = function () {
- function a( e ) {
- return e.replace(
- /[^\u0000-\u007E]/g,
- function ( e ) {
- return t[ e ] || e;
- }
- );
- }
- this.defaults = {
- amdLanguageBase: './i18n/',
- autocomplete: 'off',
- closeOnSelect: ! 0,
- debug: ! 1,
- dropdownAutoWidth: ! 1,
- escapeMarkup: f.escapeMarkup,
- language: {},
- matcher: function e( t, n ) {
- if (
- null == t.term ||
- '' === t.term.trim()
- )
- return n;
- if ( n.children && 0 < n.children.length ) {
- for (
- var s = l.extend( ! 0, {}, n ),
- i = n.children.length - 1;
- 0 <= i;
- i--
- )
- null == e( t, n.children[ i ] ) &&
- s.children.splice( i, 1 );
- return 0 < s.children.length
- ? s
- : e( t, s );
- }
- var r = a( n.text ).toUpperCase(),
- o = a( t.term ).toUpperCase();
- return -1 < r.indexOf( o ) ? n : null;
- },
- minimumInputLength: 0,
- maximumInputLength: 0,
- maximumSelectionLength: 0,
- minimumResultsForSearch: 0,
- selectOnClose: ! 1,
- scrollAfterSelect: ! 1,
- sorter: function ( e ) {
- return e;
- },
- templateResult: function ( e ) {
- return e.text;
- },
- templateSelection: function ( e ) {
- return e.text;
- },
- theme: 'default',
- width: 'resolve',
- };
- } ),
- ( n.prototype.applyFromElement = function ( e, t ) {
- var n = e.language,
- s = this.defaults.language,
- i = t.prop( 'lang' ),
- t = t.closest( '[lang]' ).prop( 'lang' ),
- t = Array.prototype.concat.call(
- this._resolveLanguage( i ),
- this._resolveLanguage( n ),
- this._resolveLanguage( s ),
- this._resolveLanguage( t )
- );
- return ( e.language = t ), e;
- } ),
- ( n.prototype._resolveLanguage = function ( e ) {
- if ( ! e ) return [];
- if ( l.isEmptyObject( e ) ) return [];
- if ( l.isPlainObject( e ) ) return [ e ];
- for (
- var t,
- n = Array.isArray( e ) ? e : [ e ],
- s = [],
- i = 0;
- i < n.length;
- i++
- )
- s.push( n[ i ] ),
- 'string' == typeof n[ i ] &&
- 0 < n[ i ].indexOf( '-' ) &&
- ( ( t = n[ i ].split( '-' )[ 0 ] ),
- s.push( t ) );
- return s;
- } ),
- ( n.prototype._processTranslations = function ( e, t ) {
- for ( var n = new g(), s = 0; s < e.length; s++ ) {
- var i = new g(),
- r = e[ s ];
- if ( 'string' == typeof r )
- try {
- i = g.loadPath( r );
- } catch ( e ) {
- try {
- ( r =
- this.defaults.amdLanguageBase +
- r ),
- ( i = g.loadPath( r ) );
- } catch ( e ) {
- t &&
- window.console &&
- console.warn &&
- console.warn(
- 'Select2: The language file for "' +
- r +
- '" could not be automatically loaded. A fallback will be used instead.'
- );
- }
- }
- else i = l.isPlainObject( r ) ? new g( r ) : r;
- n.extend( i );
- }
- return n;
- } ),
- ( n.prototype.set = function ( e, t ) {
- var n = {};
- n[ l.camelCase( e ) ] = t;
- n = f._convertData( n );
- l.extend( ! 0, this.defaults, n );
- } ),
- new n()
- );
- }
- ),
- u.define(
- 'select2/options',
- [ 'jquery', './defaults', './utils' ],
- function ( c, n, u ) {
- function e( e, t ) {
- ( this.options = e ),
- null != t && this.fromElement( t ),
- null != t &&
- ( this.options = n.applyFromElement(
- this.options,
- t
- ) ),
- ( this.options = n.apply( this.options ) );
- }
- return (
- ( e.prototype.fromElement = function ( e ) {
- var t = [ 'select2' ];
- null == this.options.multiple &&
- ( this.options.multiple = e.prop(
- 'multiple'
- ) ),
- null == this.options.disabled &&
- ( this.options.disabled = e.prop(
- 'disabled'
- ) ),
- null == this.options.autocomplete &&
- e.prop( 'autocomplete' ) &&
- ( this.options.autocomplete = e.prop(
- 'autocomplete'
- ) ),
- null == this.options.dir &&
- ( e.prop( 'dir' )
- ? ( this.options.dir = e.prop( 'dir' ) )
- : e.closest( '[dir]' ).prop( 'dir' )
- ? ( this.options.dir = e
- .closest( '[dir]' )
- .prop( 'dir' ) )
- : ( this.options.dir = 'ltr' ) ),
- e.prop( 'disabled', this.options.disabled ),
- e.prop( 'multiple', this.options.multiple ),
- u.GetData( e[ 0 ], 'select2Tags' ) &&
- ( this.options.debug &&
- window.console &&
- console.warn &&
- console.warn(
- 'Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'
- ),
- u.StoreData(
- e[ 0 ],
- 'data',
- u.GetData( e[ 0 ], 'select2Tags' )
- ),
- u.StoreData( e[ 0 ], 'tags', ! 0 ) ),
- u.GetData( e[ 0 ], 'ajaxUrl' ) &&
- ( this.options.debug &&
- window.console &&
- console.warn &&
- console.warn(
- 'Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2.'
- ),
- e.attr(
- 'ajax--url',
- u.GetData( e[ 0 ], 'ajaxUrl' )
- ),
- u.StoreData(
- e[ 0 ],
- 'ajax-Url',
- u.GetData( e[ 0 ], 'ajaxUrl' )
- ) );
- var n = {};
- function s( e, t ) {
- return t.toUpperCase();
- }
- for (
- var i = 0;
- i < e[ 0 ].attributes.length;
- i++
- ) {
- var r = e[ 0 ].attributes[ i ].name,
- o = 'data-';
- r.substr( 0, o.length ) == o &&
- ( ( r = r.substring( o.length ) ),
- ( o = u.GetData( e[ 0 ], r ) ),
- ( n[ r.replace( /-([a-z])/g, s ) ] = o ) );
- }
- c.fn.jquery &&
- '1.' == c.fn.jquery.substr( 0, 2 ) &&
- e[ 0 ].dataset &&
- ( n = c.extend( ! 0, {}, e[ 0 ].dataset, n ) );
- var a,
- l = c.extend( ! 0, {}, u.GetData( e[ 0 ] ), n );
- for ( a in ( l = u._convertData( l ) ) )
- -1 < t.indexOf( a ) ||
- ( c.isPlainObject( this.options[ a ] )
- ? c.extend( this.options[ a ], l[ a ] )
- : ( this.options[ a ] = l[ a ] ) );
- return this;
- } ),
- ( e.prototype.get = function ( e ) {
- return this.options[ e ];
- } ),
- ( e.prototype.set = function ( e, t ) {
- this.options[ e ] = t;
- } ),
- e
- );
- }
- ),
- u.define(
- 'select2/core',
- [ 'jquery', './options', './utils', './keys' ],
- function ( t, i, r, s ) {
- var o = function ( e, t ) {
- null != r.GetData( e[ 0 ], 'select2' ) &&
- r.GetData( e[ 0 ], 'select2' ).destroy(),
- ( this.$element = e ),
- ( this.id = this._generateId( e ) ),
- ( t = t || {} ),
- ( this.options = new i( t, e ) ),
- o.__super__.constructor.call( this );
- var n = e.attr( 'tabindex' ) || 0;
- r.StoreData( e[ 0 ], 'old-tabindex', n ),
- e.attr( 'tabindex', '-1' );
- t = this.options.get( 'dataAdapter' );
- this.dataAdapter = new t( e, this.options );
- n = this.render();
- this._placeContainer( n );
- t = this.options.get( 'selectionAdapter' );
- ( this.selection = new t( e, this.options ) ),
- ( this.$selection = this.selection.render() ),
- this.selection.position( this.$selection, n );
- t = this.options.get( 'dropdownAdapter' );
- ( this.dropdown = new t( e, this.options ) ),
- ( this.$dropdown = this.dropdown.render() ),
- this.dropdown.position( this.$dropdown, n );
- n = this.options.get( 'resultsAdapter' );
- ( this.results = new n(
- e,
- this.options,
- this.dataAdapter
- ) ),
- ( this.$results = this.results.render() ),
- this.results.position(
- this.$results,
- this.$dropdown
- );
- var s = this;
- this._bindAdapters(),
- this._registerDomEvents(),
- this._registerDataEvents(),
- this._registerSelectionEvents(),
- this._registerDropdownEvents(),
- this._registerResultsEvents(),
- this._registerEvents(),
- this.dataAdapter.current( function ( e ) {
- s.trigger( 'selection:update', { data: e } );
- } ),
- e[ 0 ].classList.add( 'select2-hidden-accessible' ),
- e.attr( 'aria-hidden', 'true' ),
- this._syncAttributes(),
- r.StoreData( e[ 0 ], 'select2', this ),
- e.data( 'select2', this );
- };
- return (
- r.Extend( o, r.Observable ),
- ( o.prototype._generateId = function ( e ) {
- return (
- 'select2-' +
- ( null != e.attr( 'id' )
- ? e.attr( 'id' )
- : null != e.attr( 'name' )
- ? e.attr( 'name' ) +
- '-' +
- r.generateChars( 2 )
- : r.generateChars( 4 )
- ).replace( /(:|\.|\[|\]|,)/g, '' )
- );
- } ),
- ( o.prototype._placeContainer = function ( e ) {
- e.insertAfter( this.$element );
- var t = this._resolveWidth(
- this.$element,
- this.options.get( 'width' )
- );
- null != t && e.css( 'width', t );
- } ),
- ( o.prototype._resolveWidth = function ( e, t ) {
- var n = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
- if ( 'resolve' == t ) {
- var s = this._resolveWidth( e, 'style' );
- return null != s
- ? s
- : this._resolveWidth( e, 'element' );
- }
- if ( 'element' == t ) {
- s = e.outerWidth( ! 1 );
- return s <= 0 ? 'auto' : s + 'px';
- }
- if ( 'style' != t )
- return 'computedstyle' != t
- ? t
- : window.getComputedStyle( e[ 0 ] ).width;
- e = e.attr( 'style' );
- if ( 'string' != typeof e ) return null;
- for (
- var i = e.split( ';' ), r = 0, o = i.length;
- r < o;
- r += 1
- ) {
- var a = i[ r ].replace( /\s/g, '' ).match( n );
- if ( null !== a && 1 <= a.length )
- return a[ 1 ];
- }
- return null;
- } ),
- ( o.prototype._bindAdapters = function () {
- this.dataAdapter.bind( this, this.$container ),
- this.selection.bind( this, this.$container ),
- this.dropdown.bind( this, this.$container ),
- this.results.bind( this, this.$container );
- } ),
- ( o.prototype._registerDomEvents = function () {
- var t = this;
- this.$element.on( 'change.select2', function () {
- t.dataAdapter.current( function ( e ) {
- t.trigger( 'selection:update', {
- data: e,
- } );
- } );
- } ),
- this.$element.on(
- 'focus.select2',
- function ( e ) {
- t.trigger( 'focus', e );
- }
- ),
- ( this._syncA = r.bind(
- this._syncAttributes,
- this
- ) ),
- ( this._syncS = r.bind(
- this._syncSubtree,
- this
- ) ),
- ( this._observer = new window.MutationObserver(
- function ( e ) {
- t._syncA(), t._syncS( e );
- }
- ) ),
- this._observer.observe( this.$element[ 0 ], {
- attributes: ! 0,
- childList: ! 0,
- subtree: ! 1,
- } );
- } ),
- ( o.prototype._registerDataEvents = function () {
- var n = this;
- this.dataAdapter.on( '*', function ( e, t ) {
- n.trigger( e, t );
- } );
- } ),
- ( o.prototype._registerSelectionEvents = function () {
- var n = this,
- s = [ 'toggle', 'focus' ];
- this.selection.on( 'toggle', function () {
- n.toggleDropdown();
- } ),
- this.selection.on( 'focus', function ( e ) {
- n.focus( e );
- } ),
- this.selection.on( '*', function ( e, t ) {
- -1 === s.indexOf( e ) && n.trigger( e, t );
- } );
- } ),
- ( o.prototype._registerDropdownEvents = function () {
- var n = this;
- this.dropdown.on( '*', function ( e, t ) {
- n.trigger( e, t );
- } );
- } ),
- ( o.prototype._registerResultsEvents = function () {
- var n = this;
- this.results.on( '*', function ( e, t ) {
- n.trigger( e, t );
- } );
- } ),
- ( o.prototype._registerEvents = function () {
- var n = this;
- this.on( 'open', function () {
- n.$container[ 0 ].classList.add(
- 'select2-container--open'
- );
- } ),
- this.on( 'close', function () {
- n.$container[ 0 ].classList.remove(
- 'select2-container--open'
- );
- } ),
- this.on( 'enable', function () {
- n.$container[ 0 ].classList.remove(
- 'select2-container--disabled'
- );
- } ),
- this.on( 'disable', function () {
- n.$container[ 0 ].classList.add(
- 'select2-container--disabled'
- );
- } ),
- this.on( 'blur', function () {
- n.$container[ 0 ].classList.remove(
- 'select2-container--focus'
- );
- } ),
- this.on( 'query', function ( t ) {
- n.isOpen() || n.trigger( 'open', {} ),
- this.dataAdapter.query(
- t,
- function ( e ) {
- n.trigger( 'results:all', {
- data: e,
- query: t,
- } );
- }
- );
- } ),
- this.on( 'query:append', function ( t ) {
- this.dataAdapter.query( t, function ( e ) {
- n.trigger( 'results:append', {
- data: e,
- query: t,
- } );
- } );
- } ),
- this.on( 'keypress', function ( e ) {
- var t = e.which;
- n.isOpen()
- ? t === s.ESC ||
- ( t === s.UP && e.altKey )
- ? ( n.close( e ),
- e.preventDefault() )
- : t === s.ENTER || t === s.TAB
- ? ( n.trigger(
- 'results:select',
- {}
- ),
- e.preventDefault() )
- : t === s.SPACE && e.ctrlKey
- ? ( n.trigger(
- 'results:toggle',
- {}
- ),
- e.preventDefault() )
- : t === s.UP
- ? ( n.trigger(
- 'results:previous',
- {}
- ),
- e.preventDefault() )
- : t === s.DOWN &&
- ( n.trigger( 'results:next', {} ),
- e.preventDefault() )
- : ( t === s.ENTER ||
- t === s.SPACE ||
- ( t === s.DOWN &&
- e.altKey ) ) &&
- ( n.open(), e.preventDefault() );
- } );
- } ),
- ( o.prototype._syncAttributes = function () {
- this.options.set(
- 'disabled',
- this.$element.prop( 'disabled' )
- ),
- this.isDisabled()
- ? ( this.isOpen() && this.close(),
- this.trigger( 'disable', {} ) )
- : this.trigger( 'enable', {} );
- } ),
- ( o.prototype._isChangeMutation = function ( e ) {
- var t = this;
- if ( e.addedNodes && 0 < e.addedNodes.length ) {
- for ( var n = 0; n < e.addedNodes.length; n++ )
- if ( e.addedNodes[ n ].selected )
- return ! 0;
- } else {
- if (
- e.removedNodes &&
- 0 < e.removedNodes.length
- )
- return ! 0;
- if ( Array.isArray( e ) )
- return e.some( function ( e ) {
- return t._isChangeMutation( e );
- } );
- }
- return ! 1;
- } ),
- ( o.prototype._syncSubtree = function ( e ) {
- var e = this._isChangeMutation( e ),
- t = this;
- e &&
- this.dataAdapter.current( function ( e ) {
- t.trigger( 'selection:update', {
- data: e,
- } );
- } );
- } ),
- ( o.prototype.trigger = function ( e, t ) {
- var n = o.__super__.trigger,
- s = {
- open: 'opening',
- close: 'closing',
- select: 'selecting',
- unselect: 'unselecting',
- clear: 'clearing',
- };
- if ( ( void 0 === t && ( t = {} ), e in s ) ) {
- var i = s[ e ],
- s = { prevented: ! 1, name: e, args: t };
- if ( ( n.call( this, i, s ), s.prevented ) )
- return void ( t.prevented = ! 0 );
- }
- n.call( this, e, t );
- } ),
- ( o.prototype.toggleDropdown = function () {
- this.isDisabled() ||
- ( this.isOpen() ? this.close() : this.open() );
- } ),
- ( o.prototype.open = function () {
- this.isOpen() ||
- this.isDisabled() ||
- this.trigger( 'query', {} );
- } ),
- ( o.prototype.close = function ( e ) {
- this.isOpen() &&
- this.trigger( 'close', { originalEvent: e } );
- } ),
- ( o.prototype.isEnabled = function () {
- return ! this.isDisabled();
- } ),
- ( o.prototype.isDisabled = function () {
- return this.options.get( 'disabled' );
- } ),
- ( o.prototype.isOpen = function () {
- return this.$container[ 0 ].classList.contains(
- 'select2-container--open'
- );
- } ),
- ( o.prototype.hasFocus = function () {
- return this.$container[ 0 ].classList.contains(
- 'select2-container--focus'
- );
- } ),
- ( o.prototype.focus = function ( e ) {
- this.hasFocus() ||
- ( this.$container[ 0 ].classList.add(
- 'select2-container--focus'
- ),
- this.trigger( 'focus', {} ) );
- } ),
- ( o.prototype.enable = function ( e ) {
- this.options.get( 'debug' ) &&
- window.console &&
- console.warn &&
- console.warn(
- 'Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'
- ),
- ( null != e && 0 !== e.length ) ||
- ( e = [ ! 0 ] );
- e = ! e[ 0 ];
- this.$element.prop( 'disabled', e );
- } ),
- ( o.prototype.data = function () {
- this.options.get( 'debug' ) &&
- 0 < arguments.length &&
- window.console &&
- console.warn &&
- console.warn(
- 'Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.'
- );
- var t = [];
- return (
- this.dataAdapter.current( function ( e ) {
- t = e;
- } ),
- t
- );
- } ),
- ( o.prototype.val = function ( e ) {
- if (
- ( this.options.get( 'debug' ) &&
- window.console &&
- console.warn &&
- console.warn(
- 'Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'
- ),
- null == e || 0 === e.length )
- )
- return this.$element.val();
- e = e[ 0 ];
- Array.isArray( e ) &&
- ( e = e.map( function ( e ) {
- return e.toString();
- } ) ),
- this.$element
- .val( e )
- .trigger( 'input' )
- .trigger( 'change' );
- } ),
- ( o.prototype.destroy = function () {
- r.RemoveData( this.$container[ 0 ] ),
- this.$container.remove(),
- this._observer.disconnect(),
- ( this._observer = null ),
- ( this._syncA = null ),
- ( this._syncS = null ),
- this.$element.off( '.select2' ),
- this.$element.attr(
- 'tabindex',
- r.GetData(
- this.$element[ 0 ],
- 'old-tabindex'
- )
- ),
- this.$element[ 0 ].classList.remove(
- 'select2-hidden-accessible'
- ),
- this.$element.attr( 'aria-hidden', 'false' ),
- r.RemoveData( this.$element[ 0 ] ),
- this.$element.removeData( 'select2' ),
- this.dataAdapter.destroy(),
- this.selection.destroy(),
- this.dropdown.destroy(),
- this.results.destroy(),
- ( this.dataAdapter = null ),
- ( this.selection = null ),
- ( this.dropdown = null ),
- ( this.results = null );
- } ),
- ( o.prototype.render = function () {
- var e = t(
- '<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>'
- );
- return (
- e.attr( 'dir', this.options.get( 'dir' ) ),
- ( this.$container = e ),
- this.$container[ 0 ].classList.add(
- 'select2-container--' +
- this.options.get( 'theme' )
- ),
- r.StoreData( e[ 0 ], 'element', this.$element ),
- e
- );
- } ),
- o
- );
- }
- ),
- u.define( 'jquery-mousewheel', [ 'jquery' ], function ( e ) {
- return e;
- } ),
- u.define(
- 'jquery.select2',
- [
- 'jquery',
- 'jquery-mousewheel',
- './select2/core',
- './select2/defaults',
- './select2/utils',
- ],
- function ( i, e, r, t, o ) {
- var a;
- return (
- null == i.fn.select2 &&
- ( ( a = [ 'open', 'close', 'destroy' ] ),
- ( i.fn.select2 = function ( t ) {
- if ( 'object' == typeof ( t = t || {} ) )
- return (
- this.each( function () {
- var e = i.extend( ! 0, {}, t );
- new r( i( this ), e );
- } ),
- this
- );
- if ( 'string' != typeof t )
- throw new Error(
- 'Invalid arguments for Select2: ' + t
- );
- var n,
- s = Array.prototype.slice.call(
- arguments,
- 1
- );
- return (
- this.each( function () {
- var e = o.GetData( this, 'select2' );
- null == e &&
- window.console &&
- console.error &&
- console.error(
- "The select2('" +
- t +
- "') method was called on an element that is not using Select2."
- ),
- ( n = e[ t ].apply( e, s ) );
- } ),
- -1 < a.indexOf( t ) ? this : n
- );
- } ) ),
- null == i.fn.select2.defaults &&
- ( i.fn.select2.defaults = t ),
- r
- );
- }
- ),
- { define: u.define, require: u.require } );
- function b( e, t ) {
- return i.call( e, t );
- }
- function l( e, t ) {
- var n,
- s,
- i,
- r,
- o,
- a,
- l,
- c,
- u,
- d,
- p = t && t.split( '/' ),
- h = y.map,
- f = ( h && h[ '*' ] ) || {};
- if ( e ) {
- for (
- t = ( e = e.split( '/' ) ).length - 1,
- y.nodeIdCompat &&
- _.test( e[ t ] ) &&
- ( e[ t ] = e[ t ].replace( _, '' ) ),
- '.' === e[ 0 ].charAt( 0 ) &&
- p &&
- ( e = p.slice( 0, p.length - 1 ).concat( e ) ),
- c = 0;
- c < e.length;
- c++
- )
- '.' === ( d = e[ c ] )
- ? ( e.splice( c, 1 ), --c )
- : '..' === d &&
- ( 0 === c ||
- ( 1 === c && '..' === e[ 2 ] ) ||
- '..' === e[ c - 1 ] ||
- ( 0 < c && ( e.splice( c - 1, 2 ), ( c -= 2 ) ) ) );
- e = e.join( '/' );
- }
- if ( ( p || f ) && h ) {
- for ( c = ( n = e.split( '/' ) ).length; 0 < c; --c ) {
- if ( ( ( s = n.slice( 0, c ).join( '/' ) ), p ) )
- for ( u = p.length; 0 < u; --u )
- if (
- ( ( i = h[ p.slice( 0, u ).join( '/' ) ] ),
- ( i = i && i[ s ] ) )
- ) {
- ( r = i ), ( o = c );
- break;
- }
- if ( r ) break;
- ! a && f && f[ s ] && ( ( a = f[ s ] ), ( l = c ) );
- }
- ! r && a && ( ( r = a ), ( o = l ) ),
- r && ( n.splice( 0, o, r ), ( e = n.join( '/' ) ) );
- }
- return e;
- }
- function w( t, n ) {
- return function () {
- var e = a.call( arguments, 0 );
- return (
- 'string' != typeof e[ 0 ] && 1 === e.length && e.push( null ),
- o.apply( p, e.concat( [ t, n ] ) )
- );
- };
- }
- function x( e ) {
- var t;
- if (
- ( b( m, e ) &&
- ( ( t = m[ e ] ),
- delete m[ e ],
- ( v[ e ] = ! 0 ),
- r.apply( p, t ) ),
- ! b( g, e ) && ! b( v, e ) )
- )
- throw new Error( 'No ' + e );
- return g[ e ];
- }
- function c( e ) {
- var t,
- n = e ? e.indexOf( '!' ) : -1;
- return (
- -1 < n &&
- ( ( t = e.substring( 0, n ) ),
- ( e = e.substring( n + 1, e.length ) ) ),
- [ t, e ]
- );
- }
- function A( e ) {
- return e ? c( e ) : [];
- }
- var u = s.require( 'jquery.select2' );
- return ( t.fn.select2.amd = s ), u;
- } );
|