Aucune description

select2.min.js 120KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811
  1. /*! Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
  2. ! ( function ( n ) {
  3. 'function' == typeof define && define.amd
  4. ? define( [ 'jquery' ], n )
  5. : 'object' == typeof module && module.exports
  6. ? ( module.exports = function ( e, t ) {
  7. return (
  8. void 0 === t &&
  9. ( t =
  10. 'undefined' != typeof window
  11. ? require( 'jquery' )
  12. : require( 'jquery' )( e ) ),
  13. n( t ),
  14. t
  15. );
  16. } )
  17. : n( jQuery );
  18. } )( function ( t ) {
  19. var e,
  20. n,
  21. s,
  22. p,
  23. r,
  24. o,
  25. h,
  26. f,
  27. g,
  28. m,
  29. y,
  30. v,
  31. i,
  32. a,
  33. _,
  34. s =
  35. ( t &&
  36. t.fn &&
  37. t.fn.select2 &&
  38. t.fn.select2.amd &&
  39. ( u = t.fn.select2.amd ),
  40. ( u && u.requirejs ) ||
  41. ( u ? ( n = u ) : ( u = {} ),
  42. ( g = {} ),
  43. ( m = {} ),
  44. ( y = {} ),
  45. ( v = {} ),
  46. ( i = Object.prototype.hasOwnProperty ),
  47. ( a = [].slice ),
  48. ( _ = /\.js$/ ),
  49. ( h = function ( e, t ) {
  50. var n,
  51. s,
  52. i = c( e ),
  53. r = i[ 0 ],
  54. t = t[ 1 ];
  55. return (
  56. ( e = i[ 1 ] ),
  57. r && ( n = x( ( r = l( r, t ) ) ) ),
  58. r
  59. ? ( e =
  60. n && n.normalize
  61. ? n.normalize(
  62. e,
  63. ( ( s = t ),
  64. function ( e ) {
  65. return l( e, s );
  66. } )
  67. )
  68. : l( e, t ) )
  69. : ( ( r = ( i = c( ( e = l( e, t ) ) ) )[ 0 ] ),
  70. ( e = i[ 1 ] ),
  71. r && ( n = x( r ) ) ),
  72. { f: r ? r + '!' + e : e, n: e, pr: r, p: n }
  73. );
  74. } ),
  75. ( f = {
  76. require: function ( e ) {
  77. return w( e );
  78. },
  79. exports: function ( e ) {
  80. var t = g[ e ];
  81. return void 0 !== t ? t : ( g[ e ] = {} );
  82. },
  83. module: function ( e ) {
  84. return {
  85. id: e,
  86. uri: '',
  87. exports: g[ e ],
  88. config:
  89. ( ( t = e ),
  90. function () {
  91. return (
  92. ( y && y.config && y.config[ t ] ) || {}
  93. );
  94. } ),
  95. };
  96. var t;
  97. },
  98. } ),
  99. ( r = function ( e, t, n, s ) {
  100. var i,
  101. r,
  102. o,
  103. a,
  104. l,
  105. c = [],
  106. u = typeof n,
  107. d = A( ( s = s || e ) );
  108. if ( 'undefined' == u || 'function' == u ) {
  109. for (
  110. t =
  111. ! t.length && n.length
  112. ? [ 'require', 'exports', 'module' ]
  113. : t,
  114. a = 0;
  115. a < t.length;
  116. a += 1
  117. )
  118. if (
  119. 'require' === ( r = ( o = h( t[ a ], d ) ).f )
  120. )
  121. c[ a ] = f.require( e );
  122. else if ( 'exports' === r )
  123. ( c[ a ] = f.exports( e ) ), ( l = ! 0 );
  124. else if ( 'module' === r )
  125. i = c[ a ] = f.module( e );
  126. else if ( b( g, r ) || b( m, r ) || b( v, r ) )
  127. c[ a ] = x( r );
  128. else {
  129. if ( ! o.p )
  130. throw new Error( e + ' missing ' + r );
  131. o.p.load(
  132. o.n,
  133. w( s, ! 0 ),
  134. ( function ( t ) {
  135. return function ( e ) {
  136. g[ t ] = e;
  137. };
  138. } )( r ),
  139. {}
  140. ),
  141. ( c[ a ] = g[ r ] );
  142. }
  143. ( u = n ? n.apply( g[ e ], c ) : void 0 ),
  144. e &&
  145. ( i && i.exports !== p && i.exports !== g[ e ]
  146. ? ( g[ e ] = i.exports )
  147. : ( u === p && l ) || ( g[ e ] = u ) );
  148. } else e && ( g[ e ] = n );
  149. } ),
  150. ( e = n = o = function ( e, t, n, s, i ) {
  151. if ( 'string' == typeof e )
  152. return f[ e ] ? f[ e ]( t ) : x( h( e, A( t ) ).f );
  153. if ( ! e.splice ) {
  154. if (
  155. ( ( y = e ).deps && o( y.deps, y.callback ), ! t )
  156. )
  157. return;
  158. t.splice
  159. ? ( ( e = t ), ( t = n ), ( n = null ) )
  160. : ( e = p );
  161. }
  162. return (
  163. ( t = t || function () {} ),
  164. 'function' == typeof n && ( ( n = s ), ( s = i ) ),
  165. s
  166. ? r( p, e, t, n )
  167. : setTimeout( function () {
  168. r( p, e, t, n );
  169. }, 4 ),
  170. o
  171. );
  172. } ),
  173. ( o.config = function ( e ) {
  174. return o( e );
  175. } ),
  176. ( e._defined = g ),
  177. ( ( s = function ( e, t, n ) {
  178. if ( 'string' != typeof e )
  179. throw new Error(
  180. 'See almond README: incorrect module build, no module name'
  181. );
  182. t.splice || ( ( n = t ), ( t = [] ) ),
  183. b( g, e ) || b( m, e ) || ( m[ e ] = [ e, t, n ] );
  184. } ).amd = { jQuery: ! 0 } ),
  185. ( u.requirejs = e ),
  186. ( u.require = n ),
  187. ( u.define = s ) ),
  188. u.define( 'almond', function () {} ),
  189. u.define( 'jquery', [], function () {
  190. var e = t || $;
  191. return (
  192. null == e &&
  193. console &&
  194. console.error &&
  195. console.error(
  196. '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.'
  197. ),
  198. e
  199. );
  200. } ),
  201. u.define( 'select2/utils', [ 'jquery' ], function ( r ) {
  202. var s = {};
  203. function c( e ) {
  204. var t,
  205. n = e.prototype,
  206. s = [];
  207. for ( t in n )
  208. 'function' == typeof n[ t ] &&
  209. 'constructor' !== t &&
  210. s.push( t );
  211. return s;
  212. }
  213. ( s.Extend = function ( e, t ) {
  214. var n,
  215. s = {}.hasOwnProperty;
  216. function i() {
  217. this.constructor = e;
  218. }
  219. for ( n in t ) s.call( t, n ) && ( e[ n ] = t[ n ] );
  220. return (
  221. ( i.prototype = t.prototype ),
  222. ( e.prototype = new i() ),
  223. ( e.__super__ = t.prototype ),
  224. e
  225. );
  226. } ),
  227. ( s.Decorate = function ( s, i ) {
  228. var e = c( i ),
  229. t = c( s );
  230. function r() {
  231. var e = Array.prototype.unshift,
  232. t = i.prototype.constructor.length,
  233. n = s.prototype.constructor;
  234. 0 < t &&
  235. ( e.call( arguments, s.prototype.constructor ),
  236. ( n = i.prototype.constructor ) ),
  237. n.apply( this, arguments );
  238. }
  239. ( i.displayName = s.displayName ),
  240. ( r.prototype = new ( function () {
  241. this.constructor = r;
  242. } )() );
  243. for ( var n = 0; n < t.length; n++ ) {
  244. var o = t[ n ];
  245. r.prototype[ o ] = s.prototype[ o ];
  246. }
  247. for ( var a = 0; a < e.length; a++ ) {
  248. var l = e[ a ];
  249. r.prototype[ l ] = ( function ( e ) {
  250. var t = function () {};
  251. e in r.prototype && ( t = r.prototype[ e ] );
  252. var n = i.prototype[ e ];
  253. return function () {
  254. return (
  255. Array.prototype.unshift.call(
  256. arguments,
  257. t
  258. ),
  259. n.apply( this, arguments )
  260. );
  261. };
  262. } )( l );
  263. }
  264. return r;
  265. } );
  266. function e() {
  267. this.listeners = {};
  268. }
  269. ( e.prototype.on = function ( e, t ) {
  270. ( this.listeners = this.listeners || {} ),
  271. e in this.listeners
  272. ? this.listeners[ e ].push( t )
  273. : ( this.listeners[ e ] = [ t ] );
  274. } ),
  275. ( e.prototype.trigger = function ( e ) {
  276. var t = Array.prototype.slice,
  277. n = t.call( arguments, 1 );
  278. ( this.listeners = this.listeners || {} ),
  279. null == n && ( n = [] ),
  280. 0 === n.length && n.push( {} ),
  281. ( n[ 0 ]._type = e ) in this.listeners &&
  282. this.invoke(
  283. this.listeners[ e ],
  284. t.call( arguments, 1 )
  285. ),
  286. '*' in this.listeners &&
  287. this.invoke( this.listeners[ '*' ], arguments );
  288. } ),
  289. ( e.prototype.invoke = function ( e, t ) {
  290. for ( var n = 0, s = e.length; n < s; n++ )
  291. e[ n ].apply( this, t );
  292. } ),
  293. ( s.Observable = e ),
  294. ( s.generateChars = function ( e ) {
  295. for ( var t = '', n = 0; n < e; n++ )
  296. t += Math.floor( 36 * Math.random() ).toString(
  297. 36
  298. );
  299. return t;
  300. } ),
  301. ( s.bind = function ( e, t ) {
  302. return function () {
  303. e.apply( t, arguments );
  304. };
  305. } ),
  306. ( s._convertData = function ( e ) {
  307. for ( var t in e ) {
  308. var n = t.split( '-' ),
  309. s = e;
  310. if ( 1 !== n.length ) {
  311. for ( var i = 0; i < n.length; i++ ) {
  312. var r = n[ i ];
  313. ( r =
  314. r.substring( 0, 1 ).toLowerCase() +
  315. r.substring( 1 ) ) in s ||
  316. ( s[ r ] = {} ),
  317. i == n.length - 1 &&
  318. ( s[ r ] = e[ t ] ),
  319. ( s = s[ r ] );
  320. }
  321. delete e[ t ];
  322. }
  323. }
  324. return e;
  325. } ),
  326. ( s.hasScroll = function ( e, t ) {
  327. var n = r( t ),
  328. s = t.style.overflowX,
  329. i = t.style.overflowY;
  330. return (
  331. ( s !== i ||
  332. ( 'hidden' !== i && 'visible' !== i ) ) &&
  333. ( 'scroll' === s ||
  334. 'scroll' === i ||
  335. n.innerHeight() < t.scrollHeight ||
  336. n.innerWidth() < t.scrollWidth )
  337. );
  338. } ),
  339. ( s.escapeMarkup = function ( e ) {
  340. var t = {
  341. '\\': '&#92;',
  342. '&': '&amp;',
  343. '<': '&lt;',
  344. '>': '&gt;',
  345. '"': '&quot;',
  346. "'": '&#39;',
  347. '/': '&#47;',
  348. };
  349. return 'string' != typeof e
  350. ? e
  351. : String( e ).replace(
  352. /[&<>"'\/\\]/g,
  353. function ( e ) {
  354. return t[ e ];
  355. }
  356. );
  357. } ),
  358. ( s.__cache = {} );
  359. var n = 0;
  360. return (
  361. ( s.GetUniqueElementId = function ( e ) {
  362. var t = e.getAttribute( 'data-select2-id' );
  363. return (
  364. null != t ||
  365. ( ( t = e.id
  366. ? 'select2-data-' + e.id
  367. : 'select2-data-' +
  368. ( ++n ).toString() +
  369. '-' +
  370. s.generateChars( 4 ) ),
  371. e.setAttribute( 'data-select2-id', t ) ),
  372. t
  373. );
  374. } ),
  375. ( s.StoreData = function ( e, t, n ) {
  376. e = s.GetUniqueElementId( e );
  377. s.__cache[ e ] || ( s.__cache[ e ] = {} ),
  378. ( s.__cache[ e ][ t ] = n );
  379. } ),
  380. ( s.GetData = function ( e, t ) {
  381. var n = s.GetUniqueElementId( e );
  382. return t
  383. ? s.__cache[ n ] && null != s.__cache[ n ][ t ]
  384. ? s.__cache[ n ][ t ]
  385. : r( e ).data( t )
  386. : s.__cache[ n ];
  387. } ),
  388. ( s.RemoveData = function ( e ) {
  389. var t = s.GetUniqueElementId( e );
  390. null != s.__cache[ t ] && delete s.__cache[ t ],
  391. e.removeAttribute( 'data-select2-id' );
  392. } ),
  393. ( s.copyNonInternalCssClasses = function ( e, t ) {
  394. var n = ( n = e
  395. .getAttribute( 'class' )
  396. .trim()
  397. .split( /\s+/ ) ).filter( function ( e ) {
  398. return 0 === e.indexOf( 'select2-' );
  399. } ),
  400. t = ( t = t
  401. .getAttribute( 'class' )
  402. .trim()
  403. .split( /\s+/ ) ).filter( function ( e ) {
  404. return 0 !== e.indexOf( 'select2-' );
  405. } ),
  406. t = n.concat( t );
  407. e.setAttribute( 'class', t.join( ' ' ) );
  408. } ),
  409. s
  410. );
  411. } ),
  412. u.define(
  413. 'select2/results',
  414. [ 'jquery', './utils' ],
  415. function ( d, p ) {
  416. function s( e, t, n ) {
  417. ( this.$element = e ),
  418. ( this.data = n ),
  419. ( this.options = t ),
  420. s.__super__.constructor.call( this );
  421. }
  422. return (
  423. p.Extend( s, p.Observable ),
  424. ( s.prototype.render = function () {
  425. var e = d(
  426. '<ul class="select2-results__options" role="listbox"></ul>'
  427. );
  428. return (
  429. this.options.get( 'multiple' ) &&
  430. e.attr( 'aria-multiselectable', 'true' ),
  431. ( this.$results = e )
  432. );
  433. } ),
  434. ( s.prototype.clear = function () {
  435. this.$results.empty();
  436. } ),
  437. ( s.prototype.displayMessage = function ( e ) {
  438. var t = this.options.get( 'escapeMarkup' );
  439. this.clear(), this.hideLoading();
  440. var n = d(
  441. '<li role="alert" aria-live="assertive" class="select2-results__option"></li>'
  442. ),
  443. s = this.options
  444. .get( 'translations' )
  445. .get( e.message );
  446. n.append( t( s( e.args ) ) ),
  447. ( n[ 0 ].className +=
  448. ' select2-results__message' ),
  449. this.$results.append( n );
  450. } ),
  451. ( s.prototype.hideMessages = function () {
  452. this.$results
  453. .find( '.select2-results__message' )
  454. .remove();
  455. } ),
  456. ( s.prototype.append = function ( e ) {
  457. this.hideLoading();
  458. var t = [];
  459. if ( null != e.results && 0 !== e.results.length ) {
  460. e.results = this.sort( e.results );
  461. for ( var n = 0; n < e.results.length; n++ ) {
  462. var s = e.results[ n ],
  463. s = this.option( s );
  464. t.push( s );
  465. }
  466. this.$results.append( t );
  467. } else
  468. 0 === this.$results.children().length &&
  469. this.trigger( 'results:message', {
  470. message: 'noResults',
  471. } );
  472. } ),
  473. ( s.prototype.position = function ( e, t ) {
  474. t.find( '.select2-results' ).append( e );
  475. } ),
  476. ( s.prototype.sort = function ( e ) {
  477. return this.options.get( 'sorter' )( e );
  478. } ),
  479. ( s.prototype.highlightFirstItem = function () {
  480. var e = this.$results.find(
  481. '.select2-results__option--selectable'
  482. ),
  483. t = e.filter(
  484. '.select2-results__option--selected'
  485. );
  486. ( 0 < t.length ? t : e )
  487. .first()
  488. .trigger( 'mouseenter' ),
  489. this.ensureHighlightVisible();
  490. } ),
  491. ( s.prototype.setClasses = function () {
  492. var t = this;
  493. this.data.current( function ( e ) {
  494. var s = e.map( function ( e ) {
  495. return e.id.toString();
  496. } );
  497. t.$results
  498. .find(
  499. '.select2-results__option--selectable'
  500. )
  501. .each( function () {
  502. var e = d( this ),
  503. t = p.GetData( this, 'data' ),
  504. n = '' + t.id;
  505. ( null != t.element &&
  506. t.element.selected ) ||
  507. ( null == t.element &&
  508. -1 < s.indexOf( n ) )
  509. ? ( this.classList.add(
  510. 'select2-results__option--selected'
  511. ),
  512. e.attr(
  513. 'aria-selected',
  514. 'true'
  515. ) )
  516. : ( this.classList.remove(
  517. 'select2-results__option--selected'
  518. ),
  519. e.attr(
  520. 'aria-selected',
  521. 'false'
  522. ) );
  523. } );
  524. } );
  525. } ),
  526. ( s.prototype.showLoading = function ( e ) {
  527. this.hideLoading();
  528. ( e = {
  529. disabled: ! 0,
  530. loading: ! 0,
  531. text: this.options
  532. .get( 'translations' )
  533. .get( 'searching' )( e ),
  534. } ),
  535. ( e = this.option( e ) );
  536. ( e.className += ' loading-results' ),
  537. this.$results.prepend( e );
  538. } ),
  539. ( s.prototype.hideLoading = function () {
  540. this.$results.find( '.loading-results' ).remove();
  541. } ),
  542. ( s.prototype.option = function ( e ) {
  543. var t = document.createElement( 'li' );
  544. t.classList.add( 'select2-results__option' ),
  545. t.classList.add(
  546. 'select2-results__option--selectable'
  547. );
  548. var n,
  549. s = { role: 'option' },
  550. i =
  551. window.Element.prototype.matches ||
  552. window.Element.prototype
  553. .msMatchesSelector ||
  554. window.Element.prototype
  555. .webkitMatchesSelector;
  556. for ( n in ( ( ( null != e.element &&
  557. i.call( e.element, ':disabled' ) ) ||
  558. ( null == e.element && e.disabled ) ) &&
  559. ( ( s[ 'aria-disabled' ] = 'true' ),
  560. t.classList.remove(
  561. 'select2-results__option--selectable'
  562. ),
  563. t.classList.add(
  564. 'select2-results__option--disabled'
  565. ) ),
  566. null == e.id &&
  567. t.classList.remove(
  568. 'select2-results__option--selectable'
  569. ),
  570. null != e._resultId && ( t.id = e._resultId ),
  571. e.title && ( t.title = e.title ),
  572. e.children &&
  573. ( ( s.role = 'group' ),
  574. ( s[ 'aria-label' ] = e.text ),
  575. t.classList.remove(
  576. 'select2-results__option--selectable'
  577. ),
  578. t.classList.add(
  579. 'select2-results__option--group'
  580. ) ),
  581. s ) ) {
  582. var r = s[ n ];
  583. t.setAttribute( n, r );
  584. }
  585. if ( e.children ) {
  586. var o = d( t ),
  587. a = document.createElement( 'strong' );
  588. ( a.className = 'select2-results__group' ),
  589. this.template( e, a );
  590. for (
  591. var l = [], c = 0;
  592. c < e.children.length;
  593. c++
  594. ) {
  595. var u = e.children[ c ],
  596. u = this.option( u );
  597. l.push( u );
  598. }
  599. i = d( '<ul></ul>', {
  600. class:
  601. 'select2-results__options select2-results__options--nested',
  602. role: 'none',
  603. } );
  604. i.append( l ), o.append( a ), o.append( i );
  605. } else this.template( e, t );
  606. return p.StoreData( t, 'data', e ), t;
  607. } ),
  608. ( s.prototype.bind = function ( t, e ) {
  609. var i = this,
  610. n = t.id + '-results';
  611. this.$results.attr( 'id', n ),
  612. t.on( 'results:all', function ( e ) {
  613. i.clear(),
  614. i.append( e.data ),
  615. t.isOpen() &&
  616. ( i.setClasses(),
  617. i.highlightFirstItem() );
  618. } ),
  619. t.on( 'results:append', function ( e ) {
  620. i.append( e.data ),
  621. t.isOpen() && i.setClasses();
  622. } ),
  623. t.on( 'query', function ( e ) {
  624. i.hideMessages(), i.showLoading( e );
  625. } ),
  626. t.on( 'select', function () {
  627. t.isOpen() &&
  628. ( i.setClasses(),
  629. i.options.get( 'scrollAfterSelect' ) &&
  630. i.highlightFirstItem() );
  631. } ),
  632. t.on( 'unselect', function () {
  633. t.isOpen() &&
  634. ( i.setClasses(),
  635. i.options.get( 'scrollAfterSelect' ) &&
  636. i.highlightFirstItem() );
  637. } ),
  638. t.on( 'open', function () {
  639. i.$results.attr( 'aria-expanded', 'true' ),
  640. i.$results.attr(
  641. 'aria-hidden',
  642. 'false'
  643. ),
  644. i.setClasses(),
  645. i.ensureHighlightVisible();
  646. } ),
  647. t.on( 'close', function () {
  648. i.$results.attr( 'aria-expanded', 'false' ),
  649. i.$results.attr(
  650. 'aria-hidden',
  651. 'true'
  652. ),
  653. i.$results.removeAttr(
  654. 'aria-activedescendant'
  655. );
  656. } ),
  657. t.on( 'results:toggle', function () {
  658. var e = i.getHighlightedResults();
  659. 0 !== e.length && e.trigger( 'mouseup' );
  660. } ),
  661. t.on( 'results:select', function () {
  662. var e,
  663. t = i.getHighlightedResults();
  664. 0 !== t.length &&
  665. ( ( e = p.GetData( t[ 0 ], 'data' ) ),
  666. t.hasClass(
  667. 'select2-results__option--selected'
  668. )
  669. ? i.trigger( 'close', {} )
  670. : i.trigger( 'select', {
  671. data: e,
  672. } ) );
  673. } ),
  674. t.on( 'results:previous', function () {
  675. var e,
  676. t = i.getHighlightedResults(),
  677. n = i.$results.find(
  678. '.select2-results__option--selectable'
  679. ),
  680. s = n.index( t );
  681. s <= 0 ||
  682. ( ( e = s - 1 ),
  683. 0 === t.length && ( e = 0 ),
  684. ( s = n.eq( e ) ).trigger(
  685. 'mouseenter'
  686. ),
  687. ( t = i.$results.offset().top ),
  688. ( n = s.offset().top ),
  689. ( s =
  690. i.$results.scrollTop() +
  691. ( n - t ) ),
  692. 0 === e
  693. ? i.$results.scrollTop( 0 )
  694. : n - t < 0 &&
  695. i.$results.scrollTop( s ) );
  696. } ),
  697. t.on( 'results:next', function () {
  698. var e,
  699. t = i.getHighlightedResults(),
  700. n = i.$results.find(
  701. '.select2-results__option--selectable'
  702. ),
  703. s = n.index( t ) + 1;
  704. s >= n.length ||
  705. ( ( e = n.eq( s ) ).trigger(
  706. 'mouseenter'
  707. ),
  708. ( t =
  709. i.$results.offset().top +
  710. i.$results.outerHeight( ! 1 ) ),
  711. ( n =
  712. e.offset().top +
  713. e.outerHeight( ! 1 ) ),
  714. ( e = i.$results.scrollTop() + n - t ),
  715. 0 === s
  716. ? i.$results.scrollTop( 0 )
  717. : t < n &&
  718. i.$results.scrollTop( e ) );
  719. } ),
  720. t.on( 'results:focus', function ( e ) {
  721. e.element[ 0 ].classList.add(
  722. 'select2-results__option--highlighted'
  723. ),
  724. e.element[ 0 ].setAttribute(
  725. 'aria-selected',
  726. 'true'
  727. );
  728. } ),
  729. t.on( 'results:message', function ( e ) {
  730. i.displayMessage( e );
  731. } ),
  732. d.fn.mousewheel &&
  733. this.$results.on(
  734. 'mousewheel',
  735. function ( e ) {
  736. var t = i.$results.scrollTop(),
  737. n =
  738. i.$results.get( 0 )
  739. .scrollHeight -
  740. t +
  741. e.deltaY,
  742. t =
  743. 0 < e.deltaY &&
  744. t - e.deltaY <= 0,
  745. n =
  746. e.deltaY < 0 &&
  747. n <= i.$results.height();
  748. t
  749. ? ( i.$results.scrollTop( 0 ),
  750. e.preventDefault(),
  751. e.stopPropagation() )
  752. : n &&
  753. ( i.$results.scrollTop(
  754. i.$results.get( 0 )
  755. .scrollHeight -
  756. i.$results.height()
  757. ),
  758. e.preventDefault(),
  759. e.stopPropagation() );
  760. }
  761. ),
  762. this.$results.on(
  763. 'mouseup',
  764. '.select2-results__option--selectable',
  765. function ( e ) {
  766. var t = d( this ),
  767. n = p.GetData( this, 'data' );
  768. t.hasClass(
  769. 'select2-results__option--selected'
  770. )
  771. ? i.options.get( 'multiple' )
  772. ? i.trigger( 'unselect', {
  773. originalEvent: e,
  774. data: n,
  775. } )
  776. : i.trigger( 'close', {} )
  777. : i.trigger( 'select', {
  778. originalEvent: e,
  779. data: n,
  780. } );
  781. }
  782. ),
  783. this.$results.on(
  784. 'mouseenter',
  785. '.select2-results__option--selectable',
  786. function ( e ) {
  787. var t = p.GetData( this, 'data' );
  788. i
  789. .getHighlightedResults()
  790. .removeClass(
  791. 'select2-results__option--highlighted'
  792. )
  793. .attr( 'aria-selected', 'false' ),
  794. i.trigger( 'results:focus', {
  795. data: t,
  796. element: d( this ),
  797. } );
  798. }
  799. );
  800. } ),
  801. ( s.prototype.getHighlightedResults = function () {
  802. return this.$results.find(
  803. '.select2-results__option--highlighted'
  804. );
  805. } ),
  806. ( s.prototype.destroy = function () {
  807. this.$results.remove();
  808. } ),
  809. ( s.prototype.ensureHighlightVisible = function () {
  810. var e,
  811. t,
  812. n,
  813. s,
  814. i = this.getHighlightedResults();
  815. 0 !== i.length &&
  816. ( ( e = this.$results
  817. .find(
  818. '.select2-results__option--selectable'
  819. )
  820. .index( i ) ),
  821. ( s = this.$results.offset().top ),
  822. ( t = i.offset().top ),
  823. ( n = this.$results.scrollTop() + ( t - s ) ),
  824. ( s = t - s ),
  825. ( n -= 2 * i.outerHeight( ! 1 ) ),
  826. e <= 2
  827. ? this.$results.scrollTop( 0 )
  828. : ( s > this.$results.outerHeight() ||
  829. s < 0 ) &&
  830. this.$results.scrollTop( n ) );
  831. } ),
  832. ( s.prototype.template = function ( e, t ) {
  833. var n = this.options.get( 'templateResult' ),
  834. s = this.options.get( 'escapeMarkup' ),
  835. e = n( e, t );
  836. null == e
  837. ? ( t.style.display = 'none' )
  838. : 'string' == typeof e
  839. ? ( t.innerHTML = s( e ) )
  840. : d( t ).append( e );
  841. } ),
  842. s
  843. );
  844. }
  845. ),
  846. u.define( 'select2/keys', [], function () {
  847. return {
  848. BACKSPACE: 8,
  849. TAB: 9,
  850. ENTER: 13,
  851. SHIFT: 16,
  852. CTRL: 17,
  853. ALT: 18,
  854. ESC: 27,
  855. SPACE: 32,
  856. PAGE_UP: 33,
  857. PAGE_DOWN: 34,
  858. END: 35,
  859. HOME: 36,
  860. LEFT: 37,
  861. UP: 38,
  862. RIGHT: 39,
  863. DOWN: 40,
  864. DELETE: 46,
  865. };
  866. } ),
  867. u.define(
  868. 'select2/selection/base',
  869. [ 'jquery', '../utils', '../keys' ],
  870. function ( n, s, i ) {
  871. function r( e, t ) {
  872. ( this.$element = e ),
  873. ( this.options = t ),
  874. r.__super__.constructor.call( this );
  875. }
  876. return (
  877. s.Extend( r, s.Observable ),
  878. ( r.prototype.render = function () {
  879. var e = n(
  880. '<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>'
  881. );
  882. return (
  883. ( this._tabindex = 0 ),
  884. null !=
  885. s.GetData( this.$element[ 0 ], 'old-tabindex' )
  886. ? ( this._tabindex = s.GetData(
  887. this.$element[ 0 ],
  888. 'old-tabindex'
  889. ) )
  890. : null !=
  891. this.$element.attr( 'tabindex' ) &&
  892. ( this._tabindex = this.$element.attr(
  893. 'tabindex'
  894. ) ),
  895. e.attr(
  896. 'title',
  897. this.$element.attr( 'title' )
  898. ),
  899. e.attr( 'tabindex', this._tabindex ),
  900. e.attr( 'aria-disabled', 'false' ),
  901. ( this.$selection = e )
  902. );
  903. } ),
  904. ( r.prototype.bind = function ( e, t ) {
  905. var n = this,
  906. s = e.id + '-results';
  907. ( this.container = e ),
  908. this.$selection.on( 'focus', function ( e ) {
  909. n.trigger( 'focus', e );
  910. } ),
  911. this.$selection.on( 'blur', function ( e ) {
  912. n._handleBlur( e );
  913. } ),
  914. this.$selection.on( 'keydown', function ( e ) {
  915. n.trigger( 'keypress', e ),
  916. e.which === i.SPACE &&
  917. e.preventDefault();
  918. } ),
  919. e.on( 'results:focus', function ( e ) {
  920. n.$selection.attr(
  921. 'aria-activedescendant',
  922. e.data._resultId
  923. );
  924. } ),
  925. e.on( 'selection:update', function ( e ) {
  926. n.update( e.data );
  927. } ),
  928. e.on( 'open', function () {
  929. n.$selection.attr(
  930. 'aria-expanded',
  931. 'true'
  932. ),
  933. n.$selection.attr( 'aria-owns', s ),
  934. n._attachCloseHandler( e );
  935. } ),
  936. e.on( 'close', function () {
  937. n.$selection.attr(
  938. 'aria-expanded',
  939. 'false'
  940. ),
  941. n.$selection.removeAttr(
  942. 'aria-activedescendant'
  943. ),
  944. n.$selection.removeAttr( 'aria-owns' ),
  945. n.$selection.trigger( 'focus' ),
  946. n._detachCloseHandler( e );
  947. } ),
  948. e.on( 'enable', function () {
  949. n.$selection.attr(
  950. 'tabindex',
  951. n._tabindex
  952. ),
  953. n.$selection.attr(
  954. 'aria-disabled',
  955. 'false'
  956. );
  957. } ),
  958. e.on( 'disable', function () {
  959. n.$selection.attr( 'tabindex', '-1' ),
  960. n.$selection.attr(
  961. 'aria-disabled',
  962. 'true'
  963. );
  964. } );
  965. } ),
  966. ( r.prototype._handleBlur = function ( e ) {
  967. var t = this;
  968. window.setTimeout( function () {
  969. document.activeElement == t.$selection[ 0 ] ||
  970. n.contains(
  971. t.$selection[ 0 ],
  972. document.activeElement
  973. ) ||
  974. t.trigger( 'blur', e );
  975. }, 1 );
  976. } ),
  977. ( r.prototype._attachCloseHandler = function ( e ) {
  978. n( document.body ).on(
  979. 'mousedown.select2.' + e.id,
  980. function ( e ) {
  981. var t = n( e.target ).closest( '.select2' );
  982. n(
  983. '.select2.select2-container--open'
  984. ).each( function () {
  985. this != t[ 0 ] &&
  986. s
  987. .GetData( this, 'element' )
  988. .select2( 'close' );
  989. } );
  990. }
  991. );
  992. } ),
  993. ( r.prototype._detachCloseHandler = function ( e ) {
  994. n( document.body ).off(
  995. 'mousedown.select2.' + e.id
  996. );
  997. } ),
  998. ( r.prototype.position = function ( e, t ) {
  999. t.find( '.selection' ).append( e );
  1000. } ),
  1001. ( r.prototype.destroy = function () {
  1002. this._detachCloseHandler( this.container );
  1003. } ),
  1004. ( r.prototype.update = function ( e ) {
  1005. throw new Error(
  1006. 'The `update` method must be defined in child classes.'
  1007. );
  1008. } ),
  1009. ( r.prototype.isEnabled = function () {
  1010. return ! this.isDisabled();
  1011. } ),
  1012. ( r.prototype.isDisabled = function () {
  1013. return this.options.get( 'disabled' );
  1014. } ),
  1015. r
  1016. );
  1017. }
  1018. ),
  1019. u.define(
  1020. 'select2/selection/single',
  1021. [ 'jquery', './base', '../utils', '../keys' ],
  1022. function ( e, t, n, s ) {
  1023. function i() {
  1024. i.__super__.constructor.apply( this, arguments );
  1025. }
  1026. return (
  1027. n.Extend( i, t ),
  1028. ( i.prototype.render = function () {
  1029. var e = i.__super__.render.call( this );
  1030. return (
  1031. e[ 0 ].classList.add(
  1032. 'select2-selection--single'
  1033. ),
  1034. e.html(
  1035. '<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'
  1036. ),
  1037. e
  1038. );
  1039. } ),
  1040. ( i.prototype.bind = function ( t, e ) {
  1041. var n = this;
  1042. i.__super__.bind.apply( this, arguments );
  1043. var s = t.id + '-container';
  1044. this.$selection
  1045. .find( '.select2-selection__rendered' )
  1046. .attr( 'id', s )
  1047. .attr( 'role', 'textbox' )
  1048. .attr( 'aria-readonly', 'true' ),
  1049. this.$selection.attr( 'aria-labelledby', s ),
  1050. this.$selection.attr( 'aria-controls', s ),
  1051. this.$selection.on(
  1052. 'mousedown',
  1053. function ( e ) {
  1054. 1 === e.which &&
  1055. n.trigger( 'toggle', {
  1056. originalEvent: e,
  1057. } );
  1058. }
  1059. ),
  1060. this.$selection.on(
  1061. 'focus',
  1062. function ( e ) {}
  1063. ),
  1064. this.$selection.on( 'blur', function ( e ) {} ),
  1065. t.on( 'focus', function ( e ) {
  1066. t.isOpen() ||
  1067. n.$selection.trigger( 'focus' );
  1068. } );
  1069. } ),
  1070. ( i.prototype.clear = function () {
  1071. var e = this.$selection.find(
  1072. '.select2-selection__rendered'
  1073. );
  1074. e.empty(), e.removeAttr( 'title' );
  1075. } ),
  1076. ( i.prototype.display = function ( e, t ) {
  1077. var n = this.options.get( 'templateSelection' );
  1078. return this.options.get( 'escapeMarkup' )(
  1079. n( e, t )
  1080. );
  1081. } ),
  1082. ( i.prototype.selectionContainer = function () {
  1083. return e( '<span></span>' );
  1084. } ),
  1085. ( i.prototype.update = function ( e ) {
  1086. var t, n;
  1087. 0 !== e.length
  1088. ? ( ( n = e[ 0 ] ),
  1089. ( t = this.$selection.find(
  1090. '.select2-selection__rendered'
  1091. ) ),
  1092. ( e = this.display( n, t ) ),
  1093. t.empty().append( e ),
  1094. ( n = n.title || n.text )
  1095. ? t.attr( 'title', n )
  1096. : t.removeAttr( 'title' ) )
  1097. : this.clear();
  1098. } ),
  1099. i
  1100. );
  1101. }
  1102. ),
  1103. u.define(
  1104. 'select2/selection/multiple',
  1105. [ 'jquery', './base', '../utils' ],
  1106. function ( i, e, c ) {
  1107. function r( e, t ) {
  1108. r.__super__.constructor.apply( this, arguments );
  1109. }
  1110. return (
  1111. c.Extend( r, e ),
  1112. ( r.prototype.render = function () {
  1113. var e = r.__super__.render.call( this );
  1114. return (
  1115. e[ 0 ].classList.add(
  1116. 'select2-selection--multiple'
  1117. ),
  1118. e.html(
  1119. '<ul class="select2-selection__rendered"></ul>'
  1120. ),
  1121. e
  1122. );
  1123. } ),
  1124. ( r.prototype.bind = function ( e, t ) {
  1125. var n = this;
  1126. r.__super__.bind.apply( this, arguments );
  1127. var s = e.id + '-container';
  1128. this.$selection
  1129. .find( '.select2-selection__rendered' )
  1130. .attr( 'id', s ),
  1131. this.$selection.on( 'click', function ( e ) {
  1132. n.trigger( 'toggle', { originalEvent: e } );
  1133. } ),
  1134. this.$selection.on(
  1135. 'click',
  1136. '.select2-selection__choice__remove',
  1137. function ( e ) {
  1138. var t;
  1139. n.isDisabled() ||
  1140. ( ( t = i( this ).parent() ),
  1141. ( t = c.GetData( t[ 0 ], 'data' ) ),
  1142. n.trigger( 'unselect', {
  1143. originalEvent: e,
  1144. data: t,
  1145. } ) );
  1146. }
  1147. ),
  1148. this.$selection.on(
  1149. 'keydown',
  1150. '.select2-selection__choice__remove',
  1151. function ( e ) {
  1152. n.isDisabled() || e.stopPropagation();
  1153. }
  1154. );
  1155. } ),
  1156. ( r.prototype.clear = function () {
  1157. var e = this.$selection.find(
  1158. '.select2-selection__rendered'
  1159. );
  1160. e.empty(), e.removeAttr( 'title' );
  1161. } ),
  1162. ( r.prototype.display = function ( e, t ) {
  1163. var n = this.options.get( 'templateSelection' );
  1164. return this.options.get( 'escapeMarkup' )(
  1165. n( e, t )
  1166. );
  1167. } ),
  1168. ( r.prototype.selectionContainer = function () {
  1169. return i(
  1170. '<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>'
  1171. );
  1172. } ),
  1173. ( r.prototype.update = function ( e ) {
  1174. if ( ( this.clear(), 0 !== e.length ) ) {
  1175. for (
  1176. var t = [],
  1177. n =
  1178. this.$selection
  1179. .find(
  1180. '.select2-selection__rendered'
  1181. )
  1182. .attr( 'id' ) + '-choice-',
  1183. s = 0;
  1184. s < e.length;
  1185. s++
  1186. ) {
  1187. var i = e[ s ],
  1188. r = this.selectionContainer(),
  1189. o = this.display( i, r ),
  1190. a = n + c.generateChars( 4 ) + '-';
  1191. i.id
  1192. ? ( a += i.id )
  1193. : ( a += c.generateChars( 4 ) ),
  1194. r
  1195. .find(
  1196. '.select2-selection__choice__display'
  1197. )
  1198. .append( o )
  1199. .attr( 'id', a );
  1200. var l = i.title || i.text;
  1201. l && r.attr( 'title', l );
  1202. ( o = this.options
  1203. .get( 'translations' )
  1204. .get( 'removeItem' ) ),
  1205. ( l = r.find(
  1206. '.select2-selection__choice__remove'
  1207. ) );
  1208. l.attr( 'title', o() ),
  1209. l.attr( 'aria-label', o() ),
  1210. l.attr( 'aria-describedby', a ),
  1211. c.StoreData( r[ 0 ], 'data', i ),
  1212. t.push( r );
  1213. }
  1214. this.$selection
  1215. .find( '.select2-selection__rendered' )
  1216. .append( t );
  1217. }
  1218. } ),
  1219. r
  1220. );
  1221. }
  1222. ),
  1223. u.define( 'select2/selection/placeholder', [], function () {
  1224. function e( e, t, n ) {
  1225. ( this.placeholder = this.normalizePlaceholder(
  1226. n.get( 'placeholder' )
  1227. ) ),
  1228. e.call( this, t, n );
  1229. }
  1230. return (
  1231. ( e.prototype.normalizePlaceholder = function ( e, t ) {
  1232. return (
  1233. 'string' == typeof t && ( t = { id: '', text: t } ),
  1234. t
  1235. );
  1236. } ),
  1237. ( e.prototype.createPlaceholder = function ( e, t ) {
  1238. var n = this.selectionContainer();
  1239. n.html( this.display( t ) ),
  1240. n[ 0 ].classList.add(
  1241. 'select2-selection__placeholder'
  1242. ),
  1243. n[ 0 ].classList.remove(
  1244. 'select2-selection__choice'
  1245. );
  1246. t = t.title || t.text || n.text();
  1247. return (
  1248. this.$selection
  1249. .find( '.select2-selection__rendered' )
  1250. .attr( 'title', t ),
  1251. n
  1252. );
  1253. } ),
  1254. ( e.prototype.update = function ( e, t ) {
  1255. var n =
  1256. 1 == t.length && t[ 0 ].id != this.placeholder.id;
  1257. if ( 1 < t.length || n ) return e.call( this, t );
  1258. this.clear();
  1259. t = this.createPlaceholder( this.placeholder );
  1260. this.$selection
  1261. .find( '.select2-selection__rendered' )
  1262. .append( t );
  1263. } ),
  1264. e
  1265. );
  1266. } ),
  1267. u.define(
  1268. 'select2/selection/allowClear',
  1269. [ 'jquery', '../keys', '../utils' ],
  1270. function ( i, s, a ) {
  1271. function e() {}
  1272. return (
  1273. ( e.prototype.bind = function ( e, t, n ) {
  1274. var s = this;
  1275. e.call( this, t, n ),
  1276. null == this.placeholder &&
  1277. this.options.get( 'debug' ) &&
  1278. window.console &&
  1279. console.error &&
  1280. console.error(
  1281. 'Select2: The `allowClear` option should be used in combination with the `placeholder` option.'
  1282. ),
  1283. this.$selection.on(
  1284. 'mousedown',
  1285. '.select2-selection__clear',
  1286. function ( e ) {
  1287. s._handleClear( e );
  1288. }
  1289. ),
  1290. t.on( 'keypress', function ( e ) {
  1291. s._handleKeyboardClear( e, t );
  1292. } );
  1293. } ),
  1294. ( e.prototype._handleClear = function ( e, t ) {
  1295. if ( ! this.isDisabled() ) {
  1296. var n = this.$selection.find(
  1297. '.select2-selection__clear'
  1298. );
  1299. if ( 0 !== n.length ) {
  1300. t.stopPropagation();
  1301. var s = a.GetData( n[ 0 ], 'data' ),
  1302. i = this.$element.val();
  1303. this.$element.val( this.placeholder.id );
  1304. var r = { data: s };
  1305. if (
  1306. ( this.trigger( 'clear', r ),
  1307. r.prevented )
  1308. )
  1309. this.$element.val( i );
  1310. else {
  1311. for ( var o = 0; o < s.length; o++ )
  1312. if (
  1313. ( ( r = { data: s[ o ] } ),
  1314. this.trigger( 'unselect', r ),
  1315. r.prevented )
  1316. )
  1317. return void this.$element.val(
  1318. i
  1319. );
  1320. this.$element
  1321. .trigger( 'input' )
  1322. .trigger( 'change' ),
  1323. this.trigger( 'toggle', {} );
  1324. }
  1325. }
  1326. }
  1327. } ),
  1328. ( e.prototype._handleKeyboardClear = function (
  1329. e,
  1330. t,
  1331. n
  1332. ) {
  1333. n.isOpen() ||
  1334. ( t.which != s.DELETE &&
  1335. t.which != s.BACKSPACE ) ||
  1336. this._handleClear( t );
  1337. } ),
  1338. ( e.prototype.update = function ( e, t ) {
  1339. var n, s;
  1340. e.call( this, t ),
  1341. this.$selection
  1342. .find( '.select2-selection__clear' )
  1343. .remove(),
  1344. this.$selection[ 0 ].classList.remove(
  1345. 'select2-selection--clearable'
  1346. ),
  1347. 0 <
  1348. this.$selection.find(
  1349. '.select2-selection__placeholder'
  1350. ).length ||
  1351. 0 === t.length ||
  1352. ( ( n = this.$selection
  1353. .find( '.select2-selection__rendered' )
  1354. .attr( 'id' ) ),
  1355. ( s = this.options
  1356. .get( 'translations' )
  1357. .get( 'removeAllItems' ) ),
  1358. ( e = i(
  1359. '<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>'
  1360. ) ).attr( 'title', s() ),
  1361. e.attr( 'aria-label', s() ),
  1362. e.attr( 'aria-describedby', n ),
  1363. a.StoreData( e[ 0 ], 'data', t ),
  1364. this.$selection.prepend( e ),
  1365. this.$selection[ 0 ].classList.add(
  1366. 'select2-selection--clearable'
  1367. ) );
  1368. } ),
  1369. e
  1370. );
  1371. }
  1372. ),
  1373. u.define(
  1374. 'select2/selection/search',
  1375. [ 'jquery', '../utils', '../keys' ],
  1376. function ( s, a, l ) {
  1377. function e( e, t, n ) {
  1378. e.call( this, t, n );
  1379. }
  1380. return (
  1381. ( e.prototype.render = function ( e ) {
  1382. var t = this.options
  1383. .get( 'translations' )
  1384. .get( 'search' ),
  1385. n = s(
  1386. '<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>'
  1387. );
  1388. ( this.$searchContainer = n ),
  1389. ( this.$search = n.find( 'textarea' ) ),
  1390. this.$search.prop(
  1391. 'autocomplete',
  1392. this.options.get( 'autocomplete' )
  1393. ),
  1394. this.$search.attr( 'aria-label', t() );
  1395. e = e.call( this );
  1396. return (
  1397. this._transferTabIndex(),
  1398. e.append( this.$searchContainer ),
  1399. e
  1400. );
  1401. } ),
  1402. ( e.prototype.bind = function ( e, t, n ) {
  1403. var s = this,
  1404. i = t.id + '-results',
  1405. r = t.id + '-container';
  1406. e.call( this, t, n ),
  1407. s.$search.attr( 'aria-describedby', r ),
  1408. t.on( 'open', function () {
  1409. s.$search.attr( 'aria-controls', i ),
  1410. s.$search.trigger( 'focus' );
  1411. } ),
  1412. t.on( 'close', function () {
  1413. s.$search.val( '' ),
  1414. s.resizeSearch(),
  1415. s.$search.removeAttr( 'aria-controls' ),
  1416. s.$search.removeAttr(
  1417. 'aria-activedescendant'
  1418. ),
  1419. s.$search.trigger( 'focus' );
  1420. } ),
  1421. t.on( 'enable', function () {
  1422. s.$search.prop( 'disabled', ! 1 ),
  1423. s._transferTabIndex();
  1424. } ),
  1425. t.on( 'disable', function () {
  1426. s.$search.prop( 'disabled', ! 0 );
  1427. } ),
  1428. t.on( 'focus', function ( e ) {
  1429. s.$search.trigger( 'focus' );
  1430. } ),
  1431. t.on( 'results:focus', function ( e ) {
  1432. e.data._resultId
  1433. ? s.$search.attr(
  1434. 'aria-activedescendant',
  1435. e.data._resultId
  1436. )
  1437. : s.$search.removeAttr(
  1438. 'aria-activedescendant'
  1439. );
  1440. } ),
  1441. this.$selection.on(
  1442. 'focusin',
  1443. '.select2-search--inline',
  1444. function ( e ) {
  1445. s.trigger( 'focus', e );
  1446. }
  1447. ),
  1448. this.$selection.on(
  1449. 'focusout',
  1450. '.select2-search--inline',
  1451. function ( e ) {
  1452. s._handleBlur( e );
  1453. }
  1454. ),
  1455. this.$selection.on(
  1456. 'keydown',
  1457. '.select2-search--inline',
  1458. function ( e ) {
  1459. var t;
  1460. e.stopPropagation(),
  1461. s.trigger( 'keypress', e ),
  1462. ( s._keyUpPrevented = e.isDefaultPrevented() ),
  1463. e.which !== l.BACKSPACE ||
  1464. '' !== s.$search.val() ||
  1465. ( 0 <
  1466. ( t = s.$selection
  1467. .find(
  1468. '.select2-selection__choice'
  1469. )
  1470. .last() ).length &&
  1471. ( ( t = a.GetData(
  1472. t[ 0 ],
  1473. 'data'
  1474. ) ),
  1475. s.searchRemoveChoice( t ),
  1476. e.preventDefault() ) );
  1477. }
  1478. ),
  1479. this.$selection.on(
  1480. 'click',
  1481. '.select2-search--inline',
  1482. function ( e ) {
  1483. s.$search.val() && e.stopPropagation();
  1484. }
  1485. );
  1486. var t = document.documentMode,
  1487. o = t && t <= 11;
  1488. this.$selection.on(
  1489. 'input.searchcheck',
  1490. '.select2-search--inline',
  1491. function ( e ) {
  1492. o
  1493. ? s.$selection.off(
  1494. 'input.search input.searchcheck'
  1495. )
  1496. : s.$selection.off( 'keyup.search' );
  1497. }
  1498. ),
  1499. this.$selection.on(
  1500. 'keyup.search input.search',
  1501. '.select2-search--inline',
  1502. function ( e ) {
  1503. var t;
  1504. o && 'input' === e.type
  1505. ? s.$selection.off(
  1506. 'input.search input.searchcheck'
  1507. )
  1508. : ( t = e.which ) != l.SHIFT &&
  1509. t != l.CTRL &&
  1510. t != l.ALT &&
  1511. t != l.TAB &&
  1512. s.handleSearch( e );
  1513. }
  1514. );
  1515. } ),
  1516. ( e.prototype._transferTabIndex = function ( e ) {
  1517. this.$search.attr(
  1518. 'tabindex',
  1519. this.$selection.attr( 'tabindex' )
  1520. ),
  1521. this.$selection.attr( 'tabindex', '-1' );
  1522. } ),
  1523. ( e.prototype.createPlaceholder = function ( e, t ) {
  1524. this.$search.attr( 'placeholder', t.text );
  1525. } ),
  1526. ( e.prototype.update = function ( e, t ) {
  1527. var n = this.$search[ 0 ] == document.activeElement;
  1528. this.$search.attr( 'placeholder', '' ),
  1529. e.call( this, t ),
  1530. this.resizeSearch(),
  1531. n && this.$search.trigger( 'focus' );
  1532. } ),
  1533. ( e.prototype.handleSearch = function () {
  1534. var e;
  1535. this.resizeSearch(),
  1536. this._keyUpPrevented ||
  1537. ( ( e = this.$search.val() ),
  1538. this.trigger( 'query', { term: e } ) ),
  1539. ( this._keyUpPrevented = ! 1 );
  1540. } ),
  1541. ( e.prototype.searchRemoveChoice = function ( e, t ) {
  1542. this.trigger( 'unselect', { data: t } ),
  1543. this.$search.val( t.text ),
  1544. this.handleSearch();
  1545. } ),
  1546. ( e.prototype.resizeSearch = function () {
  1547. this.$search.css( 'width', '25px' );
  1548. var e = '100%';
  1549. '' === this.$search.attr( 'placeholder' ) &&
  1550. ( e =
  1551. 0.75 * ( this.$search.val().length + 1 ) +
  1552. 'em' ),
  1553. this.$search.css( 'width', e );
  1554. } ),
  1555. e
  1556. );
  1557. }
  1558. ),
  1559. u.define(
  1560. 'select2/selection/selectionCss',
  1561. [ '../utils' ],
  1562. function ( n ) {
  1563. function e() {}
  1564. return (
  1565. ( e.prototype.render = function ( e ) {
  1566. var t = e.call( this ),
  1567. e =
  1568. this.options.get( 'selectionCssClass' ) ||
  1569. '';
  1570. return (
  1571. -1 !== e.indexOf( ':all:' ) &&
  1572. ( ( e = e.replace( ':all:', '' ) ),
  1573. n.copyNonInternalCssClasses(
  1574. t[ 0 ],
  1575. this.$element[ 0 ]
  1576. ) ),
  1577. t.addClass( e ),
  1578. t
  1579. );
  1580. } ),
  1581. e
  1582. );
  1583. }
  1584. ),
  1585. u.define(
  1586. 'select2/selection/eventRelay',
  1587. [ 'jquery' ],
  1588. function ( o ) {
  1589. function e() {}
  1590. return (
  1591. ( e.prototype.bind = function ( e, t, n ) {
  1592. var s = this,
  1593. i = [
  1594. 'open',
  1595. 'opening',
  1596. 'close',
  1597. 'closing',
  1598. 'select',
  1599. 'selecting',
  1600. 'unselect',
  1601. 'unselecting',
  1602. 'clear',
  1603. 'clearing',
  1604. ],
  1605. r = [
  1606. 'opening',
  1607. 'closing',
  1608. 'selecting',
  1609. 'unselecting',
  1610. 'clearing',
  1611. ];
  1612. e.call( this, t, n ),
  1613. t.on( '*', function ( e, t ) {
  1614. var n;
  1615. -1 !== i.indexOf( e ) &&
  1616. ( ( t = t || {} ),
  1617. ( n = o.Event( 'select2:' + e, {
  1618. params: t,
  1619. } ) ),
  1620. s.$element.trigger( n ),
  1621. -1 !== r.indexOf( e ) &&
  1622. ( t.prevented = n.isDefaultPrevented() ) );
  1623. } );
  1624. } ),
  1625. e
  1626. );
  1627. }
  1628. ),
  1629. u.define(
  1630. 'select2/translation',
  1631. [ 'jquery', 'require' ],
  1632. function ( t, n ) {
  1633. function s( e ) {
  1634. this.dict = e || {};
  1635. }
  1636. return (
  1637. ( s.prototype.all = function () {
  1638. return this.dict;
  1639. } ),
  1640. ( s.prototype.get = function ( e ) {
  1641. return this.dict[ e ];
  1642. } ),
  1643. ( s.prototype.extend = function ( e ) {
  1644. this.dict = t.extend( {}, e.all(), this.dict );
  1645. } ),
  1646. ( s._cache = {} ),
  1647. ( s.loadPath = function ( e ) {
  1648. var t;
  1649. return (
  1650. e in s._cache ||
  1651. ( ( t = n( e ) ), ( s._cache[ e ] = t ) ),
  1652. new s( s._cache[ e ] )
  1653. );
  1654. } ),
  1655. s
  1656. );
  1657. }
  1658. ),
  1659. u.define( 'select2/diacritics', [], function () {
  1660. return {
  1661. 'Ⓐ': 'A',
  1662. A: 'A',
  1663. À: 'A',
  1664. Á: 'A',
  1665. Â: 'A',
  1666. Ầ: 'A',
  1667. Ấ: 'A',
  1668. Ẫ: 'A',
  1669. Ẩ: 'A',
  1670. Ã: 'A',
  1671. Ā: 'A',
  1672. Ă: 'A',
  1673. Ằ: 'A',
  1674. Ắ: 'A',
  1675. Ẵ: 'A',
  1676. Ẳ: 'A',
  1677. Ȧ: 'A',
  1678. Ǡ: 'A',
  1679. Ä: 'A',
  1680. Ǟ: 'A',
  1681. Ả: 'A',
  1682. Å: 'A',
  1683. Ǻ: 'A',
  1684. Ǎ: 'A',
  1685. Ȁ: 'A',
  1686. Ȃ: 'A',
  1687. Ạ: 'A',
  1688. Ậ: 'A',
  1689. Ặ: 'A',
  1690. Ḁ: 'A',
  1691. Ą: 'A',
  1692. Ⱥ: 'A',
  1693. Ɐ: 'A',
  1694. Ꜳ: 'AA',
  1695. Æ: 'AE',
  1696. Ǽ: 'AE',
  1697. Ǣ: 'AE',
  1698. Ꜵ: 'AO',
  1699. Ꜷ: 'AU',
  1700. Ꜹ: 'AV',
  1701. Ꜻ: 'AV',
  1702. Ꜽ: 'AY',
  1703. 'Ⓑ': 'B',
  1704. B: 'B',
  1705. Ḃ: 'B',
  1706. Ḅ: 'B',
  1707. Ḇ: 'B',
  1708. Ƀ: 'B',
  1709. Ƃ: 'B',
  1710. Ɓ: 'B',
  1711. 'Ⓒ': 'C',
  1712. C: 'C',
  1713. Ć: 'C',
  1714. Ĉ: 'C',
  1715. Ċ: 'C',
  1716. Č: 'C',
  1717. Ç: 'C',
  1718. Ḉ: 'C',
  1719. Ƈ: 'C',
  1720. Ȼ: 'C',
  1721. Ꜿ: 'C',
  1722. 'Ⓓ': 'D',
  1723. D: 'D',
  1724. Ḋ: 'D',
  1725. Ď: 'D',
  1726. Ḍ: 'D',
  1727. Ḑ: 'D',
  1728. Ḓ: 'D',
  1729. Ḏ: 'D',
  1730. Đ: 'D',
  1731. Ƌ: 'D',
  1732. Ɗ: 'D',
  1733. Ɖ: 'D',
  1734. Ꝺ: 'D',
  1735. DZ: 'DZ',
  1736. DŽ: 'DZ',
  1737. Dz: 'Dz',
  1738. Dž: 'Dz',
  1739. 'Ⓔ': 'E',
  1740. E: 'E',
  1741. È: 'E',
  1742. É: 'E',
  1743. Ê: 'E',
  1744. Ề: 'E',
  1745. Ế: 'E',
  1746. Ễ: 'E',
  1747. Ể: 'E',
  1748. Ẽ: 'E',
  1749. Ē: 'E',
  1750. Ḕ: 'E',
  1751. Ḗ: 'E',
  1752. Ĕ: 'E',
  1753. Ė: 'E',
  1754. Ë: 'E',
  1755. Ẻ: 'E',
  1756. Ě: 'E',
  1757. Ȅ: 'E',
  1758. Ȇ: 'E',
  1759. Ẹ: 'E',
  1760. Ệ: 'E',
  1761. Ȩ: 'E',
  1762. Ḝ: 'E',
  1763. Ę: 'E',
  1764. Ḙ: 'E',
  1765. Ḛ: 'E',
  1766. Ɛ: 'E',
  1767. Ǝ: 'E',
  1768. 'Ⓕ': 'F',
  1769. F: 'F',
  1770. Ḟ: 'F',
  1771. Ƒ: 'F',
  1772. Ꝼ: 'F',
  1773. 'Ⓖ': 'G',
  1774. G: 'G',
  1775. Ǵ: 'G',
  1776. Ĝ: 'G',
  1777. Ḡ: 'G',
  1778. Ğ: 'G',
  1779. Ġ: 'G',
  1780. Ǧ: 'G',
  1781. Ģ: 'G',
  1782. Ǥ: 'G',
  1783. Ɠ: 'G',
  1784. Ꞡ: 'G',
  1785. Ᵹ: 'G',
  1786. Ꝿ: 'G',
  1787. 'Ⓗ': 'H',
  1788. H: 'H',
  1789. Ĥ: 'H',
  1790. Ḣ: 'H',
  1791. Ḧ: 'H',
  1792. Ȟ: 'H',
  1793. Ḥ: 'H',
  1794. Ḩ: 'H',
  1795. Ḫ: 'H',
  1796. Ħ: 'H',
  1797. Ⱨ: 'H',
  1798. Ⱶ: 'H',
  1799. Ɥ: 'H',
  1800. 'Ⓘ': 'I',
  1801. I: 'I',
  1802. Ì: 'I',
  1803. Í: 'I',
  1804. Î: 'I',
  1805. Ĩ: 'I',
  1806. Ī: 'I',
  1807. Ĭ: 'I',
  1808. İ: 'I',
  1809. Ï: 'I',
  1810. Ḯ: 'I',
  1811. Ỉ: 'I',
  1812. Ǐ: 'I',
  1813. Ȉ: 'I',
  1814. Ȋ: 'I',
  1815. Ị: 'I',
  1816. Į: 'I',
  1817. Ḭ: 'I',
  1818. Ɨ: 'I',
  1819. 'Ⓙ': 'J',
  1820. J: 'J',
  1821. Ĵ: 'J',
  1822. Ɉ: 'J',
  1823. 'Ⓚ': 'K',
  1824. K: 'K',
  1825. Ḱ: 'K',
  1826. Ǩ: 'K',
  1827. Ḳ: 'K',
  1828. Ķ: 'K',
  1829. Ḵ: 'K',
  1830. Ƙ: 'K',
  1831. Ⱪ: 'K',
  1832. Ꝁ: 'K',
  1833. Ꝃ: 'K',
  1834. Ꝅ: 'K',
  1835. Ꞣ: 'K',
  1836. 'Ⓛ': 'L',
  1837. L: 'L',
  1838. Ŀ: 'L',
  1839. Ĺ: 'L',
  1840. Ľ: 'L',
  1841. Ḷ: 'L',
  1842. Ḹ: 'L',
  1843. Ļ: 'L',
  1844. Ḽ: 'L',
  1845. Ḻ: 'L',
  1846. Ł: 'L',
  1847. Ƚ: 'L',
  1848. Ɫ: 'L',
  1849. Ⱡ: 'L',
  1850. Ꝉ: 'L',
  1851. Ꝇ: 'L',
  1852. Ꞁ: 'L',
  1853. LJ: 'LJ',
  1854. Lj: 'Lj',
  1855. 'Ⓜ': 'M',
  1856. M: 'M',
  1857. Ḿ: 'M',
  1858. Ṁ: 'M',
  1859. Ṃ: 'M',
  1860. Ɱ: 'M',
  1861. Ɯ: 'M',
  1862. 'Ⓝ': 'N',
  1863. N: 'N',
  1864. Ǹ: 'N',
  1865. Ń: 'N',
  1866. Ñ: 'N',
  1867. Ṅ: 'N',
  1868. Ň: 'N',
  1869. Ṇ: 'N',
  1870. Ņ: 'N',
  1871. Ṋ: 'N',
  1872. Ṉ: 'N',
  1873. Ƞ: 'N',
  1874. Ɲ: 'N',
  1875. Ꞑ: 'N',
  1876. Ꞥ: 'N',
  1877. NJ: 'NJ',
  1878. Nj: 'Nj',
  1879. 'Ⓞ': 'O',
  1880. O: 'O',
  1881. Ò: 'O',
  1882. Ó: 'O',
  1883. Ô: 'O',
  1884. Ồ: 'O',
  1885. Ố: 'O',
  1886. Ỗ: 'O',
  1887. Ổ: 'O',
  1888. Õ: 'O',
  1889. Ṍ: 'O',
  1890. Ȭ: 'O',
  1891. Ṏ: 'O',
  1892. Ō: 'O',
  1893. Ṑ: 'O',
  1894. Ṓ: 'O',
  1895. Ŏ: 'O',
  1896. Ȯ: 'O',
  1897. Ȱ: 'O',
  1898. Ö: 'O',
  1899. Ȫ: 'O',
  1900. Ỏ: 'O',
  1901. Ő: 'O',
  1902. Ǒ: 'O',
  1903. Ȍ: 'O',
  1904. Ȏ: 'O',
  1905. Ơ: 'O',
  1906. Ờ: 'O',
  1907. Ớ: 'O',
  1908. Ỡ: 'O',
  1909. Ở: 'O',
  1910. Ợ: 'O',
  1911. Ọ: 'O',
  1912. Ộ: 'O',
  1913. Ǫ: 'O',
  1914. Ǭ: 'O',
  1915. Ø: 'O',
  1916. Ǿ: 'O',
  1917. Ɔ: 'O',
  1918. Ɵ: 'O',
  1919. Ꝋ: 'O',
  1920. Ꝍ: 'O',
  1921. Œ: 'OE',
  1922. Ƣ: 'OI',
  1923. Ꝏ: 'OO',
  1924. Ȣ: 'OU',
  1925. 'Ⓟ': 'P',
  1926. P: 'P',
  1927. Ṕ: 'P',
  1928. Ṗ: 'P',
  1929. Ƥ: 'P',
  1930. Ᵽ: 'P',
  1931. Ꝑ: 'P',
  1932. Ꝓ: 'P',
  1933. Ꝕ: 'P',
  1934. 'Ⓠ': 'Q',
  1935. Q: 'Q',
  1936. Ꝗ: 'Q',
  1937. Ꝙ: 'Q',
  1938. Ɋ: 'Q',
  1939. 'Ⓡ': 'R',
  1940. R: 'R',
  1941. Ŕ: 'R',
  1942. Ṙ: 'R',
  1943. Ř: 'R',
  1944. Ȑ: 'R',
  1945. Ȓ: 'R',
  1946. Ṛ: 'R',
  1947. Ṝ: 'R',
  1948. Ŗ: 'R',
  1949. Ṟ: 'R',
  1950. Ɍ: 'R',
  1951. Ɽ: 'R',
  1952. Ꝛ: 'R',
  1953. Ꞧ: 'R',
  1954. Ꞃ: 'R',
  1955. 'Ⓢ': 'S',
  1956. S: 'S',
  1957. ẞ: 'S',
  1958. Ś: 'S',
  1959. Ṥ: 'S',
  1960. Ŝ: 'S',
  1961. Ṡ: 'S',
  1962. Š: 'S',
  1963. Ṧ: 'S',
  1964. Ṣ: 'S',
  1965. Ṩ: 'S',
  1966. Ș: 'S',
  1967. Ş: 'S',
  1968. Ȿ: 'S',
  1969. Ꞩ: 'S',
  1970. Ꞅ: 'S',
  1971. 'Ⓣ': 'T',
  1972. T: 'T',
  1973. Ṫ: 'T',
  1974. Ť: 'T',
  1975. Ṭ: 'T',
  1976. Ț: 'T',
  1977. Ţ: 'T',
  1978. Ṱ: 'T',
  1979. Ṯ: 'T',
  1980. Ŧ: 'T',
  1981. Ƭ: 'T',
  1982. Ʈ: 'T',
  1983. Ⱦ: 'T',
  1984. Ꞇ: 'T',
  1985. Ꜩ: 'TZ',
  1986. 'Ⓤ': 'U',
  1987. U: 'U',
  1988. Ù: 'U',
  1989. Ú: 'U',
  1990. Û: 'U',
  1991. Ũ: 'U',
  1992. Ṹ: 'U',
  1993. Ū: 'U',
  1994. Ṻ: 'U',
  1995. Ŭ: 'U',
  1996. Ü: 'U',
  1997. Ǜ: 'U',
  1998. Ǘ: 'U',
  1999. Ǖ: 'U',
  2000. Ǚ: 'U',
  2001. Ủ: 'U',
  2002. Ů: 'U',
  2003. Ű: 'U',
  2004. Ǔ: 'U',
  2005. Ȕ: 'U',
  2006. Ȗ: 'U',
  2007. Ư: 'U',
  2008. Ừ: 'U',
  2009. Ứ: 'U',
  2010. Ữ: 'U',
  2011. Ử: 'U',
  2012. Ự: 'U',
  2013. Ụ: 'U',
  2014. Ṳ: 'U',
  2015. Ų: 'U',
  2016. Ṷ: 'U',
  2017. Ṵ: 'U',
  2018. Ʉ: 'U',
  2019. 'Ⓥ': 'V',
  2020. V: 'V',
  2021. Ṽ: 'V',
  2022. Ṿ: 'V',
  2023. Ʋ: 'V',
  2024. Ꝟ: 'V',
  2025. Ʌ: 'V',
  2026. Ꝡ: 'VY',
  2027. 'Ⓦ': 'W',
  2028. W: 'W',
  2029. Ẁ: 'W',
  2030. Ẃ: 'W',
  2031. Ŵ: 'W',
  2032. Ẇ: 'W',
  2033. Ẅ: 'W',
  2034. Ẉ: 'W',
  2035. Ⱳ: 'W',
  2036. 'Ⓧ': 'X',
  2037. X: 'X',
  2038. Ẋ: 'X',
  2039. Ẍ: 'X',
  2040. 'Ⓨ': 'Y',
  2041. Y: 'Y',
  2042. Ỳ: 'Y',
  2043. Ý: 'Y',
  2044. Ŷ: 'Y',
  2045. Ỹ: 'Y',
  2046. Ȳ: 'Y',
  2047. Ẏ: 'Y',
  2048. Ÿ: 'Y',
  2049. Ỷ: 'Y',
  2050. Ỵ: 'Y',
  2051. Ƴ: 'Y',
  2052. Ɏ: 'Y',
  2053. Ỿ: 'Y',
  2054. 'Ⓩ': 'Z',
  2055. Z: 'Z',
  2056. Ź: 'Z',
  2057. Ẑ: 'Z',
  2058. Ż: 'Z',
  2059. Ž: 'Z',
  2060. Ẓ: 'Z',
  2061. Ẕ: 'Z',
  2062. Ƶ: 'Z',
  2063. Ȥ: 'Z',
  2064. Ɀ: 'Z',
  2065. Ⱬ: 'Z',
  2066. Ꝣ: 'Z',
  2067. 'ⓐ': 'a',
  2068. a: 'a',
  2069. ẚ: 'a',
  2070. à: 'a',
  2071. á: 'a',
  2072. â: 'a',
  2073. ầ: 'a',
  2074. ấ: 'a',
  2075. ẫ: 'a',
  2076. ẩ: 'a',
  2077. ã: 'a',
  2078. ā: 'a',
  2079. ă: 'a',
  2080. ằ: 'a',
  2081. ắ: 'a',
  2082. ẵ: 'a',
  2083. ẳ: 'a',
  2084. ȧ: 'a',
  2085. ǡ: 'a',
  2086. ä: 'a',
  2087. ǟ: 'a',
  2088. ả: 'a',
  2089. å: 'a',
  2090. ǻ: 'a',
  2091. ǎ: 'a',
  2092. ȁ: 'a',
  2093. ȃ: 'a',
  2094. ạ: 'a',
  2095. ậ: 'a',
  2096. ặ: 'a',
  2097. ḁ: 'a',
  2098. ą: 'a',
  2099. ⱥ: 'a',
  2100. ɐ: 'a',
  2101. ꜳ: 'aa',
  2102. æ: 'ae',
  2103. ǽ: 'ae',
  2104. ǣ: 'ae',
  2105. ꜵ: 'ao',
  2106. ꜷ: 'au',
  2107. ꜹ: 'av',
  2108. ꜻ: 'av',
  2109. ꜽ: 'ay',
  2110. 'ⓑ': 'b',
  2111. b: 'b',
  2112. ḃ: 'b',
  2113. ḅ: 'b',
  2114. ḇ: 'b',
  2115. ƀ: 'b',
  2116. ƃ: 'b',
  2117. ɓ: 'b',
  2118. 'ⓒ': 'c',
  2119. c: 'c',
  2120. ć: 'c',
  2121. ĉ: 'c',
  2122. ċ: 'c',
  2123. č: 'c',
  2124. ç: 'c',
  2125. ḉ: 'c',
  2126. ƈ: 'c',
  2127. ȼ: 'c',
  2128. ꜿ: 'c',
  2129. ↄ: 'c',
  2130. 'ⓓ': 'd',
  2131. d: 'd',
  2132. ḋ: 'd',
  2133. ď: 'd',
  2134. ḍ: 'd',
  2135. ḑ: 'd',
  2136. ḓ: 'd',
  2137. ḏ: 'd',
  2138. đ: 'd',
  2139. ƌ: 'd',
  2140. ɖ: 'd',
  2141. ɗ: 'd',
  2142. ꝺ: 'd',
  2143. dz: 'dz',
  2144. dž: 'dz',
  2145. 'ⓔ': 'e',
  2146. e: 'e',
  2147. è: 'e',
  2148. é: 'e',
  2149. ê: 'e',
  2150. ề: 'e',
  2151. ế: 'e',
  2152. ễ: 'e',
  2153. ể: 'e',
  2154. ẽ: 'e',
  2155. ē: 'e',
  2156. ḕ: 'e',
  2157. ḗ: 'e',
  2158. ĕ: 'e',
  2159. ė: 'e',
  2160. ë: 'e',
  2161. ẻ: 'e',
  2162. ě: 'e',
  2163. ȅ: 'e',
  2164. ȇ: 'e',
  2165. ẹ: 'e',
  2166. ệ: 'e',
  2167. ȩ: 'e',
  2168. ḝ: 'e',
  2169. ę: 'e',
  2170. ḙ: 'e',
  2171. ḛ: 'e',
  2172. ɇ: 'e',
  2173. ɛ: 'e',
  2174. ǝ: 'e',
  2175. 'ⓕ': 'f',
  2176. f: 'f',
  2177. ḟ: 'f',
  2178. ƒ: 'f',
  2179. ꝼ: 'f',
  2180. 'ⓖ': 'g',
  2181. g: 'g',
  2182. ǵ: 'g',
  2183. ĝ: 'g',
  2184. ḡ: 'g',
  2185. ğ: 'g',
  2186. ġ: 'g',
  2187. ǧ: 'g',
  2188. ģ: 'g',
  2189. ǥ: 'g',
  2190. ɠ: 'g',
  2191. ꞡ: 'g',
  2192. ᵹ: 'g',
  2193. ꝿ: 'g',
  2194. 'ⓗ': 'h',
  2195. h: 'h',
  2196. ĥ: 'h',
  2197. ḣ: 'h',
  2198. ḧ: 'h',
  2199. ȟ: 'h',
  2200. ḥ: 'h',
  2201. ḩ: 'h',
  2202. ḫ: 'h',
  2203. ẖ: 'h',
  2204. ħ: 'h',
  2205. ⱨ: 'h',
  2206. ⱶ: 'h',
  2207. ɥ: 'h',
  2208. ƕ: 'hv',
  2209. 'ⓘ': 'i',
  2210. i: 'i',
  2211. ì: 'i',
  2212. í: 'i',
  2213. î: 'i',
  2214. ĩ: 'i',
  2215. ī: 'i',
  2216. ĭ: 'i',
  2217. ï: 'i',
  2218. ḯ: 'i',
  2219. ỉ: 'i',
  2220. ǐ: 'i',
  2221. ȉ: 'i',
  2222. ȋ: 'i',
  2223. ị: 'i',
  2224. į: 'i',
  2225. ḭ: 'i',
  2226. ɨ: 'i',
  2227. ı: 'i',
  2228. 'ⓙ': 'j',
  2229. j: 'j',
  2230. ĵ: 'j',
  2231. ǰ: 'j',
  2232. ɉ: 'j',
  2233. 'ⓚ': 'k',
  2234. k: 'k',
  2235. ḱ: 'k',
  2236. ǩ: 'k',
  2237. ḳ: 'k',
  2238. ķ: 'k',
  2239. ḵ: 'k',
  2240. ƙ: 'k',
  2241. ⱪ: 'k',
  2242. ꝁ: 'k',
  2243. ꝃ: 'k',
  2244. ꝅ: 'k',
  2245. ꞣ: 'k',
  2246. 'ⓛ': 'l',
  2247. l: 'l',
  2248. ŀ: 'l',
  2249. ĺ: 'l',
  2250. ľ: 'l',
  2251. ḷ: 'l',
  2252. ḹ: 'l',
  2253. ļ: 'l',
  2254. ḽ: 'l',
  2255. ḻ: 'l',
  2256. ſ: 'l',
  2257. ł: 'l',
  2258. ƚ: 'l',
  2259. ɫ: 'l',
  2260. ⱡ: 'l',
  2261. ꝉ: 'l',
  2262. ꞁ: 'l',
  2263. ꝇ: 'l',
  2264. lj: 'lj',
  2265. 'ⓜ': 'm',
  2266. m: 'm',
  2267. ḿ: 'm',
  2268. ṁ: 'm',
  2269. ṃ: 'm',
  2270. ɱ: 'm',
  2271. ɯ: 'm',
  2272. 'ⓝ': 'n',
  2273. n: 'n',
  2274. ǹ: 'n',
  2275. ń: 'n',
  2276. ñ: 'n',
  2277. ṅ: 'n',
  2278. ň: 'n',
  2279. ṇ: 'n',
  2280. ņ: 'n',
  2281. ṋ: 'n',
  2282. ṉ: 'n',
  2283. ƞ: 'n',
  2284. ɲ: 'n',
  2285. ʼn: 'n',
  2286. ꞑ: 'n',
  2287. ꞥ: 'n',
  2288. nj: 'nj',
  2289. 'ⓞ': 'o',
  2290. o: 'o',
  2291. ò: 'o',
  2292. ó: 'o',
  2293. ô: 'o',
  2294. ồ: 'o',
  2295. ố: 'o',
  2296. ỗ: 'o',
  2297. ổ: 'o',
  2298. õ: 'o',
  2299. ṍ: 'o',
  2300. ȭ: 'o',
  2301. ṏ: 'o',
  2302. ō: 'o',
  2303. ṑ: 'o',
  2304. ṓ: 'o',
  2305. ŏ: 'o',
  2306. ȯ: 'o',
  2307. ȱ: 'o',
  2308. ö: 'o',
  2309. ȫ: 'o',
  2310. ỏ: 'o',
  2311. ő: 'o',
  2312. ǒ: 'o',
  2313. ȍ: 'o',
  2314. ȏ: 'o',
  2315. ơ: 'o',
  2316. ờ: 'o',
  2317. ớ: 'o',
  2318. ỡ: 'o',
  2319. ở: 'o',
  2320. ợ: 'o',
  2321. ọ: 'o',
  2322. ộ: 'o',
  2323. ǫ: 'o',
  2324. ǭ: 'o',
  2325. ø: 'o',
  2326. ǿ: 'o',
  2327. ɔ: 'o',
  2328. ꝋ: 'o',
  2329. ꝍ: 'o',
  2330. ɵ: 'o',
  2331. œ: 'oe',
  2332. ƣ: 'oi',
  2333. ȣ: 'ou',
  2334. ꝏ: 'oo',
  2335. 'ⓟ': 'p',
  2336. p: 'p',
  2337. ṕ: 'p',
  2338. ṗ: 'p',
  2339. ƥ: 'p',
  2340. ᵽ: 'p',
  2341. ꝑ: 'p',
  2342. ꝓ: 'p',
  2343. ꝕ: 'p',
  2344. 'ⓠ': 'q',
  2345. q: 'q',
  2346. ɋ: 'q',
  2347. ꝗ: 'q',
  2348. ꝙ: 'q',
  2349. 'ⓡ': 'r',
  2350. r: 'r',
  2351. ŕ: 'r',
  2352. ṙ: 'r',
  2353. ř: 'r',
  2354. ȑ: 'r',
  2355. ȓ: 'r',
  2356. ṛ: 'r',
  2357. ṝ: 'r',
  2358. ŗ: 'r',
  2359. ṟ: 'r',
  2360. ɍ: 'r',
  2361. ɽ: 'r',
  2362. ꝛ: 'r',
  2363. ꞧ: 'r',
  2364. ꞃ: 'r',
  2365. 'ⓢ': 's',
  2366. s: 's',
  2367. ß: 's',
  2368. ś: 's',
  2369. ṥ: 's',
  2370. ŝ: 's',
  2371. ṡ: 's',
  2372. š: 's',
  2373. ṧ: 's',
  2374. ṣ: 's',
  2375. ṩ: 's',
  2376. ș: 's',
  2377. ş: 's',
  2378. ȿ: 's',
  2379. ꞩ: 's',
  2380. ꞅ: 's',
  2381. ẛ: 's',
  2382. 'ⓣ': 't',
  2383. t: 't',
  2384. ṫ: 't',
  2385. ẗ: 't',
  2386. ť: 't',
  2387. ṭ: 't',
  2388. ț: 't',
  2389. ţ: 't',
  2390. ṱ: 't',
  2391. ṯ: 't',
  2392. ŧ: 't',
  2393. ƭ: 't',
  2394. ʈ: 't',
  2395. ⱦ: 't',
  2396. ꞇ: 't',
  2397. ꜩ: 'tz',
  2398. 'ⓤ': 'u',
  2399. u: 'u',
  2400. ù: 'u',
  2401. ú: 'u',
  2402. û: 'u',
  2403. ũ: 'u',
  2404. ṹ: 'u',
  2405. ū: 'u',
  2406. ṻ: 'u',
  2407. ŭ: 'u',
  2408. ü: 'u',
  2409. ǜ: 'u',
  2410. ǘ: 'u',
  2411. ǖ: 'u',
  2412. ǚ: 'u',
  2413. ủ: 'u',
  2414. ů: 'u',
  2415. ű: 'u',
  2416. ǔ: 'u',
  2417. ȕ: 'u',
  2418. ȗ: 'u',
  2419. ư: 'u',
  2420. ừ: 'u',
  2421. ứ: 'u',
  2422. ữ: 'u',
  2423. ử: 'u',
  2424. ự: 'u',
  2425. ụ: 'u',
  2426. ṳ: 'u',
  2427. ų: 'u',
  2428. ṷ: 'u',
  2429. ṵ: 'u',
  2430. ʉ: 'u',
  2431. 'ⓥ': 'v',
  2432. v: 'v',
  2433. ṽ: 'v',
  2434. ṿ: 'v',
  2435. ʋ: 'v',
  2436. ꝟ: 'v',
  2437. ʌ: 'v',
  2438. ꝡ: 'vy',
  2439. 'ⓦ': 'w',
  2440. w: 'w',
  2441. ẁ: 'w',
  2442. ẃ: 'w',
  2443. ŵ: 'w',
  2444. ẇ: 'w',
  2445. ẅ: 'w',
  2446. ẘ: 'w',
  2447. ẉ: 'w',
  2448. ⱳ: 'w',
  2449. 'ⓧ': 'x',
  2450. x: 'x',
  2451. ẋ: 'x',
  2452. ẍ: 'x',
  2453. 'ⓨ': 'y',
  2454. y: 'y',
  2455. ỳ: 'y',
  2456. ý: 'y',
  2457. ŷ: 'y',
  2458. ỹ: 'y',
  2459. ȳ: 'y',
  2460. ẏ: 'y',
  2461. ÿ: 'y',
  2462. ỷ: 'y',
  2463. ẙ: 'y',
  2464. ỵ: 'y',
  2465. ƴ: 'y',
  2466. ɏ: 'y',
  2467. ỿ: 'y',
  2468. 'ⓩ': 'z',
  2469. z: 'z',
  2470. ź: 'z',
  2471. ẑ: 'z',
  2472. ż: 'z',
  2473. ž: 'z',
  2474. ẓ: 'z',
  2475. ẕ: 'z',
  2476. ƶ: 'z',
  2477. ȥ: 'z',
  2478. ɀ: 'z',
  2479. ⱬ: 'z',
  2480. ꝣ: 'z',
  2481. Ά: 'Α',
  2482. Έ: 'Ε',
  2483. Ή: 'Η',
  2484. Ί: 'Ι',
  2485. Ϊ: 'Ι',
  2486. Ό: 'Ο',
  2487. Ύ: 'Υ',
  2488. Ϋ: 'Υ',
  2489. Ώ: 'Ω',
  2490. ά: 'α',
  2491. έ: 'ε',
  2492. ή: 'η',
  2493. ί: 'ι',
  2494. ϊ: 'ι',
  2495. ΐ: 'ι',
  2496. ό: 'ο',
  2497. ύ: 'υ',
  2498. ϋ: 'υ',
  2499. ΰ: 'υ',
  2500. ώ: 'ω',
  2501. ς: 'σ',
  2502. '’': "'",
  2503. };
  2504. } ),
  2505. u.define( 'select2/data/base', [ '../utils' ], function ( n ) {
  2506. function s( e, t ) {
  2507. s.__super__.constructor.call( this );
  2508. }
  2509. return (
  2510. n.Extend( s, n.Observable ),
  2511. ( s.prototype.current = function ( e ) {
  2512. throw new Error(
  2513. 'The `current` method must be defined in child classes.'
  2514. );
  2515. } ),
  2516. ( s.prototype.query = function ( e, t ) {
  2517. throw new Error(
  2518. 'The `query` method must be defined in child classes.'
  2519. );
  2520. } ),
  2521. ( s.prototype.bind = function ( e, t ) {} ),
  2522. ( s.prototype.destroy = function () {} ),
  2523. ( s.prototype.generateResultId = function ( e, t ) {
  2524. e = e.id + '-result-';
  2525. return (
  2526. ( e += n.generateChars( 4 ) ),
  2527. null != t.id
  2528. ? ( e += '-' + t.id.toString() )
  2529. : ( e += '-' + n.generateChars( 4 ) ),
  2530. e
  2531. );
  2532. } ),
  2533. s
  2534. );
  2535. } ),
  2536. u.define(
  2537. 'select2/data/select',
  2538. [ './base', '../utils', 'jquery' ],
  2539. function ( e, a, l ) {
  2540. function n( e, t ) {
  2541. ( this.$element = e ),
  2542. ( this.options = t ),
  2543. n.__super__.constructor.call( this );
  2544. }
  2545. return (
  2546. a.Extend( n, e ),
  2547. ( n.prototype.current = function ( e ) {
  2548. var t = this;
  2549. e(
  2550. Array.prototype.map.call(
  2551. this.$element[ 0 ].querySelectorAll(
  2552. ':checked'
  2553. ),
  2554. function ( e ) {
  2555. return t.item( l( e ) );
  2556. }
  2557. )
  2558. );
  2559. } ),
  2560. ( n.prototype.select = function ( i ) {
  2561. var e,
  2562. r = this;
  2563. if (
  2564. ( ( i.selected = ! 0 ),
  2565. null != i.element &&
  2566. 'option' ===
  2567. i.element.tagName.toLowerCase() )
  2568. )
  2569. return (
  2570. ( i.element.selected = ! 0 ),
  2571. void this.$element
  2572. .trigger( 'input' )
  2573. .trigger( 'change' )
  2574. );
  2575. this.$element.prop( 'multiple' )
  2576. ? this.current( function ( e ) {
  2577. var t = [];
  2578. ( i = [ i ] ).push.apply( i, e );
  2579. for ( var n = 0; n < i.length; n++ ) {
  2580. var s = i[ n ].id;
  2581. -1 === t.indexOf( s ) &&
  2582. t.push( s );
  2583. }
  2584. r.$element.val( t ),
  2585. r.$element
  2586. .trigger( 'input' )
  2587. .trigger( 'change' );
  2588. } )
  2589. : ( ( e = i.id ),
  2590. this.$element.val( e ),
  2591. this.$element
  2592. .trigger( 'input' )
  2593. .trigger( 'change' ) );
  2594. } ),
  2595. ( n.prototype.unselect = function ( i ) {
  2596. var r = this;
  2597. if ( this.$element.prop( 'multiple' ) ) {
  2598. if (
  2599. ( ( i.selected = ! 1 ),
  2600. null != i.element &&
  2601. 'option' ===
  2602. i.element.tagName.toLowerCase() )
  2603. )
  2604. return (
  2605. ( i.element.selected = ! 1 ),
  2606. void this.$element
  2607. .trigger( 'input' )
  2608. .trigger( 'change' )
  2609. );
  2610. this.current( function ( e ) {
  2611. for (
  2612. var t = [], n = 0;
  2613. n < e.length;
  2614. n++
  2615. ) {
  2616. var s = e[ n ].id;
  2617. s !== i.id &&
  2618. -1 === t.indexOf( s ) &&
  2619. t.push( s );
  2620. }
  2621. r.$element.val( t ),
  2622. r.$element
  2623. .trigger( 'input' )
  2624. .trigger( 'change' );
  2625. } );
  2626. }
  2627. } ),
  2628. ( n.prototype.bind = function ( e, t ) {
  2629. var n = this;
  2630. ( this.container = e ).on(
  2631. 'select',
  2632. function ( e ) {
  2633. n.select( e.data );
  2634. }
  2635. ),
  2636. e.on( 'unselect', function ( e ) {
  2637. n.unselect( e.data );
  2638. } );
  2639. } ),
  2640. ( n.prototype.destroy = function () {
  2641. this.$element.find( '*' ).each( function () {
  2642. a.RemoveData( this );
  2643. } );
  2644. } ),
  2645. ( n.prototype.query = function ( t, e ) {
  2646. var n = [],
  2647. s = this;
  2648. this.$element.children().each( function () {
  2649. var e;
  2650. ( 'option' !== this.tagName.toLowerCase() &&
  2651. 'optgroup' !==
  2652. this.tagName.toLowerCase() ) ||
  2653. ( ( e = l( this ) ),
  2654. ( e = s.item( e ) ),
  2655. null !== ( e = s.matches( t, e ) ) &&
  2656. n.push( e ) );
  2657. } ),
  2658. e( { results: n } );
  2659. } ),
  2660. ( n.prototype.addOptions = function ( e ) {
  2661. this.$element.append( e );
  2662. } ),
  2663. ( n.prototype.option = function ( e ) {
  2664. var t;
  2665. e.children
  2666. ? ( ( t = document.createElement(
  2667. 'optgroup'
  2668. ) ).label = e.text )
  2669. : void 0 !==
  2670. ( t = document.createElement( 'option' ) )
  2671. .textContent
  2672. ? ( t.textContent = e.text )
  2673. : ( t.innerText = e.text ),
  2674. void 0 !== e.id && ( t.value = e.id ),
  2675. e.disabled && ( t.disabled = ! 0 ),
  2676. e.selected && ( t.selected = ! 0 ),
  2677. e.title && ( t.title = e.title );
  2678. e = this._normalizeItem( e );
  2679. return (
  2680. ( e.element = t ),
  2681. a.StoreData( t, 'data', e ),
  2682. l( t )
  2683. );
  2684. } ),
  2685. ( n.prototype.item = function ( e ) {
  2686. var t = {};
  2687. if ( null != ( t = a.GetData( e[ 0 ], 'data' ) ) )
  2688. return t;
  2689. var n = e[ 0 ];
  2690. if ( 'option' === n.tagName.toLowerCase() )
  2691. t = {
  2692. id: e.val(),
  2693. text: e.text(),
  2694. disabled: e.prop( 'disabled' ),
  2695. selected: e.prop( 'selected' ),
  2696. title: e.prop( 'title' ),
  2697. };
  2698. else if ( 'optgroup' === n.tagName.toLowerCase() ) {
  2699. t = {
  2700. text: e.prop( 'label' ),
  2701. children: [],
  2702. title: e.prop( 'title' ),
  2703. };
  2704. for (
  2705. var s = e.children( 'option' ),
  2706. i = [],
  2707. r = 0;
  2708. r < s.length;
  2709. r++
  2710. ) {
  2711. var o = l( s[ r ] ),
  2712. o = this.item( o );
  2713. i.push( o );
  2714. }
  2715. t.children = i;
  2716. }
  2717. return (
  2718. ( ( t = this._normalizeItem( t ) ).element =
  2719. e[ 0 ] ),
  2720. a.StoreData( e[ 0 ], 'data', t ),
  2721. t
  2722. );
  2723. } ),
  2724. ( n.prototype._normalizeItem = function ( e ) {
  2725. e !== Object( e ) && ( e = { id: e, text: e } );
  2726. return (
  2727. null !=
  2728. ( e = l.extend( {}, { text: '' }, e ) )
  2729. .id && ( e.id = e.id.toString() ),
  2730. null != e.text &&
  2731. ( e.text = e.text.toString() ),
  2732. null == e._resultId &&
  2733. e.id &&
  2734. null != this.container &&
  2735. ( e._resultId = this.generateResultId(
  2736. this.container,
  2737. e
  2738. ) ),
  2739. l.extend(
  2740. {},
  2741. { selected: ! 1, disabled: ! 1 },
  2742. e
  2743. )
  2744. );
  2745. } ),
  2746. ( n.prototype.matches = function ( e, t ) {
  2747. return this.options.get( 'matcher' )( e, t );
  2748. } ),
  2749. n
  2750. );
  2751. }
  2752. ),
  2753. u.define(
  2754. 'select2/data/array',
  2755. [ './select', '../utils', 'jquery' ],
  2756. function ( e, t, c ) {
  2757. function s( e, t ) {
  2758. ( this._dataToConvert = t.get( 'data' ) || [] ),
  2759. s.__super__.constructor.call( this, e, t );
  2760. }
  2761. return (
  2762. t.Extend( s, e ),
  2763. ( s.prototype.bind = function ( e, t ) {
  2764. s.__super__.bind.call( this, e, t ),
  2765. this.addOptions(
  2766. this.convertToOptions( this._dataToConvert )
  2767. );
  2768. } ),
  2769. ( s.prototype.select = function ( n ) {
  2770. var e = this.$element
  2771. .find( 'option' )
  2772. .filter( function ( e, t ) {
  2773. return t.value == n.id.toString();
  2774. } );
  2775. 0 === e.length &&
  2776. ( ( e = this.option( n ) ),
  2777. this.addOptions( e ) ),
  2778. s.__super__.select.call( this, n );
  2779. } ),
  2780. ( s.prototype.convertToOptions = function ( e ) {
  2781. var t = this,
  2782. n = this.$element.find( 'option' ),
  2783. s = n
  2784. .map( function () {
  2785. return t.item( c( this ) ).id;
  2786. } )
  2787. .get(),
  2788. i = [];
  2789. for ( var r = 0; r < e.length; r++ ) {
  2790. var o,
  2791. a,
  2792. l = this._normalizeItem( e[ r ] );
  2793. 0 <= s.indexOf( l.id )
  2794. ? ( ( o = n.filter(
  2795. ( function ( e ) {
  2796. return function () {
  2797. return (
  2798. c( this ).val() == e.id
  2799. );
  2800. };
  2801. } )( l )
  2802. ) ),
  2803. ( a = this.item( o ) ),
  2804. ( a = c.extend( ! 0, {}, l, a ) ),
  2805. ( a = this.option( a ) ),
  2806. o.replaceWith( a ) )
  2807. : ( ( a = this.option( l ) ),
  2808. l.children &&
  2809. ( ( l = this.convertToOptions(
  2810. l.children
  2811. ) ),
  2812. a.append( l ) ),
  2813. i.push( a ) );
  2814. }
  2815. return i;
  2816. } ),
  2817. s
  2818. );
  2819. }
  2820. ),
  2821. u.define(
  2822. 'select2/data/ajax',
  2823. [ './array', '../utils', 'jquery' ],
  2824. function ( e, t, r ) {
  2825. function n( e, t ) {
  2826. ( this.ajaxOptions = this._applyDefaults(
  2827. t.get( 'ajax' )
  2828. ) ),
  2829. null != this.ajaxOptions.processResults &&
  2830. ( this.processResults = this.ajaxOptions.processResults ),
  2831. n.__super__.constructor.call( this, e, t );
  2832. }
  2833. return (
  2834. t.Extend( n, e ),
  2835. ( n.prototype._applyDefaults = function ( e ) {
  2836. var t = {
  2837. data: function ( e ) {
  2838. return r.extend( {}, e, { q: e.term } );
  2839. },
  2840. transport: function ( e, t, n ) {
  2841. e = r.ajax( e );
  2842. return e.then( t ), e.fail( n ), e;
  2843. },
  2844. };
  2845. return r.extend( {}, t, e, ! 0 );
  2846. } ),
  2847. ( n.prototype.processResults = function ( e ) {
  2848. return e;
  2849. } ),
  2850. ( n.prototype.query = function ( t, n ) {
  2851. var s = this;
  2852. null != this._request &&
  2853. ( 'function' == typeof this._request.abort &&
  2854. this._request.abort(),
  2855. ( this._request = null ) );
  2856. var i = r.extend(
  2857. { type: 'GET' },
  2858. this.ajaxOptions
  2859. );
  2860. function e() {
  2861. var e = i.transport(
  2862. i,
  2863. function ( e ) {
  2864. e = s.processResults( e, t );
  2865. s.options.get( 'debug' ) &&
  2866. window.console &&
  2867. console.error &&
  2868. ( ( e &&
  2869. e.results &&
  2870. Array.isArray( e.results ) ) ||
  2871. console.error(
  2872. 'Select2: The AJAX results did not return an array in the `results` key of the response.'
  2873. ) ),
  2874. n( e );
  2875. },
  2876. function () {
  2877. ( 'status' in e &&
  2878. ( 0 === e.status ||
  2879. '0' === e.status ) ) ||
  2880. s.trigger( 'results:message', {
  2881. message: 'errorLoading',
  2882. } );
  2883. }
  2884. );
  2885. s._request = e;
  2886. }
  2887. 'function' == typeof i.url &&
  2888. ( i.url = i.url.call( this.$element, t ) ),
  2889. 'function' == typeof i.data &&
  2890. ( i.data = i.data.call(
  2891. this.$element,
  2892. t
  2893. ) ),
  2894. this.ajaxOptions.delay && null != t.term
  2895. ? ( this._queryTimeout &&
  2896. window.clearTimeout(
  2897. this._queryTimeout
  2898. ),
  2899. ( this._queryTimeout = window.setTimeout(
  2900. e,
  2901. this.ajaxOptions.delay
  2902. ) ) )
  2903. : e();
  2904. } ),
  2905. n
  2906. );
  2907. }
  2908. ),
  2909. u.define( 'select2/data/tags', [ 'jquery' ], function ( t ) {
  2910. function e( e, t, n ) {
  2911. var s = n.get( 'tags' ),
  2912. i = n.get( 'createTag' );
  2913. void 0 !== i && ( this.createTag = i );
  2914. i = n.get( 'insertTag' );
  2915. if (
  2916. ( void 0 !== i && ( this.insertTag = i ),
  2917. e.call( this, t, n ),
  2918. Array.isArray( s ) )
  2919. )
  2920. for ( var r = 0; r < s.length; r++ ) {
  2921. var o = s[ r ],
  2922. o = this._normalizeItem( o ),
  2923. o = this.option( o );
  2924. this.$element.append( o );
  2925. }
  2926. }
  2927. return (
  2928. ( e.prototype.query = function ( e, c, u ) {
  2929. var d = this;
  2930. this._removeOldTags(),
  2931. null != c.term && null == c.page
  2932. ? e.call( this, c, function e( t, n ) {
  2933. for (
  2934. var s = t.results, i = 0;
  2935. i < s.length;
  2936. i++
  2937. ) {
  2938. var r = s[ i ],
  2939. o =
  2940. null != r.children &&
  2941. ! e(
  2942. { results: r.children },
  2943. ! 0
  2944. );
  2945. if (
  2946. (
  2947. r.text || ''
  2948. ).toUpperCase() ===
  2949. (
  2950. c.term || ''
  2951. ).toUpperCase() ||
  2952. o
  2953. )
  2954. return (
  2955. ! n &&
  2956. ( ( t.data = s ),
  2957. void u( t ) )
  2958. );
  2959. }
  2960. if ( n ) return ! 0;
  2961. var a,
  2962. l = d.createTag( c );
  2963. null != l &&
  2964. ( ( a = d.option( l ) ).attr(
  2965. 'data-select2-tag',
  2966. 'true'
  2967. ),
  2968. d.addOptions( [ a ] ),
  2969. d.insertTag( s, l ) ),
  2970. ( t.results = s ),
  2971. u( t );
  2972. } )
  2973. : e.call( this, c, u );
  2974. } ),
  2975. ( e.prototype.createTag = function ( e, t ) {
  2976. if ( null == t.term ) return null;
  2977. t = t.term.trim();
  2978. return '' === t ? null : { id: t, text: t };
  2979. } ),
  2980. ( e.prototype.insertTag = function ( e, t, n ) {
  2981. t.unshift( n );
  2982. } ),
  2983. ( e.prototype._removeOldTags = function ( e ) {
  2984. this.$element
  2985. .find( 'option[data-select2-tag]' )
  2986. .each( function () {
  2987. this.selected || t( this ).remove();
  2988. } );
  2989. } ),
  2990. e
  2991. );
  2992. } ),
  2993. u.define( 'select2/data/tokenizer', [ 'jquery' ], function ( c ) {
  2994. function e( e, t, n ) {
  2995. var s = n.get( 'tokenizer' );
  2996. void 0 !== s && ( this.tokenizer = s ),
  2997. e.call( this, t, n );
  2998. }
  2999. return (
  3000. ( e.prototype.bind = function ( e, t, n ) {
  3001. e.call( this, t, n ),
  3002. ( this.$search =
  3003. t.dropdown.$search ||
  3004. t.selection.$search ||
  3005. n.find( '.select2-search__field' ) );
  3006. } ),
  3007. ( e.prototype.query = function ( e, t, n ) {
  3008. var s = this;
  3009. t.term = t.term || '';
  3010. var i = this.tokenizer(
  3011. t,
  3012. this.options,
  3013. function ( e ) {
  3014. var t,
  3015. n = s._normalizeItem( e );
  3016. s.$element
  3017. .find( 'option' )
  3018. .filter( function () {
  3019. return c( this ).val() === n.id;
  3020. } ).length ||
  3021. ( ( t = s.option( n ) ).attr(
  3022. 'data-select2-tag',
  3023. ! 0
  3024. ),
  3025. s._removeOldTags(),
  3026. s.addOptions( [ t ] ) ),
  3027. ( t = n ),
  3028. s.trigger( 'select', { data: t } );
  3029. }
  3030. );
  3031. i.term !== t.term &&
  3032. ( this.$search.length &&
  3033. ( this.$search.val( i.term ),
  3034. this.$search.trigger( 'focus' ) ),
  3035. ( t.term = i.term ) ),
  3036. e.call( this, t, n );
  3037. } ),
  3038. ( e.prototype.tokenizer = function ( e, t, n, s ) {
  3039. for (
  3040. var i = n.get( 'tokenSeparators' ) || [],
  3041. r = t.term,
  3042. o = 0,
  3043. a =
  3044. this.createTag ||
  3045. function ( e ) {
  3046. return { id: e.term, text: e.term };
  3047. };
  3048. o < r.length;
  3049. ) {
  3050. var l = r[ o ];
  3051. -1 !== i.indexOf( l )
  3052. ? ( ( l = r.substr( 0, o ) ),
  3053. null !=
  3054. ( l = a( c.extend( {}, t, { term: l } ) ) )
  3055. ? ( s( l ),
  3056. ( r = r.substr( o + 1 ) || '' ),
  3057. ( o = 0 ) )
  3058. : o++ )
  3059. : o++;
  3060. }
  3061. return { term: r };
  3062. } ),
  3063. e
  3064. );
  3065. } ),
  3066. u.define( 'select2/data/minimumInputLength', [], function () {
  3067. function e( e, t, n ) {
  3068. ( this.minimumInputLength = n.get( 'minimumInputLength' ) ),
  3069. e.call( this, t, n );
  3070. }
  3071. return (
  3072. ( e.prototype.query = function ( e, t, n ) {
  3073. ( t.term = t.term || '' ),
  3074. t.term.length < this.minimumInputLength
  3075. ? this.trigger( 'results:message', {
  3076. message: 'inputTooShort',
  3077. args: {
  3078. minimum: this.minimumInputLength,
  3079. input: t.term,
  3080. params: t,
  3081. },
  3082. } )
  3083. : e.call( this, t, n );
  3084. } ),
  3085. e
  3086. );
  3087. } ),
  3088. u.define( 'select2/data/maximumInputLength', [], function () {
  3089. function e( e, t, n ) {
  3090. ( this.maximumInputLength = n.get( 'maximumInputLength' ) ),
  3091. e.call( this, t, n );
  3092. }
  3093. return (
  3094. ( e.prototype.query = function ( e, t, n ) {
  3095. ( t.term = t.term || '' ),
  3096. 0 < this.maximumInputLength &&
  3097. t.term.length > this.maximumInputLength
  3098. ? this.trigger( 'results:message', {
  3099. message: 'inputTooLong',
  3100. args: {
  3101. maximum: this.maximumInputLength,
  3102. input: t.term,
  3103. params: t,
  3104. },
  3105. } )
  3106. : e.call( this, t, n );
  3107. } ),
  3108. e
  3109. );
  3110. } ),
  3111. u.define( 'select2/data/maximumSelectionLength', [], function () {
  3112. function e( e, t, n ) {
  3113. ( this.maximumSelectionLength = n.get(
  3114. 'maximumSelectionLength'
  3115. ) ),
  3116. e.call( this, t, n );
  3117. }
  3118. return (
  3119. ( e.prototype.bind = function ( e, t, n ) {
  3120. var s = this;
  3121. e.call( this, t, n ),
  3122. t.on( 'select', function () {
  3123. s._checkIfMaximumSelected();
  3124. } );
  3125. } ),
  3126. ( e.prototype.query = function ( e, t, n ) {
  3127. var s = this;
  3128. this._checkIfMaximumSelected( function () {
  3129. e.call( s, t, n );
  3130. } );
  3131. } ),
  3132. ( e.prototype._checkIfMaximumSelected = function ( e, t ) {
  3133. var n = this;
  3134. this.current( function ( e ) {
  3135. e = null != e ? e.length : 0;
  3136. 0 < n.maximumSelectionLength &&
  3137. e >= n.maximumSelectionLength
  3138. ? n.trigger( 'results:message', {
  3139. message: 'maximumSelected',
  3140. args: {
  3141. maximum: n.maximumSelectionLength,
  3142. },
  3143. } )
  3144. : t && t();
  3145. } );
  3146. } ),
  3147. e
  3148. );
  3149. } ),
  3150. u.define(
  3151. 'select2/dropdown',
  3152. [ 'jquery', './utils' ],
  3153. function ( t, e ) {
  3154. function n( e, t ) {
  3155. ( this.$element = e ),
  3156. ( this.options = t ),
  3157. n.__super__.constructor.call( this );
  3158. }
  3159. return (
  3160. e.Extend( n, e.Observable ),
  3161. ( n.prototype.render = function () {
  3162. var e = t(
  3163. '<span class="select2-dropdown"><span class="select2-results"></span></span>'
  3164. );
  3165. return (
  3166. e.attr( 'dir', this.options.get( 'dir' ) ),
  3167. ( this.$dropdown = e )
  3168. );
  3169. } ),
  3170. ( n.prototype.bind = function () {} ),
  3171. ( n.prototype.position = function ( e, t ) {} ),
  3172. ( n.prototype.destroy = function () {
  3173. this.$dropdown.remove();
  3174. } ),
  3175. n
  3176. );
  3177. }
  3178. ),
  3179. u.define( 'select2/dropdown/search', [ 'jquery' ], function ( r ) {
  3180. function e() {}
  3181. return (
  3182. ( e.prototype.render = function ( e ) {
  3183. var t = e.call( this ),
  3184. n = this.options
  3185. .get( 'translations' )
  3186. .get( 'search' ),
  3187. e = r(
  3188. '<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>'
  3189. );
  3190. return (
  3191. ( this.$searchContainer = e ),
  3192. ( this.$search = e.find( 'input' ) ),
  3193. this.$search.prop(
  3194. 'autocomplete',
  3195. this.options.get( 'autocomplete' )
  3196. ),
  3197. this.$search.attr( 'aria-label', n() ),
  3198. t.prepend( e ),
  3199. t
  3200. );
  3201. } ),
  3202. ( e.prototype.bind = function ( e, t, n ) {
  3203. var s = this,
  3204. i = t.id + '-results';
  3205. e.call( this, t, n ),
  3206. this.$search.on( 'keydown', function ( e ) {
  3207. s.trigger( 'keypress', e ),
  3208. ( s._keyUpPrevented = e.isDefaultPrevented() );
  3209. } ),
  3210. this.$search.on( 'input', function ( e ) {
  3211. r( this ).off( 'keyup' );
  3212. } ),
  3213. this.$search.on( 'keyup input', function ( e ) {
  3214. s.handleSearch( e );
  3215. } ),
  3216. t.on( 'open', function () {
  3217. s.$search.attr( 'tabindex', 0 ),
  3218. s.$search.attr( 'aria-controls', i ),
  3219. s.$search.trigger( 'focus' ),
  3220. window.setTimeout( function () {
  3221. s.$search.trigger( 'focus' );
  3222. }, 0 );
  3223. } ),
  3224. t.on( 'close', function () {
  3225. s.$search.attr( 'tabindex', -1 ),
  3226. s.$search.removeAttr( 'aria-controls' ),
  3227. s.$search.removeAttr(
  3228. 'aria-activedescendant'
  3229. ),
  3230. s.$search.val( '' ),
  3231. s.$search.trigger( 'blur' );
  3232. } ),
  3233. t.on( 'focus', function () {
  3234. t.isOpen() || s.$search.trigger( 'focus' );
  3235. } ),
  3236. t.on( 'results:all', function ( e ) {
  3237. ( null != e.query.term &&
  3238. '' !== e.query.term ) ||
  3239. ( s.showSearch( e )
  3240. ? s.$searchContainer[ 0 ].classList.remove(
  3241. 'select2-search--hide'
  3242. )
  3243. : s.$searchContainer[ 0 ].classList.add(
  3244. 'select2-search--hide'
  3245. ) );
  3246. } ),
  3247. t.on( 'results:focus', function ( e ) {
  3248. e.data._resultId
  3249. ? s.$search.attr(
  3250. 'aria-activedescendant',
  3251. e.data._resultId
  3252. )
  3253. : s.$search.removeAttr(
  3254. 'aria-activedescendant'
  3255. );
  3256. } );
  3257. } ),
  3258. ( e.prototype.handleSearch = function ( e ) {
  3259. var t;
  3260. this._keyUpPrevented ||
  3261. ( ( t = this.$search.val() ),
  3262. this.trigger( 'query', { term: t } ) ),
  3263. ( this._keyUpPrevented = ! 1 );
  3264. } ),
  3265. ( e.prototype.showSearch = function ( e, t ) {
  3266. return ! 0;
  3267. } ),
  3268. e
  3269. );
  3270. } ),
  3271. u.define( 'select2/dropdown/hidePlaceholder', [], function () {
  3272. function e( e, t, n, s ) {
  3273. ( this.placeholder = this.normalizePlaceholder(
  3274. n.get( 'placeholder' )
  3275. ) ),
  3276. e.call( this, t, n, s );
  3277. }
  3278. return (
  3279. ( e.prototype.append = function ( e, t ) {
  3280. ( t.results = this.removePlaceholder( t.results ) ),
  3281. e.call( this, t );
  3282. } ),
  3283. ( e.prototype.normalizePlaceholder = function ( e, t ) {
  3284. return (
  3285. 'string' == typeof t && ( t = { id: '', text: t } ),
  3286. t
  3287. );
  3288. } ),
  3289. ( e.prototype.removePlaceholder = function ( e, t ) {
  3290. for (
  3291. var n = t.slice( 0 ), s = t.length - 1;
  3292. 0 <= s;
  3293. s--
  3294. ) {
  3295. var i = t[ s ];
  3296. this.placeholder.id === i.id && n.splice( s, 1 );
  3297. }
  3298. return n;
  3299. } ),
  3300. e
  3301. );
  3302. } ),
  3303. u.define(
  3304. 'select2/dropdown/infiniteScroll',
  3305. [ 'jquery' ],
  3306. function ( n ) {
  3307. function e( e, t, n, s ) {
  3308. ( this.lastParams = {} ),
  3309. e.call( this, t, n, s ),
  3310. ( this.$loadingMore = this.createLoadingMore() ),
  3311. ( this.loading = ! 1 );
  3312. }
  3313. return (
  3314. ( e.prototype.append = function ( e, t ) {
  3315. this.$loadingMore.remove(),
  3316. ( this.loading = ! 1 ),
  3317. e.call( this, t ),
  3318. this.showLoadingMore( t ) &&
  3319. ( this.$results.append( this.$loadingMore ),
  3320. this.loadMoreIfNeeded() );
  3321. } ),
  3322. ( e.prototype.bind = function ( e, t, n ) {
  3323. var s = this;
  3324. e.call( this, t, n ),
  3325. t.on( 'query', function ( e ) {
  3326. ( s.lastParams = e ), ( s.loading = ! 0 );
  3327. } ),
  3328. t.on( 'query:append', function ( e ) {
  3329. ( s.lastParams = e ), ( s.loading = ! 0 );
  3330. } ),
  3331. this.$results.on(
  3332. 'scroll',
  3333. this.loadMoreIfNeeded.bind( this )
  3334. );
  3335. } ),
  3336. ( e.prototype.loadMoreIfNeeded = function () {
  3337. var e = n.contains(
  3338. document.documentElement,
  3339. this.$loadingMore[ 0 ]
  3340. );
  3341. ! this.loading &&
  3342. e &&
  3343. ( ( e =
  3344. this.$results.offset().top +
  3345. this.$results.outerHeight( ! 1 ) ),
  3346. this.$loadingMore.offset().top +
  3347. this.$loadingMore.outerHeight( ! 1 ) <=
  3348. e + 50 && this.loadMore() );
  3349. } ),
  3350. ( e.prototype.loadMore = function () {
  3351. this.loading = ! 0;
  3352. var e = n.extend(
  3353. {},
  3354. { page: 1 },
  3355. this.lastParams
  3356. );
  3357. e.page++, this.trigger( 'query:append', e );
  3358. } ),
  3359. ( e.prototype.showLoadingMore = function ( e, t ) {
  3360. return t.pagination && t.pagination.more;
  3361. } ),
  3362. ( e.prototype.createLoadingMore = function () {
  3363. var e = n(
  3364. '<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'
  3365. ),
  3366. t = this.options
  3367. .get( 'translations' )
  3368. .get( 'loadingMore' );
  3369. return e.html( t( this.lastParams ) ), e;
  3370. } ),
  3371. e
  3372. );
  3373. }
  3374. ),
  3375. u.define(
  3376. 'select2/dropdown/attachBody',
  3377. [ 'jquery', '../utils' ],
  3378. function ( u, o ) {
  3379. function e( e, t, n ) {
  3380. ( this.$dropdownParent = u(
  3381. n.get( 'dropdownParent' ) || document.body
  3382. ) ),
  3383. e.call( this, t, n );
  3384. }
  3385. return (
  3386. ( e.prototype.bind = function ( e, t, n ) {
  3387. var s = this;
  3388. e.call( this, t, n ),
  3389. t.on( 'open', function () {
  3390. s._showDropdown(),
  3391. s._attachPositioningHandler( t ),
  3392. s._bindContainerResultHandlers( t );
  3393. } ),
  3394. t.on( 'close', function () {
  3395. s._hideDropdown(),
  3396. s._detachPositioningHandler( t );
  3397. } ),
  3398. this.$dropdownContainer.on(
  3399. 'mousedown',
  3400. function ( e ) {
  3401. e.stopPropagation();
  3402. }
  3403. );
  3404. } ),
  3405. ( e.prototype.destroy = function ( e ) {
  3406. e.call( this ), this.$dropdownContainer.remove();
  3407. } ),
  3408. ( e.prototype.position = function ( e, t, n ) {
  3409. t.attr( 'class', n.attr( 'class' ) ),
  3410. t[ 0 ].classList.remove( 'select2' ),
  3411. t[ 0 ].classList.add(
  3412. 'select2-container--open'
  3413. ),
  3414. t.css( { position: 'absolute', top: -999999 } ),
  3415. ( this.$container = n );
  3416. } ),
  3417. ( e.prototype.render = function ( e ) {
  3418. var t = u( '<span></span>' ),
  3419. e = e.call( this );
  3420. return (
  3421. t.append( e ), ( this.$dropdownContainer = t )
  3422. );
  3423. } ),
  3424. ( e.prototype._hideDropdown = function ( e ) {
  3425. this.$dropdownContainer.detach();
  3426. } ),
  3427. ( e.prototype._bindContainerResultHandlers = function (
  3428. e,
  3429. t
  3430. ) {
  3431. var n;
  3432. this._containerResultsHandlersBound ||
  3433. ( ( n = this ),
  3434. t.on( 'results:all', function () {
  3435. n._positionDropdown(), n._resizeDropdown();
  3436. } ),
  3437. t.on( 'results:append', function () {
  3438. n._positionDropdown(), n._resizeDropdown();
  3439. } ),
  3440. t.on( 'results:message', function () {
  3441. n._positionDropdown(), n._resizeDropdown();
  3442. } ),
  3443. t.on( 'select', function () {
  3444. n._positionDropdown(), n._resizeDropdown();
  3445. } ),
  3446. t.on( 'unselect', function () {
  3447. n._positionDropdown(), n._resizeDropdown();
  3448. } ),
  3449. ( this._containerResultsHandlersBound = ! 0 ) );
  3450. } ),
  3451. ( e.prototype._attachPositioningHandler = function (
  3452. e,
  3453. t
  3454. ) {
  3455. var n = this,
  3456. s = 'scroll.select2.' + t.id,
  3457. i = 'resize.select2.' + t.id,
  3458. r = 'orientationchange.select2.' + t.id,
  3459. t = this.$container
  3460. .parents()
  3461. .filter( o.hasScroll );
  3462. t.each( function () {
  3463. o.StoreData( this, 'select2-scroll-position', {
  3464. x: u( this ).scrollLeft(),
  3465. y: u( this ).scrollTop(),
  3466. } );
  3467. } ),
  3468. t.on( s, function ( e ) {
  3469. var t = o.GetData(
  3470. this,
  3471. 'select2-scroll-position'
  3472. );
  3473. u( this ).scrollTop( t.y );
  3474. } ),
  3475. u( window ).on(
  3476. s + ' ' + i + ' ' + r,
  3477. function ( e ) {
  3478. n._positionDropdown(),
  3479. n._resizeDropdown();
  3480. }
  3481. );
  3482. } ),
  3483. ( e.prototype._detachPositioningHandler = function (
  3484. e,
  3485. t
  3486. ) {
  3487. var n = 'scroll.select2.' + t.id,
  3488. s = 'resize.select2.' + t.id,
  3489. t = 'orientationchange.select2.' + t.id;
  3490. this.$container
  3491. .parents()
  3492. .filter( o.hasScroll )
  3493. .off( n ),
  3494. u( window ).off( n + ' ' + s + ' ' + t );
  3495. } ),
  3496. ( e.prototype._positionDropdown = function () {
  3497. var e = u( window ),
  3498. t = this.$dropdown[ 0 ].classList.contains(
  3499. 'select2-dropdown--above'
  3500. ),
  3501. n = this.$dropdown[ 0 ].classList.contains(
  3502. 'select2-dropdown--below'
  3503. ),
  3504. s = null,
  3505. i = this.$container.offset();
  3506. i.bottom =
  3507. i.top + this.$container.outerHeight( ! 1 );
  3508. var r = {
  3509. height: this.$container.outerHeight( ! 1 ),
  3510. };
  3511. ( r.top = i.top ), ( r.bottom = i.top + r.height );
  3512. var o = this.$dropdown.outerHeight( ! 1 ),
  3513. a = e.scrollTop(),
  3514. l = e.scrollTop() + e.height(),
  3515. c = a < i.top - o,
  3516. e = l > i.bottom + o,
  3517. a = { left: i.left, top: r.bottom },
  3518. l = this.$dropdownParent;
  3519. 'static' === l.css( 'position' ) &&
  3520. ( l = l.offsetParent() );
  3521. i = { top: 0, left: 0 };
  3522. ( u.contains( document.body, l[ 0 ] ) ||
  3523. l[ 0 ].isConnected ) &&
  3524. ( i = l.offset() ),
  3525. ( a.top -= i.top ),
  3526. ( a.left -= i.left ),
  3527. t || n || ( s = 'below' ),
  3528. e || ! c || t
  3529. ? ! c && e && t && ( s = 'below' )
  3530. : ( s = 'above' ),
  3531. ( 'above' == s || ( t && 'below' !== s ) ) &&
  3532. ( a.top = r.top - i.top - o ),
  3533. null != s &&
  3534. ( this.$dropdown[ 0 ].classList.remove(
  3535. 'select2-dropdown--below'
  3536. ),
  3537. this.$dropdown[ 0 ].classList.remove(
  3538. 'select2-dropdown--above'
  3539. ),
  3540. this.$dropdown[ 0 ].classList.add(
  3541. 'select2-dropdown--' + s
  3542. ),
  3543. this.$container[ 0 ].classList.remove(
  3544. 'select2-container--below'
  3545. ),
  3546. this.$container[ 0 ].classList.remove(
  3547. 'select2-container--above'
  3548. ),
  3549. this.$container[ 0 ].classList.add(
  3550. 'select2-container--' + s
  3551. ) ),
  3552. this.$dropdownContainer.css( a );
  3553. } ),
  3554. ( e.prototype._resizeDropdown = function () {
  3555. var e = {
  3556. width: this.$container.outerWidth( ! 1 ) + 'px',
  3557. };
  3558. this.options.get( 'dropdownAutoWidth' ) &&
  3559. ( ( e.minWidth = e.width ),
  3560. ( e.position = 'relative' ),
  3561. ( e.width = 'auto' ) ),
  3562. this.$dropdown.css( e );
  3563. } ),
  3564. ( e.prototype._showDropdown = function ( e ) {
  3565. this.$dropdownContainer.appendTo(
  3566. this.$dropdownParent
  3567. ),
  3568. this._positionDropdown(),
  3569. this._resizeDropdown();
  3570. } ),
  3571. e
  3572. );
  3573. }
  3574. ),
  3575. u.define(
  3576. 'select2/dropdown/minimumResultsForSearch',
  3577. [],
  3578. function () {
  3579. function e( e, t, n, s ) {
  3580. ( this.minimumResultsForSearch = n.get(
  3581. 'minimumResultsForSearch'
  3582. ) ),
  3583. this.minimumResultsForSearch < 0 &&
  3584. ( this.minimumResultsForSearch = 1 / 0 ),
  3585. e.call( this, t, n, s );
  3586. }
  3587. return (
  3588. ( e.prototype.showSearch = function ( e, t ) {
  3589. return (
  3590. ! (
  3591. ( function e( t ) {
  3592. for (
  3593. var n = 0, s = 0;
  3594. s < t.length;
  3595. s++
  3596. ) {
  3597. var i = t[ s ];
  3598. i.children
  3599. ? ( n += e( i.children ) )
  3600. : n++;
  3601. }
  3602. return n;
  3603. } )( t.data.results ) <
  3604. this.minimumResultsForSearch
  3605. ) && e.call( this, t )
  3606. );
  3607. } ),
  3608. e
  3609. );
  3610. }
  3611. ),
  3612. u.define(
  3613. 'select2/dropdown/selectOnClose',
  3614. [ '../utils' ],
  3615. function ( s ) {
  3616. function e() {}
  3617. return (
  3618. ( e.prototype.bind = function ( e, t, n ) {
  3619. var s = this;
  3620. e.call( this, t, n ),
  3621. t.on( 'close', function ( e ) {
  3622. s._handleSelectOnClose( e );
  3623. } );
  3624. } ),
  3625. ( e.prototype._handleSelectOnClose = function ( e, t ) {
  3626. if ( t && null != t.originalSelect2Event ) {
  3627. var n = t.originalSelect2Event;
  3628. if (
  3629. 'select' === n._type ||
  3630. 'unselect' === n._type
  3631. )
  3632. return;
  3633. }
  3634. n = this.getHighlightedResults();
  3635. n.length < 1 ||
  3636. ( null !=
  3637. ( n = s.GetData( n[ 0 ], 'data' ) )
  3638. .element &&
  3639. n.element.selected ) ||
  3640. ( null == n.element && n.selected ) ||
  3641. this.trigger( 'select', { data: n } );
  3642. } ),
  3643. e
  3644. );
  3645. }
  3646. ),
  3647. u.define( 'select2/dropdown/closeOnSelect', [], function () {
  3648. function e() {}
  3649. return (
  3650. ( e.prototype.bind = function ( e, t, n ) {
  3651. var s = this;
  3652. e.call( this, t, n ),
  3653. t.on( 'select', function ( e ) {
  3654. s._selectTriggered( e );
  3655. } ),
  3656. t.on( 'unselect', function ( e ) {
  3657. s._selectTriggered( e );
  3658. } );
  3659. } ),
  3660. ( e.prototype._selectTriggered = function ( e, t ) {
  3661. var n = t.originalEvent;
  3662. ( n && ( n.ctrlKey || n.metaKey ) ) ||
  3663. this.trigger( 'close', {
  3664. originalEvent: n,
  3665. originalSelect2Event: t,
  3666. } );
  3667. } ),
  3668. e
  3669. );
  3670. } ),
  3671. u.define(
  3672. 'select2/dropdown/dropdownCss',
  3673. [ '../utils' ],
  3674. function ( n ) {
  3675. function e() {}
  3676. return (
  3677. ( e.prototype.render = function ( e ) {
  3678. var t = e.call( this ),
  3679. e =
  3680. this.options.get( 'dropdownCssClass' ) ||
  3681. '';
  3682. return (
  3683. -1 !== e.indexOf( ':all:' ) &&
  3684. ( ( e = e.replace( ':all:', '' ) ),
  3685. n.copyNonInternalCssClasses(
  3686. t[ 0 ],
  3687. this.$element[ 0 ]
  3688. ) ),
  3689. t.addClass( e ),
  3690. t
  3691. );
  3692. } ),
  3693. e
  3694. );
  3695. }
  3696. ),
  3697. u.define(
  3698. 'select2/dropdown/tagsSearchHighlight',
  3699. [ '../utils' ],
  3700. function ( s ) {
  3701. function e() {}
  3702. return (
  3703. ( e.prototype.highlightFirstItem = function ( e ) {
  3704. var t = this.$results.find(
  3705. '.select2-results__option--selectable:not(.select2-results__option--selected)'
  3706. );
  3707. if ( 0 < t.length ) {
  3708. var n = t.first(),
  3709. t = s.GetData( n[ 0 ], 'data' ).element;
  3710. if (
  3711. t &&
  3712. t.getAttribute &&
  3713. 'true' ===
  3714. t.getAttribute( 'data-select2-tag' )
  3715. )
  3716. return void n.trigger( 'mouseenter' );
  3717. }
  3718. e.call( this );
  3719. } ),
  3720. e
  3721. );
  3722. }
  3723. ),
  3724. u.define( 'select2/i18n/en', [], function () {
  3725. return {
  3726. errorLoading: function () {
  3727. return 'The results could not be loaded.';
  3728. },
  3729. inputTooLong: function ( e ) {
  3730. var t = e.input.length - e.maximum,
  3731. e = 'Please delete ' + t + ' character';
  3732. return 1 != t && ( e += 's' ), e;
  3733. },
  3734. inputTooShort: function ( e ) {
  3735. return (
  3736. 'Please enter ' +
  3737. ( e.minimum - e.input.length ) +
  3738. ' or more characters'
  3739. );
  3740. },
  3741. loadingMore: function () {
  3742. return 'Loading more results…';
  3743. },
  3744. maximumSelected: function ( e ) {
  3745. var t = 'You can only select ' + e.maximum + ' item';
  3746. return 1 != e.maximum && ( t += 's' ), t;
  3747. },
  3748. noResults: function () {
  3749. return 'No results found';
  3750. },
  3751. searching: function () {
  3752. return 'Searching…';
  3753. },
  3754. removeAllItems: function () {
  3755. return 'Remove all items';
  3756. },
  3757. removeItem: function () {
  3758. return 'Remove item';
  3759. },
  3760. search: function () {
  3761. return 'Search';
  3762. },
  3763. };
  3764. } ),
  3765. u.define(
  3766. 'select2/defaults',
  3767. [
  3768. 'jquery',
  3769. './results',
  3770. './selection/single',
  3771. './selection/multiple',
  3772. './selection/placeholder',
  3773. './selection/allowClear',
  3774. './selection/search',
  3775. './selection/selectionCss',
  3776. './selection/eventRelay',
  3777. './utils',
  3778. './translation',
  3779. './diacritics',
  3780. './data/select',
  3781. './data/array',
  3782. './data/ajax',
  3783. './data/tags',
  3784. './data/tokenizer',
  3785. './data/minimumInputLength',
  3786. './data/maximumInputLength',
  3787. './data/maximumSelectionLength',
  3788. './dropdown',
  3789. './dropdown/search',
  3790. './dropdown/hidePlaceholder',
  3791. './dropdown/infiniteScroll',
  3792. './dropdown/attachBody',
  3793. './dropdown/minimumResultsForSearch',
  3794. './dropdown/selectOnClose',
  3795. './dropdown/closeOnSelect',
  3796. './dropdown/dropdownCss',
  3797. './dropdown/tagsSearchHighlight',
  3798. './i18n/en',
  3799. ],
  3800. function (
  3801. l,
  3802. r,
  3803. o,
  3804. a,
  3805. c,
  3806. u,
  3807. d,
  3808. p,
  3809. h,
  3810. f,
  3811. g,
  3812. t,
  3813. m,
  3814. y,
  3815. v,
  3816. _,
  3817. b,
  3818. $,
  3819. w,
  3820. x,
  3821. A,
  3822. D,
  3823. S,
  3824. E,
  3825. O,
  3826. C,
  3827. L,
  3828. T,
  3829. q,
  3830. I,
  3831. e
  3832. ) {
  3833. function n() {
  3834. this.reset();
  3835. }
  3836. return (
  3837. ( n.prototype.apply = function ( e ) {
  3838. var t;
  3839. null ==
  3840. ( e = l.extend( ! 0, {}, this.defaults, e ) )
  3841. .dataAdapter &&
  3842. ( null != e.ajax
  3843. ? ( e.dataAdapter = v )
  3844. : null != e.data
  3845. ? ( e.dataAdapter = y )
  3846. : ( e.dataAdapter = m ),
  3847. 0 < e.minimumInputLength &&
  3848. ( e.dataAdapter = f.Decorate(
  3849. e.dataAdapter,
  3850. $
  3851. ) ),
  3852. 0 < e.maximumInputLength &&
  3853. ( e.dataAdapter = f.Decorate(
  3854. e.dataAdapter,
  3855. w
  3856. ) ),
  3857. 0 < e.maximumSelectionLength &&
  3858. ( e.dataAdapter = f.Decorate(
  3859. e.dataAdapter,
  3860. x
  3861. ) ),
  3862. e.tags &&
  3863. ( e.dataAdapter = f.Decorate(
  3864. e.dataAdapter,
  3865. _
  3866. ) ),
  3867. ( null == e.tokenSeparators &&
  3868. null == e.tokenizer ) ||
  3869. ( e.dataAdapter = f.Decorate(
  3870. e.dataAdapter,
  3871. b
  3872. ) ) ),
  3873. null == e.resultsAdapter &&
  3874. ( ( e.resultsAdapter = r ),
  3875. null != e.ajax &&
  3876. ( e.resultsAdapter = f.Decorate(
  3877. e.resultsAdapter,
  3878. E
  3879. ) ),
  3880. null != e.placeholder &&
  3881. ( e.resultsAdapter = f.Decorate(
  3882. e.resultsAdapter,
  3883. S
  3884. ) ),
  3885. e.selectOnClose &&
  3886. ( e.resultsAdapter = f.Decorate(
  3887. e.resultsAdapter,
  3888. L
  3889. ) ),
  3890. e.tags &&
  3891. ( e.resultsAdapter = f.Decorate(
  3892. e.resultsAdapter,
  3893. I
  3894. ) ) ),
  3895. null == e.dropdownAdapter &&
  3896. ( e.multiple
  3897. ? ( e.dropdownAdapter = A )
  3898. : ( ( t = f.Decorate( A, D ) ),
  3899. ( e.dropdownAdapter = t ) ),
  3900. 0 !== e.minimumResultsForSearch &&
  3901. ( e.dropdownAdapter = f.Decorate(
  3902. e.dropdownAdapter,
  3903. C
  3904. ) ),
  3905. e.closeOnSelect &&
  3906. ( e.dropdownAdapter = f.Decorate(
  3907. e.dropdownAdapter,
  3908. T
  3909. ) ),
  3910. null != e.dropdownCssClass &&
  3911. ( e.dropdownAdapter = f.Decorate(
  3912. e.dropdownAdapter,
  3913. q
  3914. ) ),
  3915. ( e.dropdownAdapter = f.Decorate(
  3916. e.dropdownAdapter,
  3917. O
  3918. ) ) ),
  3919. null == e.selectionAdapter &&
  3920. ( e.multiple
  3921. ? ( e.selectionAdapter = a )
  3922. : ( e.selectionAdapter = o ),
  3923. null != e.placeholder &&
  3924. ( e.selectionAdapter = f.Decorate(
  3925. e.selectionAdapter,
  3926. c
  3927. ) ),
  3928. e.allowClear &&
  3929. ( e.selectionAdapter = f.Decorate(
  3930. e.selectionAdapter,
  3931. u
  3932. ) ),
  3933. e.multiple &&
  3934. ( e.selectionAdapter = f.Decorate(
  3935. e.selectionAdapter,
  3936. d
  3937. ) ),
  3938. null != e.selectionCssClass &&
  3939. ( e.selectionAdapter = f.Decorate(
  3940. e.selectionAdapter,
  3941. p
  3942. ) ),
  3943. ( e.selectionAdapter = f.Decorate(
  3944. e.selectionAdapter,
  3945. h
  3946. ) ) ),
  3947. ( e.language = this._resolveLanguage(
  3948. e.language
  3949. ) ),
  3950. e.language.push( 'en' );
  3951. for (
  3952. var n = [], s = 0;
  3953. s < e.language.length;
  3954. s++
  3955. ) {
  3956. var i = e.language[ s ];
  3957. -1 === n.indexOf( i ) && n.push( i );
  3958. }
  3959. return (
  3960. ( e.language = n ),
  3961. ( e.translations = this._processTranslations(
  3962. e.language,
  3963. e.debug
  3964. ) ),
  3965. e
  3966. );
  3967. } ),
  3968. ( n.prototype.reset = function () {
  3969. function a( e ) {
  3970. return e.replace(
  3971. /[^\u0000-\u007E]/g,
  3972. function ( e ) {
  3973. return t[ e ] || e;
  3974. }
  3975. );
  3976. }
  3977. this.defaults = {
  3978. amdLanguageBase: './i18n/',
  3979. autocomplete: 'off',
  3980. closeOnSelect: ! 0,
  3981. debug: ! 1,
  3982. dropdownAutoWidth: ! 1,
  3983. escapeMarkup: f.escapeMarkup,
  3984. language: {},
  3985. matcher: function e( t, n ) {
  3986. if (
  3987. null == t.term ||
  3988. '' === t.term.trim()
  3989. )
  3990. return n;
  3991. if ( n.children && 0 < n.children.length ) {
  3992. for (
  3993. var s = l.extend( ! 0, {}, n ),
  3994. i = n.children.length - 1;
  3995. 0 <= i;
  3996. i--
  3997. )
  3998. null == e( t, n.children[ i ] ) &&
  3999. s.children.splice( i, 1 );
  4000. return 0 < s.children.length
  4001. ? s
  4002. : e( t, s );
  4003. }
  4004. var r = a( n.text ).toUpperCase(),
  4005. o = a( t.term ).toUpperCase();
  4006. return -1 < r.indexOf( o ) ? n : null;
  4007. },
  4008. minimumInputLength: 0,
  4009. maximumInputLength: 0,
  4010. maximumSelectionLength: 0,
  4011. minimumResultsForSearch: 0,
  4012. selectOnClose: ! 1,
  4013. scrollAfterSelect: ! 1,
  4014. sorter: function ( e ) {
  4015. return e;
  4016. },
  4017. templateResult: function ( e ) {
  4018. return e.text;
  4019. },
  4020. templateSelection: function ( e ) {
  4021. return e.text;
  4022. },
  4023. theme: 'default',
  4024. width: 'resolve',
  4025. };
  4026. } ),
  4027. ( n.prototype.applyFromElement = function ( e, t ) {
  4028. var n = e.language,
  4029. s = this.defaults.language,
  4030. i = t.prop( 'lang' ),
  4031. t = t.closest( '[lang]' ).prop( 'lang' ),
  4032. t = Array.prototype.concat.call(
  4033. this._resolveLanguage( i ),
  4034. this._resolveLanguage( n ),
  4035. this._resolveLanguage( s ),
  4036. this._resolveLanguage( t )
  4037. );
  4038. return ( e.language = t ), e;
  4039. } ),
  4040. ( n.prototype._resolveLanguage = function ( e ) {
  4041. if ( ! e ) return [];
  4042. if ( l.isEmptyObject( e ) ) return [];
  4043. if ( l.isPlainObject( e ) ) return [ e ];
  4044. for (
  4045. var t,
  4046. n = Array.isArray( e ) ? e : [ e ],
  4047. s = [],
  4048. i = 0;
  4049. i < n.length;
  4050. i++
  4051. )
  4052. s.push( n[ i ] ),
  4053. 'string' == typeof n[ i ] &&
  4054. 0 < n[ i ].indexOf( '-' ) &&
  4055. ( ( t = n[ i ].split( '-' )[ 0 ] ),
  4056. s.push( t ) );
  4057. return s;
  4058. } ),
  4059. ( n.prototype._processTranslations = function ( e, t ) {
  4060. for ( var n = new g(), s = 0; s < e.length; s++ ) {
  4061. var i = new g(),
  4062. r = e[ s ];
  4063. if ( 'string' == typeof r )
  4064. try {
  4065. i = g.loadPath( r );
  4066. } catch ( e ) {
  4067. try {
  4068. ( r =
  4069. this.defaults.amdLanguageBase +
  4070. r ),
  4071. ( i = g.loadPath( r ) );
  4072. } catch ( e ) {
  4073. t &&
  4074. window.console &&
  4075. console.warn &&
  4076. console.warn(
  4077. 'Select2: The language file for "' +
  4078. r +
  4079. '" could not be automatically loaded. A fallback will be used instead.'
  4080. );
  4081. }
  4082. }
  4083. else i = l.isPlainObject( r ) ? new g( r ) : r;
  4084. n.extend( i );
  4085. }
  4086. return n;
  4087. } ),
  4088. ( n.prototype.set = function ( e, t ) {
  4089. var n = {};
  4090. n[ l.camelCase( e ) ] = t;
  4091. n = f._convertData( n );
  4092. l.extend( ! 0, this.defaults, n );
  4093. } ),
  4094. new n()
  4095. );
  4096. }
  4097. ),
  4098. u.define(
  4099. 'select2/options',
  4100. [ 'jquery', './defaults', './utils' ],
  4101. function ( c, n, u ) {
  4102. function e( e, t ) {
  4103. ( this.options = e ),
  4104. null != t && this.fromElement( t ),
  4105. null != t &&
  4106. ( this.options = n.applyFromElement(
  4107. this.options,
  4108. t
  4109. ) ),
  4110. ( this.options = n.apply( this.options ) );
  4111. }
  4112. return (
  4113. ( e.prototype.fromElement = function ( e ) {
  4114. var t = [ 'select2' ];
  4115. null == this.options.multiple &&
  4116. ( this.options.multiple = e.prop(
  4117. 'multiple'
  4118. ) ),
  4119. null == this.options.disabled &&
  4120. ( this.options.disabled = e.prop(
  4121. 'disabled'
  4122. ) ),
  4123. null == this.options.autocomplete &&
  4124. e.prop( 'autocomplete' ) &&
  4125. ( this.options.autocomplete = e.prop(
  4126. 'autocomplete'
  4127. ) ),
  4128. null == this.options.dir &&
  4129. ( e.prop( 'dir' )
  4130. ? ( this.options.dir = e.prop( 'dir' ) )
  4131. : e.closest( '[dir]' ).prop( 'dir' )
  4132. ? ( this.options.dir = e
  4133. .closest( '[dir]' )
  4134. .prop( 'dir' ) )
  4135. : ( this.options.dir = 'ltr' ) ),
  4136. e.prop( 'disabled', this.options.disabled ),
  4137. e.prop( 'multiple', this.options.multiple ),
  4138. u.GetData( e[ 0 ], 'select2Tags' ) &&
  4139. ( this.options.debug &&
  4140. window.console &&
  4141. console.warn &&
  4142. console.warn(
  4143. '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.'
  4144. ),
  4145. u.StoreData(
  4146. e[ 0 ],
  4147. 'data',
  4148. u.GetData( e[ 0 ], 'select2Tags' )
  4149. ),
  4150. u.StoreData( e[ 0 ], 'tags', ! 0 ) ),
  4151. u.GetData( e[ 0 ], 'ajaxUrl' ) &&
  4152. ( this.options.debug &&
  4153. window.console &&
  4154. console.warn &&
  4155. console.warn(
  4156. '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.'
  4157. ),
  4158. e.attr(
  4159. 'ajax--url',
  4160. u.GetData( e[ 0 ], 'ajaxUrl' )
  4161. ),
  4162. u.StoreData(
  4163. e[ 0 ],
  4164. 'ajax-Url',
  4165. u.GetData( e[ 0 ], 'ajaxUrl' )
  4166. ) );
  4167. var n = {};
  4168. function s( e, t ) {
  4169. return t.toUpperCase();
  4170. }
  4171. for (
  4172. var i = 0;
  4173. i < e[ 0 ].attributes.length;
  4174. i++
  4175. ) {
  4176. var r = e[ 0 ].attributes[ i ].name,
  4177. o = 'data-';
  4178. r.substr( 0, o.length ) == o &&
  4179. ( ( r = r.substring( o.length ) ),
  4180. ( o = u.GetData( e[ 0 ], r ) ),
  4181. ( n[ r.replace( /-([a-z])/g, s ) ] = o ) );
  4182. }
  4183. c.fn.jquery &&
  4184. '1.' == c.fn.jquery.substr( 0, 2 ) &&
  4185. e[ 0 ].dataset &&
  4186. ( n = c.extend( ! 0, {}, e[ 0 ].dataset, n ) );
  4187. var a,
  4188. l = c.extend( ! 0, {}, u.GetData( e[ 0 ] ), n );
  4189. for ( a in ( l = u._convertData( l ) ) )
  4190. -1 < t.indexOf( a ) ||
  4191. ( c.isPlainObject( this.options[ a ] )
  4192. ? c.extend( this.options[ a ], l[ a ] )
  4193. : ( this.options[ a ] = l[ a ] ) );
  4194. return this;
  4195. } ),
  4196. ( e.prototype.get = function ( e ) {
  4197. return this.options[ e ];
  4198. } ),
  4199. ( e.prototype.set = function ( e, t ) {
  4200. this.options[ e ] = t;
  4201. } ),
  4202. e
  4203. );
  4204. }
  4205. ),
  4206. u.define(
  4207. 'select2/core',
  4208. [ 'jquery', './options', './utils', './keys' ],
  4209. function ( t, i, r, s ) {
  4210. var o = function ( e, t ) {
  4211. null != r.GetData( e[ 0 ], 'select2' ) &&
  4212. r.GetData( e[ 0 ], 'select2' ).destroy(),
  4213. ( this.$element = e ),
  4214. ( this.id = this._generateId( e ) ),
  4215. ( t = t || {} ),
  4216. ( this.options = new i( t, e ) ),
  4217. o.__super__.constructor.call( this );
  4218. var n = e.attr( 'tabindex' ) || 0;
  4219. r.StoreData( e[ 0 ], 'old-tabindex', n ),
  4220. e.attr( 'tabindex', '-1' );
  4221. t = this.options.get( 'dataAdapter' );
  4222. this.dataAdapter = new t( e, this.options );
  4223. n = this.render();
  4224. this._placeContainer( n );
  4225. t = this.options.get( 'selectionAdapter' );
  4226. ( this.selection = new t( e, this.options ) ),
  4227. ( this.$selection = this.selection.render() ),
  4228. this.selection.position( this.$selection, n );
  4229. t = this.options.get( 'dropdownAdapter' );
  4230. ( this.dropdown = new t( e, this.options ) ),
  4231. ( this.$dropdown = this.dropdown.render() ),
  4232. this.dropdown.position( this.$dropdown, n );
  4233. n = this.options.get( 'resultsAdapter' );
  4234. ( this.results = new n(
  4235. e,
  4236. this.options,
  4237. this.dataAdapter
  4238. ) ),
  4239. ( this.$results = this.results.render() ),
  4240. this.results.position(
  4241. this.$results,
  4242. this.$dropdown
  4243. );
  4244. var s = this;
  4245. this._bindAdapters(),
  4246. this._registerDomEvents(),
  4247. this._registerDataEvents(),
  4248. this._registerSelectionEvents(),
  4249. this._registerDropdownEvents(),
  4250. this._registerResultsEvents(),
  4251. this._registerEvents(),
  4252. this.dataAdapter.current( function ( e ) {
  4253. s.trigger( 'selection:update', { data: e } );
  4254. } ),
  4255. e[ 0 ].classList.add( 'select2-hidden-accessible' ),
  4256. e.attr( 'aria-hidden', 'true' ),
  4257. this._syncAttributes(),
  4258. r.StoreData( e[ 0 ], 'select2', this ),
  4259. e.data( 'select2', this );
  4260. };
  4261. return (
  4262. r.Extend( o, r.Observable ),
  4263. ( o.prototype._generateId = function ( e ) {
  4264. return (
  4265. 'select2-' +
  4266. ( null != e.attr( 'id' )
  4267. ? e.attr( 'id' )
  4268. : null != e.attr( 'name' )
  4269. ? e.attr( 'name' ) +
  4270. '-' +
  4271. r.generateChars( 2 )
  4272. : r.generateChars( 4 )
  4273. ).replace( /(:|\.|\[|\]|,)/g, '' )
  4274. );
  4275. } ),
  4276. ( o.prototype._placeContainer = function ( e ) {
  4277. e.insertAfter( this.$element );
  4278. var t = this._resolveWidth(
  4279. this.$element,
  4280. this.options.get( 'width' )
  4281. );
  4282. null != t && e.css( 'width', t );
  4283. } ),
  4284. ( o.prototype._resolveWidth = function ( e, t ) {
  4285. var n = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
  4286. if ( 'resolve' == t ) {
  4287. var s = this._resolveWidth( e, 'style' );
  4288. return null != s
  4289. ? s
  4290. : this._resolveWidth( e, 'element' );
  4291. }
  4292. if ( 'element' == t ) {
  4293. s = e.outerWidth( ! 1 );
  4294. return s <= 0 ? 'auto' : s + 'px';
  4295. }
  4296. if ( 'style' != t )
  4297. return 'computedstyle' != t
  4298. ? t
  4299. : window.getComputedStyle( e[ 0 ] ).width;
  4300. e = e.attr( 'style' );
  4301. if ( 'string' != typeof e ) return null;
  4302. for (
  4303. var i = e.split( ';' ), r = 0, o = i.length;
  4304. r < o;
  4305. r += 1
  4306. ) {
  4307. var a = i[ r ].replace( /\s/g, '' ).match( n );
  4308. if ( null !== a && 1 <= a.length )
  4309. return a[ 1 ];
  4310. }
  4311. return null;
  4312. } ),
  4313. ( o.prototype._bindAdapters = function () {
  4314. this.dataAdapter.bind( this, this.$container ),
  4315. this.selection.bind( this, this.$container ),
  4316. this.dropdown.bind( this, this.$container ),
  4317. this.results.bind( this, this.$container );
  4318. } ),
  4319. ( o.prototype._registerDomEvents = function () {
  4320. var t = this;
  4321. this.$element.on( 'change.select2', function () {
  4322. t.dataAdapter.current( function ( e ) {
  4323. t.trigger( 'selection:update', {
  4324. data: e,
  4325. } );
  4326. } );
  4327. } ),
  4328. this.$element.on(
  4329. 'focus.select2',
  4330. function ( e ) {
  4331. t.trigger( 'focus', e );
  4332. }
  4333. ),
  4334. ( this._syncA = r.bind(
  4335. this._syncAttributes,
  4336. this
  4337. ) ),
  4338. ( this._syncS = r.bind(
  4339. this._syncSubtree,
  4340. this
  4341. ) ),
  4342. ( this._observer = new window.MutationObserver(
  4343. function ( e ) {
  4344. t._syncA(), t._syncS( e );
  4345. }
  4346. ) ),
  4347. this._observer.observe( this.$element[ 0 ], {
  4348. attributes: ! 0,
  4349. childList: ! 0,
  4350. subtree: ! 1,
  4351. } );
  4352. } ),
  4353. ( o.prototype._registerDataEvents = function () {
  4354. var n = this;
  4355. this.dataAdapter.on( '*', function ( e, t ) {
  4356. n.trigger( e, t );
  4357. } );
  4358. } ),
  4359. ( o.prototype._registerSelectionEvents = function () {
  4360. var n = this,
  4361. s = [ 'toggle', 'focus' ];
  4362. this.selection.on( 'toggle', function () {
  4363. n.toggleDropdown();
  4364. } ),
  4365. this.selection.on( 'focus', function ( e ) {
  4366. n.focus( e );
  4367. } ),
  4368. this.selection.on( '*', function ( e, t ) {
  4369. -1 === s.indexOf( e ) && n.trigger( e, t );
  4370. } );
  4371. } ),
  4372. ( o.prototype._registerDropdownEvents = function () {
  4373. var n = this;
  4374. this.dropdown.on( '*', function ( e, t ) {
  4375. n.trigger( e, t );
  4376. } );
  4377. } ),
  4378. ( o.prototype._registerResultsEvents = function () {
  4379. var n = this;
  4380. this.results.on( '*', function ( e, t ) {
  4381. n.trigger( e, t );
  4382. } );
  4383. } ),
  4384. ( o.prototype._registerEvents = function () {
  4385. var n = this;
  4386. this.on( 'open', function () {
  4387. n.$container[ 0 ].classList.add(
  4388. 'select2-container--open'
  4389. );
  4390. } ),
  4391. this.on( 'close', function () {
  4392. n.$container[ 0 ].classList.remove(
  4393. 'select2-container--open'
  4394. );
  4395. } ),
  4396. this.on( 'enable', function () {
  4397. n.$container[ 0 ].classList.remove(
  4398. 'select2-container--disabled'
  4399. );
  4400. } ),
  4401. this.on( 'disable', function () {
  4402. n.$container[ 0 ].classList.add(
  4403. 'select2-container--disabled'
  4404. );
  4405. } ),
  4406. this.on( 'blur', function () {
  4407. n.$container[ 0 ].classList.remove(
  4408. 'select2-container--focus'
  4409. );
  4410. } ),
  4411. this.on( 'query', function ( t ) {
  4412. n.isOpen() || n.trigger( 'open', {} ),
  4413. this.dataAdapter.query(
  4414. t,
  4415. function ( e ) {
  4416. n.trigger( 'results:all', {
  4417. data: e,
  4418. query: t,
  4419. } );
  4420. }
  4421. );
  4422. } ),
  4423. this.on( 'query:append', function ( t ) {
  4424. this.dataAdapter.query( t, function ( e ) {
  4425. n.trigger( 'results:append', {
  4426. data: e,
  4427. query: t,
  4428. } );
  4429. } );
  4430. } ),
  4431. this.on( 'keypress', function ( e ) {
  4432. var t = e.which;
  4433. n.isOpen()
  4434. ? t === s.ESC ||
  4435. ( t === s.UP && e.altKey )
  4436. ? ( n.close( e ),
  4437. e.preventDefault() )
  4438. : t === s.ENTER || t === s.TAB
  4439. ? ( n.trigger(
  4440. 'results:select',
  4441. {}
  4442. ),
  4443. e.preventDefault() )
  4444. : t === s.SPACE && e.ctrlKey
  4445. ? ( n.trigger(
  4446. 'results:toggle',
  4447. {}
  4448. ),
  4449. e.preventDefault() )
  4450. : t === s.UP
  4451. ? ( n.trigger(
  4452. 'results:previous',
  4453. {}
  4454. ),
  4455. e.preventDefault() )
  4456. : t === s.DOWN &&
  4457. ( n.trigger( 'results:next', {} ),
  4458. e.preventDefault() )
  4459. : ( t === s.ENTER ||
  4460. t === s.SPACE ||
  4461. ( t === s.DOWN &&
  4462. e.altKey ) ) &&
  4463. ( n.open(), e.preventDefault() );
  4464. } );
  4465. } ),
  4466. ( o.prototype._syncAttributes = function () {
  4467. this.options.set(
  4468. 'disabled',
  4469. this.$element.prop( 'disabled' )
  4470. ),
  4471. this.isDisabled()
  4472. ? ( this.isOpen() && this.close(),
  4473. this.trigger( 'disable', {} ) )
  4474. : this.trigger( 'enable', {} );
  4475. } ),
  4476. ( o.prototype._isChangeMutation = function ( e ) {
  4477. var t = this;
  4478. if ( e.addedNodes && 0 < e.addedNodes.length ) {
  4479. for ( var n = 0; n < e.addedNodes.length; n++ )
  4480. if ( e.addedNodes[ n ].selected )
  4481. return ! 0;
  4482. } else {
  4483. if (
  4484. e.removedNodes &&
  4485. 0 < e.removedNodes.length
  4486. )
  4487. return ! 0;
  4488. if ( Array.isArray( e ) )
  4489. return e.some( function ( e ) {
  4490. return t._isChangeMutation( e );
  4491. } );
  4492. }
  4493. return ! 1;
  4494. } ),
  4495. ( o.prototype._syncSubtree = function ( e ) {
  4496. var e = this._isChangeMutation( e ),
  4497. t = this;
  4498. e &&
  4499. this.dataAdapter.current( function ( e ) {
  4500. t.trigger( 'selection:update', {
  4501. data: e,
  4502. } );
  4503. } );
  4504. } ),
  4505. ( o.prototype.trigger = function ( e, t ) {
  4506. var n = o.__super__.trigger,
  4507. s = {
  4508. open: 'opening',
  4509. close: 'closing',
  4510. select: 'selecting',
  4511. unselect: 'unselecting',
  4512. clear: 'clearing',
  4513. };
  4514. if ( ( void 0 === t && ( t = {} ), e in s ) ) {
  4515. var i = s[ e ],
  4516. s = { prevented: ! 1, name: e, args: t };
  4517. if ( ( n.call( this, i, s ), s.prevented ) )
  4518. return void ( t.prevented = ! 0 );
  4519. }
  4520. n.call( this, e, t );
  4521. } ),
  4522. ( o.prototype.toggleDropdown = function () {
  4523. this.isDisabled() ||
  4524. ( this.isOpen() ? this.close() : this.open() );
  4525. } ),
  4526. ( o.prototype.open = function () {
  4527. this.isOpen() ||
  4528. this.isDisabled() ||
  4529. this.trigger( 'query', {} );
  4530. } ),
  4531. ( o.prototype.close = function ( e ) {
  4532. this.isOpen() &&
  4533. this.trigger( 'close', { originalEvent: e } );
  4534. } ),
  4535. ( o.prototype.isEnabled = function () {
  4536. return ! this.isDisabled();
  4537. } ),
  4538. ( o.prototype.isDisabled = function () {
  4539. return this.options.get( 'disabled' );
  4540. } ),
  4541. ( o.prototype.isOpen = function () {
  4542. return this.$container[ 0 ].classList.contains(
  4543. 'select2-container--open'
  4544. );
  4545. } ),
  4546. ( o.prototype.hasFocus = function () {
  4547. return this.$container[ 0 ].classList.contains(
  4548. 'select2-container--focus'
  4549. );
  4550. } ),
  4551. ( o.prototype.focus = function ( e ) {
  4552. this.hasFocus() ||
  4553. ( this.$container[ 0 ].classList.add(
  4554. 'select2-container--focus'
  4555. ),
  4556. this.trigger( 'focus', {} ) );
  4557. } ),
  4558. ( o.prototype.enable = function ( e ) {
  4559. this.options.get( 'debug' ) &&
  4560. window.console &&
  4561. console.warn &&
  4562. console.warn(
  4563. 'Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'
  4564. ),
  4565. ( null != e && 0 !== e.length ) ||
  4566. ( e = [ ! 0 ] );
  4567. e = ! e[ 0 ];
  4568. this.$element.prop( 'disabled', e );
  4569. } ),
  4570. ( o.prototype.data = function () {
  4571. this.options.get( 'debug' ) &&
  4572. 0 < arguments.length &&
  4573. window.console &&
  4574. console.warn &&
  4575. console.warn(
  4576. 'Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.'
  4577. );
  4578. var t = [];
  4579. return (
  4580. this.dataAdapter.current( function ( e ) {
  4581. t = e;
  4582. } ),
  4583. t
  4584. );
  4585. } ),
  4586. ( o.prototype.val = function ( e ) {
  4587. if (
  4588. ( this.options.get( 'debug' ) &&
  4589. window.console &&
  4590. console.warn &&
  4591. console.warn(
  4592. 'Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'
  4593. ),
  4594. null == e || 0 === e.length )
  4595. )
  4596. return this.$element.val();
  4597. e = e[ 0 ];
  4598. Array.isArray( e ) &&
  4599. ( e = e.map( function ( e ) {
  4600. return e.toString();
  4601. } ) ),
  4602. this.$element
  4603. .val( e )
  4604. .trigger( 'input' )
  4605. .trigger( 'change' );
  4606. } ),
  4607. ( o.prototype.destroy = function () {
  4608. r.RemoveData( this.$container[ 0 ] ),
  4609. this.$container.remove(),
  4610. this._observer.disconnect(),
  4611. ( this._observer = null ),
  4612. ( this._syncA = null ),
  4613. ( this._syncS = null ),
  4614. this.$element.off( '.select2' ),
  4615. this.$element.attr(
  4616. 'tabindex',
  4617. r.GetData(
  4618. this.$element[ 0 ],
  4619. 'old-tabindex'
  4620. )
  4621. ),
  4622. this.$element[ 0 ].classList.remove(
  4623. 'select2-hidden-accessible'
  4624. ),
  4625. this.$element.attr( 'aria-hidden', 'false' ),
  4626. r.RemoveData( this.$element[ 0 ] ),
  4627. this.$element.removeData( 'select2' ),
  4628. this.dataAdapter.destroy(),
  4629. this.selection.destroy(),
  4630. this.dropdown.destroy(),
  4631. this.results.destroy(),
  4632. ( this.dataAdapter = null ),
  4633. ( this.selection = null ),
  4634. ( this.dropdown = null ),
  4635. ( this.results = null );
  4636. } ),
  4637. ( o.prototype.render = function () {
  4638. var e = t(
  4639. '<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>'
  4640. );
  4641. return (
  4642. e.attr( 'dir', this.options.get( 'dir' ) ),
  4643. ( this.$container = e ),
  4644. this.$container[ 0 ].classList.add(
  4645. 'select2-container--' +
  4646. this.options.get( 'theme' )
  4647. ),
  4648. r.StoreData( e[ 0 ], 'element', this.$element ),
  4649. e
  4650. );
  4651. } ),
  4652. o
  4653. );
  4654. }
  4655. ),
  4656. u.define( 'jquery-mousewheel', [ 'jquery' ], function ( e ) {
  4657. return e;
  4658. } ),
  4659. u.define(
  4660. 'jquery.select2',
  4661. [
  4662. 'jquery',
  4663. 'jquery-mousewheel',
  4664. './select2/core',
  4665. './select2/defaults',
  4666. './select2/utils',
  4667. ],
  4668. function ( i, e, r, t, o ) {
  4669. var a;
  4670. return (
  4671. null == i.fn.select2 &&
  4672. ( ( a = [ 'open', 'close', 'destroy' ] ),
  4673. ( i.fn.select2 = function ( t ) {
  4674. if ( 'object' == typeof ( t = t || {} ) )
  4675. return (
  4676. this.each( function () {
  4677. var e = i.extend( ! 0, {}, t );
  4678. new r( i( this ), e );
  4679. } ),
  4680. this
  4681. );
  4682. if ( 'string' != typeof t )
  4683. throw new Error(
  4684. 'Invalid arguments for Select2: ' + t
  4685. );
  4686. var n,
  4687. s = Array.prototype.slice.call(
  4688. arguments,
  4689. 1
  4690. );
  4691. return (
  4692. this.each( function () {
  4693. var e = o.GetData( this, 'select2' );
  4694. null == e &&
  4695. window.console &&
  4696. console.error &&
  4697. console.error(
  4698. "The select2('" +
  4699. t +
  4700. "') method was called on an element that is not using Select2."
  4701. ),
  4702. ( n = e[ t ].apply( e, s ) );
  4703. } ),
  4704. -1 < a.indexOf( t ) ? this : n
  4705. );
  4706. } ) ),
  4707. null == i.fn.select2.defaults &&
  4708. ( i.fn.select2.defaults = t ),
  4709. r
  4710. );
  4711. }
  4712. ),
  4713. { define: u.define, require: u.require } );
  4714. function b( e, t ) {
  4715. return i.call( e, t );
  4716. }
  4717. function l( e, t ) {
  4718. var n,
  4719. s,
  4720. i,
  4721. r,
  4722. o,
  4723. a,
  4724. l,
  4725. c,
  4726. u,
  4727. d,
  4728. p = t && t.split( '/' ),
  4729. h = y.map,
  4730. f = ( h && h[ '*' ] ) || {};
  4731. if ( e ) {
  4732. for (
  4733. t = ( e = e.split( '/' ) ).length - 1,
  4734. y.nodeIdCompat &&
  4735. _.test( e[ t ] ) &&
  4736. ( e[ t ] = e[ t ].replace( _, '' ) ),
  4737. '.' === e[ 0 ].charAt( 0 ) &&
  4738. p &&
  4739. ( e = p.slice( 0, p.length - 1 ).concat( e ) ),
  4740. c = 0;
  4741. c < e.length;
  4742. c++
  4743. )
  4744. '.' === ( d = e[ c ] )
  4745. ? ( e.splice( c, 1 ), --c )
  4746. : '..' === d &&
  4747. ( 0 === c ||
  4748. ( 1 === c && '..' === e[ 2 ] ) ||
  4749. '..' === e[ c - 1 ] ||
  4750. ( 0 < c && ( e.splice( c - 1, 2 ), ( c -= 2 ) ) ) );
  4751. e = e.join( '/' );
  4752. }
  4753. if ( ( p || f ) && h ) {
  4754. for ( c = ( n = e.split( '/' ) ).length; 0 < c; --c ) {
  4755. if ( ( ( s = n.slice( 0, c ).join( '/' ) ), p ) )
  4756. for ( u = p.length; 0 < u; --u )
  4757. if (
  4758. ( ( i = h[ p.slice( 0, u ).join( '/' ) ] ),
  4759. ( i = i && i[ s ] ) )
  4760. ) {
  4761. ( r = i ), ( o = c );
  4762. break;
  4763. }
  4764. if ( r ) break;
  4765. ! a && f && f[ s ] && ( ( a = f[ s ] ), ( l = c ) );
  4766. }
  4767. ! r && a && ( ( r = a ), ( o = l ) ),
  4768. r && ( n.splice( 0, o, r ), ( e = n.join( '/' ) ) );
  4769. }
  4770. return e;
  4771. }
  4772. function w( t, n ) {
  4773. return function () {
  4774. var e = a.call( arguments, 0 );
  4775. return (
  4776. 'string' != typeof e[ 0 ] && 1 === e.length && e.push( null ),
  4777. o.apply( p, e.concat( [ t, n ] ) )
  4778. );
  4779. };
  4780. }
  4781. function x( e ) {
  4782. var t;
  4783. if (
  4784. ( b( m, e ) &&
  4785. ( ( t = m[ e ] ),
  4786. delete m[ e ],
  4787. ( v[ e ] = ! 0 ),
  4788. r.apply( p, t ) ),
  4789. ! b( g, e ) && ! b( v, e ) )
  4790. )
  4791. throw new Error( 'No ' + e );
  4792. return g[ e ];
  4793. }
  4794. function c( e ) {
  4795. var t,
  4796. n = e ? e.indexOf( '!' ) : -1;
  4797. return (
  4798. -1 < n &&
  4799. ( ( t = e.substring( 0, n ) ),
  4800. ( e = e.substring( n + 1, e.length ) ) ),
  4801. [ t, e ]
  4802. );
  4803. }
  4804. function A( e ) {
  4805. return e ? c( e ) : [];
  4806. }
  4807. var u = s.require( 'jquery.select2' );
  4808. return ( t.fn.select2.amd = s ), u;
  4809. } );