diff --git a/bin/copy-web-fc-solve.bash b/bin/copy-web-fc-solve.bash index 0008257..9463826 100644 --- a/bin/copy-web-fc-solve.bash +++ b/bin/copy-web-fc-solve.bash @@ -6,5 +6,8 @@ # Distributed under the terms of the MIT license. # +set -e -x + fcs_site="${FC_SOLVE_SITE:-/home/shlomif/progs/freecell/git/fc-solve/fc-solve/site/wml}" cp -f "$fcs_site"/dest/js/lib{freecell,fcs-wrap}* ext/libfreecell-solver/ +cp -f "$fcs_site"/src/ts/{capitalize-cards,fcs-validate,web-fc-solve--expand-moves,web-fc-solve,web-fcs-api-base}.ts src/ts/ diff --git a/docs/js/all-min.js b/docs/js/all-min.js index 2e39b71..7cc025f 100644 --- a/docs/js/all-min.js +++ b/docs/js/all-min.js @@ -1 +1 @@ -YUI.add("breakout",(function(Y){function Breakout(config){var rows=config.rows,columns=config.columns;this._host=config.host,this._container=Y.Node.create("
"),this._nodes=[],rows||columns||(rows=8),this._rows=rows,this._columns=columns,Breakout.superclass.constructor.apply(this,arguments)}Breakout.NS="breakout",Breakout.Name="Breakout",Y.extend(Breakout,Y.Plugin.Base,{_splitNode:function(){var r,c,x,y,host,row,width=Math.round(this._blockWidth),height=Math.round(this._blockHeight),rows=this._rows,columns=this._columns,origin=this._host.getXY(),container=this._container,nodes=this._nodes=[],mask=Y.Node.create('
');for(container.setXY(origin),r=0;r-1&&(VERSION="3.5.0"),proto={applyConfig:function(o){o=o||NOOP;var attr,name,config=this.config,mods=config.modules,groups=config.groups,aliases=config.aliases,loader=this.Env._loader;for(name in o)o.hasOwnProperty(name)&&(attr=o[name],mods&&"modules"==name?clobber(mods,attr):aliases&&"aliases"==name?clobber(aliases,attr):groups&&"groups"==name?clobber(groups,attr):"win"==name?(config[name]=attr&&attr.contentWindow||attr,config.doc=config[name]?config[name].document:null):"_yuid"==name||(config[name]=attr));loader&&loader._config(o)},_config:function(o){this.applyConfig(o)},_init:function(){var filter,el,prop,Y=this,G_ENV=YUI.Env,Env=Y.Env;if(Y.version=VERSION,!Env){if(Y.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:BASE,cdn:BASE+VERSION+"/",_idx:0,_used:{},_attached:{},_exported:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(src,pattern){var path,filter,match=src.match(pattern);return match&&(path=RegExp.leftContext||src.slice(0,src.indexOf(match[0])),filter=match[3],match[1]&&(path+="?"+match[1]),path={filter:filter,path:path}),path},getBase:G_ENV&&G_ENV.getBase||function(pattern){var parsed,i,len,src,nodes=doc&&doc.getElementsByTagName("script")||[],path=Env.cdn;for(i=0,len=nodes.length;i
',YUI.Env.cssStampEl=el.firstChild,doc.body?doc.body.appendChild(YUI.Env.cssStampEl):docEl.insertBefore(YUI.Env.cssStampEl,docEl.firstChild)):doc&&doc.getElementById("yui3-css-stamp")&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=doc.getElementById("yui3-css-stamp")),Y.config.lang=Y.config.lang||"en-US",Y.config.base=YUI.config.base||YUI.config.defaultBase&&YUI.config.root&&YUI.config.defaultBase+YUI.config.root||Y.Env.getBase(Y.Env._BASE_RE),filter&&"mindebug".indexOf(filter)||(filter="min"),filter=filter?"-"+filter:filter,Y.config.loaderPath=YUI.config.loaderPath||"loader/loader"+filter+".js"},_afterConfig:function(){this.config.hasOwnProperty("global")||(this.config.global=Function("return this")())},_setup:function(){var i,Y=this,core=[],mods=YUI.Env.mods,extendedCore=Y.config.extendedCore||[],extras=Y.config.core||[].concat(YUI.Env.core).concat(extendedCore);for(i=0;i-1)for(j="YAHOO"==(d=arg.split("."))[0]?1:0;j-1?value(o,key):o[key];return void 0===val?match:val})):s},L.trim=L._isNative(STRING_PROTO.trim)&&!WHITESPACE.trim()?function(s){return s&&s.trim?s.trim():s}:function(s){try{return s.replace(TRIMREGEX,"")}catch(e){return s}},L.trimLeft=L._isNative(STRING_PROTO.trimLeft)&&!WHITESPACE.trimLeft()?function(s){return s.trimLeft()}:function(s){return s.replace(TRIM_LEFT_REGEX,"")},L.trimRight=L._isNative(STRING_PROTO.trimRight)&&!WHITESPACE.trimRight()?function(s){return s.trimRight()}:function(s){return s.replace(TRIM_RIGHT_REGEX,"")},L.type=function(o){return TYPES[typeof o]||TYPES[TOSTRING.call(o)]||(o?"object":"null")};var Lang=Y.Lang,Native=Array.prototype,hasOwn=Object.prototype.hasOwnProperty;function YArray(thing,startIndex,force){var len,result;if(startIndex||(startIndex=0),force||YArray.test(thing))try{return Native.slice.call(thing,startIndex)}catch(ex){for(result=[],len=thing.length;startIndexi&&i in values)||values[i]);return hash},YArray.indexOf=Lang._isNative(Native.indexOf)?function(array,value,from){return Native.indexOf.call(array,value,from)}:function(array,value,from){var len=array.length;for((from=((from=+from||0)>0||-1)*Math.floor(Math.abs(from)))<0&&(from+=len)<0&&(from=0);from1?Array.prototype.join.call(arguments,"__"):String(arg);return(!(key in cache)||refetch&&cache[key]==refetch)&&(cache[key]=source.apply(source,arguments)),cache[key]}},Y.getLocation=function(){var win=Y.config.win;return win&&win.location},Y.merge=function(){for(var key,obj,i=0,len=arguments.length,result={};i-1},O.each=function(obj,fn,thisObj,proto){var key;for(key in obj)(proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj);return Y},O.some=function(obj,fn,thisObj,proto){var key;for(key in obj)if((proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj))return!0;return!1},O.getValue=function(o,path){if(Lang.isObject(o)){var i,p=Y.Array(path),l=p.length;for(i=0;undefined!==o&&i=0){for(i=0;undefined!==ref&&i0),subUA||("object"==typeof process&&process.versions&&process.versions.node&&(o.os=process.platform,o.nodejs=numberify(process.versions.node)),YUI.Env.UA=o),o},Y.UA=YUI.Env.UA||YUI.Env.parseUA(),Y.UA.compareVersions=function(a,b){var aPart,aParts,bPart,bParts,i,len;if(a===b)return 0;for(aParts=(a+"").split("."),bParts=(b+"").split("."),i=0,len=Math.max(aParts.length,bParts.length);ibPart)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],"loader-pathogen-encoder":["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",(function(Y,NAME){var CUSTOM_ATTRS,Get,Transaction,Lang=Y.Lang;Y.Get=Get={cssOptions:{attributes:{rel:"stylesheet"},doc:Y.config.linkDoc||Y.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:Y.config.scriptDoc||Y.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(transaction){var i,id,item,len,pending;if(Y.log("`Y.Get.abort()` is deprecated as of 3.5.0. Use the `abort()` method on the transaction instead.","warn","get"),!transaction.abort)if(id=transaction,transaction=null,(pending=this._pending)&&pending.transaction.id===id)transaction=pending.transaction,this._pending=null;else for(i=0,len=this._queue.length;i=threshold&&(Y.log("autopurge triggered after "+this._purgeNodes.length+" nodes","info","get"),this._purge(this._purgeNodes))},_getEnv:function(){var doc=Y.config.doc,ua=Y.UA;return this._env={async:doc&&!0===doc.createElement("script").async||ua.ie>=10,cssFail:ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0,cssLoad:(!ua.gecko&&!ua.webkit||ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0)&&!(ua.chrome&&ua.chrome<=18),preservesScriptOrder:!!(ua.gecko||ua.opera||ua.ie&&ua.ie>=10)}},_getTransaction:function(urls,options){var i,len,req,url,requests=[];for(Lang.isArray(urls)||(urls=[urls]),(options=Y.merge(this.options,options)).attributes=Y.merge(this.options.attributes,options.attributes),i=0,len=urls.length;i-1&&purgeNodes.splice(index,1))}},Get.script=Get.js,Get.Transaction=Transaction=function(requests,options){this.id=Transaction._lastId+=1,this.data=options.data,this.errors=[],this.nodes=[],this.options=options,this.requests=requests,this._callbacks=[],this._queue=[],this._reqsWaiting=0,this.tId=this.id,this.win=options.win||Y.config.win},Transaction._lastId=0,Transaction.prototype={_state:"new",abort:function(msg){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:msg||"Aborted"}),this._finish()},execute:function(callback){var i,len,queue,req,self=this,requests=self.requests,state=self._state;if("done"!==state){if(callback&&self._callbacks.push(callback),"executing"!==state){for(self._state="executing",self._queue=queue=[],self.options.timeout&&(self._timeout=setTimeout((function(){self.abort("Timeout")}),self.options.timeout)),self._reqsWaiting=requests.length,i=0,len=requests.length;i=10?(node.onerror=function(){setTimeout(onError,0)},node.onload=function(){setTimeout(onLoad,0)}):(node.onerror=onError,node.onload=onLoad),env.cssFail||isScript||(cssTimeout=setTimeout(onError,req.timeout||3e3))):this._poll(req),this.nodes.push(node),insertBefore.parentNode.insertBefore(node,insertBefore)},_next:function(){this._pending||(this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish())},_poll:function(newReq){var i,j,nodeHref,req,sheets,self=this,pendingCSS=self._pendingCSS,isWebKit=Y.UA.webkit;if(!newReq||(pendingCSS||(pendingCSS=self._pendingCSS=[]),pendingCSS.push(newReq),!self._pollTimer)){for(self._pollTimer=null,i=0;i=0;)if(sheets[j].href===nodeHref){pendingCSS.splice(i,1),i-=1,self._progress(null,req);break}}else try{!!req.node.sheet.cssRules,pendingCSS.splice(i,1),i-=1,self._progress(null,req)}catch(ex){}pendingCSS.length&&(self._pollTimer=setTimeout((function(){self._poll.call(self)}),self.options.pollInterval))}},_progress:function(err,req){var options=this.options;err&&(req.error=err,this.errors.push({error:err,request:req}),Y.log(err,"error","get")),req.node._yuiget_finished=req.finished=!0,options.onProgress&&options.onProgress.call(options.context||this,this._getEventData(req)),req.autopurge&&(Get._autoPurge(this.options.purgethreshold),Get._purgeNodes.push(req.node)),this._pending===req&&(this._pending=null),this._reqsWaiting-=1,this._next()}}}),"3.18.1",{requires:["yui-base"]}),YUI.add("features",(function(Y,NAME){var feature_tests={};Y.mix(Y.namespace("Features"),{tests:feature_tests,add:function(cat,name,o){feature_tests[cat]=feature_tests[cat]||{},feature_tests[cat][name]=o},all:function(cat,args){var cat_o=feature_tests[cat],result=[];return cat_o&&Y.Object.each(cat_o,(function(v,k){result.push(k+":"+(Y.Features.test(cat,k,args)?1:0))})),result.length?result.join(";"):""},test:function(cat,name,args){args=args||[];var result,ua,test,cat_o=feature_tests[cat],feature=cat_o&&cat_o[name];return feature?(result=feature.result,Y.Lang.isUndefined(result)&&((ua=feature.ua)&&(result=Y.UA[ua]),!(test=feature.test)||ua&&!result||(result=test.apply(Y,args)),feature.result=result)):Y.log("Feature test "+cat+", "+name+" not found"),result}});var add=Y.Features.add;add("load","0",{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"}),add("load","1",{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"}),add("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),add("load","3",{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"}),add("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),add("load","5",{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"}),add("load","6",{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","7",{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","8",{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","9",{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","10",{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","11",{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","12",{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"}),add("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),add("load","14",{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"}),add("load","15",{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"}),add("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),add("load","17",{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"}),add("load","18",{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"}),add("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),add("load","20",{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"}),add("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs"}),add("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs"})}),"3.18.1",{requires:["yui-base"]}),YUI.add("intl-base",(function(Y,NAME){var SPLIT_REGEX=/[, ]/;Y.mix(Y.namespace("Intl"),{lookupBestLang:function(preferredLanguages,availableLanguages){var i,language,result,index;function scan(language){var i;for(i=0;i0;){if(result=scan(language))return result;if(!((index=language.lastIndexOf("-"))>=0))break;language=language.substring(0,index),index>=2&&"-"===language.charAt(index-2)&&(language=language.substring(0,index-2))}return""}})}),"3.18.1",{requires:["yui-base"]}),YUI.add("yui-log",(function(Y,NAME){var INSTANCE=Y,LEVELS={debug:1,info:2,warn:4,error:8};INSTANCE.log=function(msg,cat,src,silent){var bail,excl,incl,m,f,minlevel,Y=INSTANCE,c=Y.config,publisher=Y.fire?Y:YUI.Env.globalEvents;return c.debug&&(void 0!==(src=src||"")&&(excl=c.logExclude,(incl=c.logInclude)&&!(src in incl)?bail=1:incl&&src in incl?bail=!incl[src]:excl&&src in excl&&(bail=excl[src]),void 0===cat&&(cat="info"),Y.config.logLevel=Y.config.logLevel||"debug",minlevel=LEVELS[Y.config.logLevel.toLowerCase()],cat in LEVELS&&LEVELS[cat]-1,this.comboSep="&",this.maxURLLength=1024,this.ignoreRegistered=o.ignoreRegistered,this.root=Y.Env.meta.root,this.timeout=0,this.forceMap={},this.allowRollup=!1,this.filters={},this.required={},this.patterns={},this.moduleInfo={},this.groups=Y.merge(Y.Env.meta.groups),this.skin=Y.merge(Y.Env.meta.skin),this.conditions={},this.config=o,this._internal=!0,this._populateConditionsCache(),this.loaded=GLOBAL_LOADED[VERSION],this.async=!0,this._inspectPage(),this._internal=!1,this._config(o),this.forceMap=this.force?Y.Array.hash(this.force):{},this.testresults=null,Y.config.tests&&(this.testresults=Y.config.tests),this.sorted=[],this.dirty=!0,this.inserted={},this.skipped={},this.tested={},this.ignoreRegistered&&this._resetModules()},Y.Loader.prototype={getModuleInfo:function(name){var rawMetaModules,globalRenderedMods,internal,v,m=this.moduleInfo[name];return m||(rawMetaModules=META.modules,globalRenderedMods=GLOBAL_ENV._renderedMods,internal=this._internal,globalRenderedMods&&globalRenderedMods.hasOwnProperty(name)&&!this.ignoreRegistered?this.moduleInfo[name]=Y.merge(globalRenderedMods[name]):rawMetaModules.hasOwnProperty(name)&&(this._internal=!0,(v=this.addModule(rawMetaModules[name],name))&&v.type===CSS&&this.isCSSLoaded(v.name,!0)&&(Y.log("Found CSS module on page: "+v.name,"info","loader"),this.loaded[v.name]=!0),this._internal=internal),this.moduleInfo[name])},_expandAliases:function(list){var i,name,expanded=[],aliases=YUI.Env.aliases;for(list=Y.Array(list),i=0;i-1&&(skinpar=i);if(skindef&&(skindef[name]||skinpar&&skindef[skinpar]))for(skinname=name,skindef[skinpar]&&(skinname=skinpar),i=0;i-1},getModule:function(mname){if(!mname)return null;var p,found,pname,m=this.getModuleInfo(mname),patterns=this.patterns;if(!m||m&&m.ext)for(pname in patterns)if(patterns.hasOwnProperty(pname)&&((p=patterns[pname]).test||(p.test=this._patternTest),p.test(mname,pname))){found=p;break}return m?found&&m&&found.configFn&&!m.configFn&&(m.configFn=found.configFn,m.configFn(m)):found&&(p.action?p.action.call(this,mname,pname):(Y.log("Undefined module: "+mname+", matched a pattern: "+pname,"info","loader"),(m=this.addModule(Y.merge(found,{test:void 0,temp:!0}),mname))&&found.configFn&&(m.configFn=found.configFn))),m},_rollup:function(){},_reduce:function(r){r=r||this.required;var i,j,s,m,type=this.loadType,ignore=!!this.ignore&&yArray.hash(this.ignore);for(i in r)if(r.hasOwnProperty(i)&&(m=this.getModule(i),((this.loaded[i]||ON_PAGE[i])&&!this.forceMap[i]&&!this.ignoreRegistered||type&&m&&m.type!==type)&&delete r[i],ignore&&ignore[i]&&delete r[i],s=m&&m.supersedes))for(j=0;j0&&(_queue.running=!0,_queue.next()())},insert:function(o,type,skipsort){Y.log("public insert() "+(type||"")+", "+Y.Object.keys(this.required),"info","loader");var self=this,copy=Y.merge(this);delete copy.require,delete copy.dirty,_queue.add((function(){self._insert(copy,o,type,skipsort)})),this._continue()},loadNext:function(){Y.log("loadNext was called..","error","loader")},_filter:function(u,name,group){var f=this.filter,hasFilter=name&&name in this.filters,modFilter=hasFilter&&this.filters[name],groupName=group||(this.getModuleInfo(name)||{}).group||null;return groupName&&this.groups[groupName]&&this.groups[groupName].filter&&(modFilter=this.groups[groupName].filter,hasFilter=!0),u&&(hasFilter&&(f=L.isString(modFilter)?this.FILTER_DEFS[modFilter.toUpperCase()]||null:modFilter),f&&(u=u.replace(new RegExp(f.searchExp,"g"),f.replaceStr))),u},_url:function(path,name,base){return this._filter((base||this.base||"")+path,name)},resolve:function(calc,sorted){var addSingle,self=this,resolved={js:[],jsMods:[],css:[],cssMods:[]},usePathogen=Y.config.comboLoader&&Y.config.customComboBase;(self.skin.overrides||"sam"!==self.skin.defaultSkin||self.ignoreRegistered)&&self._resetModules(),calc&&self.calculate(),sorted=sorted||self.sorted,addSingle=function(mod){if(mod){var url,group=mod.group&&self.groups[mod.group]||NOT_FOUND;!1===group.async&&(mod.async=group.async),url=mod.fullpath?self._filter(mod.fullpath,mod.name):self._url(mod.path,mod.name,group.base||mod.base),(mod.attributes||!1===mod.async)&&(url={url:url,async:mod.async},mod.attributes&&(url.attributes=mod.attributes)),resolved[mod.type].push(url),resolved[mod.type+"Mods"].push(mod)}else Y.log("Undefined Module","warn","loader")};var comboSources,maxURLLength,comboMeta,comboBase,comboSep,group,mod,len,i,inserted=self.ignoreRegistered?{}:self.inserted,hasComboModule=!1;for(i=0,len=sorted.length;imaxURLLength){for(Y.log("Exceeded maxURLLength ("+maxURLLength+") for "+type+", splitting","info","loader"),fragSubset=[],i=0,len=frags.length;imaxURLLength&&(frag=fragSubset.pop(),tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)),fragSubset=[],frag&&fragSubset.push(frag));fragSubset.length&&(tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)))}else resolved[type].push(this._filter(tmpBase,null,comboMeta.group))}return resolved},load:function(cb){if(cb){var self=this,out=self.resolve(!0);self.data=out,self.onEnd=function(){cb.apply(self.context||self,arguments)},self.insert()}else Y.log("No callback supplied to load()","error","loader")}}}),"3.18.1",{requires:["get","features"]}),YUI.add("loader-rollup",(function(Y,NAME){Y.Loader.prototype._rollup=function(){var i,j,m,s,roll,rolled,c,smod,r=this.required,info=this.moduleInfo;if(this.dirty||!this.rollups)for(i in this.rollups={},info)info.hasOwnProperty(i)&&(m=this.getModule(i))&&m.rollup&&(this.rollups[i]=m);for(;;){for(i in rolled=!1,this.rollups)if(this.rollups.hasOwnProperty(i)&&!r[i]&&(!this.loaded[i]||this.forceMap[i])){if(s=(m=this.getModule(i)).supersedes||[],roll=!1,!m.rollup)continue;for(c=0,j=0;j=m.rollup))break}roll&&(r[i]=!0,rolled=!0,this.getRequires(m))}if(!rolled)break}}}),"3.18.1",{requires:["loader-base"]}),YUI.add("loader-yui3",(function(Y,NAME){YUI.Env[Y.version].modules=YUI.Env[Y.version].modules||{},Y.mix(YUI.Env[Y.version].modules,{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style","color-base"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-observable","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{use:["attribute-observable"]},"attribute-extras":{requires:["oop"]},"attribute-observable":{requires:["event-custom"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en","es","hu","it"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},axes:{use:["axis-numeric","axis-category","axis-time","axis-stacked"]},"axes-base":{use:["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"]},axis:{requires:["dom","widget","widget-position","widget-stack","graphics","axis-base"]},"axis-base":{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]},"axis-category":{requires:["axis","axis-category-base"]},"axis-category-base":{requires:["axis-base"]},"axis-numeric":{requires:["axis","axis-numeric-base"]},"axis-numeric-base":{requires:["axis-base"]},"axis-stacked":{requires:["axis-numeric","axis-stacked-base"]},"axis-stacked-base":{requires:["axis-numeric-base"]},"axis-time":{requires:["axis","axis-time-base"]},"axis-time-base":{requires:["axis-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{requires:["attribute-base","base-core","base-observable"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-observable":{requires:["attribute-observable","base-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base","escape"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","es","es-AR","fr","hu","it","ja","nb-NO","nl","pt-BR","ru","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-HANT-TW"],requires:["widget","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0},charts:{use:["charts-base"]},"charts-base":{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},color:{use:["color-base","color-hsl","color-harmony"]},"color-base":{requires:["yui-base"]},"color-harmony":{requires:["color-hsl"]},"color-hsl":{requires:["color-base"]},"color-hsv":{requires:["color-base"]},console:{lang:["en","es","hu","it","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},"content-editable":{requires:["node-base","editor-selection","stylesheet","plugin"]},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssnormalize"],type:"css"},"cssgrids-base":{optional:["cssnormalize"],type:"css"},"cssgrids-responsive":{optional:["cssnormalize"],requires:["cssgrids","cssgrids-responsive-base"],type:"css"},"cssgrids-units":{optional:["cssnormalize"],requires:["cssgrids-base"],type:"css"},cssnormalize:{type:"css"},"cssnormalize-context":{type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-foot":{requires:["datatable-core","view"]},"datatable-formatters":{requires:["datatable-body","datatype-number-format","datatype-date-format","escape"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-highlight":{requires:["datatable-base","event-hover"],skinnable:!0},"datatable-keynav":{requires:["datatable-base"]},"datatable-message":{lang:["en","fr","es","hu","it"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-paginator":{lang:["en","fr"],requires:["model","view","paginator-core","datatable-foot","datatable-paginator-templates"],skinnable:!0},"datatable-paginator-templates":{requires:["template"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-sort":{lang:["en","fr","es","hu"],requires:["datatable-base"],skinnable:!0},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","hu","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{requires:["escape"]},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base","selector-css2"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es","hu"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"},requires:["dom-style","color-base"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-inline":{requires:["editor-base","content-editable"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","plugin","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}},"graphics-group":{requires:["graphics"]},"graphics-svg":{condition:{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-pathogen-combohandler":{},"loader-pathogen-encoder":{use:["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-local":{requires:["model","json-stringify"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base","dom-style"]},"node-core":{requires:["dom-core","selector"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},paginator:{requires:["paginator-core"]},"paginator-core":{requires:["base"]},"paginator-url":{requires:["paginator"]},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swfdetect","escape","widget","base","cssbutton","node","event-custom","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"},requires:["yql","jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs"},requires:["yql"]},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs"},requires:["yql"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[Y.version].md5="2fd2be6b12ee9f999b4367499ae61aae"}),"3.18.1",{requires:["loader-base"]}),YUI.add("yui",(function(Y,NAME){}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,(function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))})),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),(function(e){t=t[e]})),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function i(e,i,r){var o,a,s,u,c,d,p,f,l,h,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(d=(e=e.split("/")).length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),function(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&v&&(g||x)){e:for(s=(a=e.split("/")).length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if((o=getOwn(v,g.slice(0,u).join("/")))&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return getOwn(y.pkgs,e)||e}function r(e){isBrowser&&each(scripts(),(function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0}))}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),d=(c=o(e))[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=s&&s.normalize?s.normalize(e,(function(e){return i(e,p,n)})):-1===e.indexOf("!")?i(e,p,n):e:(d=(c=o(h=i(e,p,n)))[0],h=c[1],r=!0,a=q.nameToUrl(h))),{prefix:d,name:h,parentMap:t,unnormalized:!!(u=!d||s||r?"":"_unnormalized"+(A+=1)),url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,(function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))})),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,(function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)})),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,(function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))})),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,(function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1})),o&&a.length)return(e=makeError("timeout","Load timeout for modules: "+a,null,a)).contextName=q.contextName,c(e);d&&each(s,(function(e){f(e,{},{})})),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout((function(){w=0,l()}),50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(null===(e=O.shift())[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,(function(e){this.emit("error",e)}))),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return e.prefix?this.callPlugin():this.load()}))):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((t=this.module)?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,(function(e){a.push(e.normalizedMap||e)})),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,(function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,(function(e){return i(e,h,!0)}))||""),u(o=a(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,(function(e){this.map.normalizedMap=o,this.init([],(function(){return e}),null,{enabled:!0,ignore:!0})}))),void((d=getOwn(S,o.id))&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,(function(e){this.emit("error",e)}))),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,(function(e){this.init([],(function(){return e}),null,{enabled:!0})})),n.error=bind(this,(function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,(function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)})),c(e)})),n.fromText=bind(this,(function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)})),void r.load(e.name,m,n,y))}))),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,(function(e){this.undefed||(this.defineDep(t,e),this.check())}))),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,(function(e){this.emit("error",e)})))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)}))),eachProp(this.pluginMaps,bind(this,(function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)}))),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],(function(e){e(t)})),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(-1===i.indexOf("?")?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,(function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e})),e.bundles&&eachProp(e.bundles,(function(e,t){each(e,(function(e){e!==t&&(R[e]=t)}))})),e.shim&&(eachProp(e.shim,(function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e})),y.shim=i),e.packages&&each(e.packages,(function(e){var i;i=(e="string"==typeof e?{name:e}:e).name,e.location&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(S,(function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))})),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,n){function o(i,r,u){var d,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(d=a(i,t,!1,!0).id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick((function(){v(),(f=s(a(null,t))).skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()})),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,(function(t,i){t[0]===e&&O.splice(i,1)})),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){getOwn(S,e.id)&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(null===(i=O.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,o=(n=e.split("/")).length;o>0;o-=1)if(u=getOwn(r,n.slice(0,o).join("/"))){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s=("/"===(s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js")).charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,(function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,(function(e){if(e.id===t.id)return i.push(r),!0}))})),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(e){if("interactive"===e.readyState)return interactiveScript=e})),interactiveScript}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return(r=req.createNode(n,t,i)).setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(e,i){t.push(i)})),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&((r=currentlyAddingScript||getInteractiveScript())&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(match,singlePrefix){return singlePrefix||""}function isFunction(it){return"[object Function]"===ostring.call(it)}function isArray(it){return"[object Array]"===ostring.call(it)}function each(ary,func){var i;if(ary)for(i=0;i-1&&(!ary[i]||!func(ary[i],i,ary));i-=1);}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return hasProp(obj,prop)&&obj[prop]}function eachProp(obj,func){var prop;for(prop in obj)if(hasProp(obj,prop)&&func(obj[prop],prop))break}function mixin(target,source,force,deepStringMixin){return source&&eachProp(source,(function(value,prop){!force&&hasProp(target,prop)||(!deepStringMixin||"object"!=typeof value||!value||isArray(value)||isFunction(value)||value instanceof RegExp?target[prop]=value:(target[prop]||(target[prop]={}),mixin(target[prop],value,force,deepStringMixin)))})),target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(err){throw err}function getGlobal(value){if(!value)return value;var g=global;return each(value.split("."),(function(part){g=g[part]})),g}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);return e.requireType=id,e.requireModules=requireModules,err&&(e.originalError=err),e}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;return isArray(deps)||"string"==typeof deps||(config=deps,isArray(callback)?(deps=callback,callback=errback,errback=optional):deps=[]),config&&config.context&&(contextName=config.context),(context=getOwn(contexts,contextName))||(context=contexts[contextName]=req.s.newContext(contextName)),config&&context.configure(config),context.require(deps,callback,errback)},req.config=function(config){return req(config)},req.nextTick=void 0!==setTimeout?function(fn){setTimeout(fn,4)}:function(fn){fn()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(prop){req[prop]=function(){var ctx=contexts[defContextName];return ctx.require[prop].apply(ctx,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(config,moduleName,url){var node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return node.type=config.scriptType||"text/javascript",node.charset="utf-8",node.async=!0,node},req.load=function(context,moduleName,url){var node,config=context&&context.config||{};if(isBrowser)return(node=req.createNode(config,moduleName,url)).setAttribute("data-requirecontext",context.contextName),node.setAttribute("data-requiremodule",moduleName),!node.attachEvent||node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0||isOpera?(node.addEventListener("load",context.onScriptLoad,!1),node.addEventListener("error",context.onScriptError,!1)):(useInteractive=!0,node.attachEvent("onreadystatechange",context.onScriptLoad)),node.src=url,config.onNodeCreated&&config.onNodeCreated(node,config,moduleName,url),currentlyAddingScript=node,baseElement?head.insertBefore(node,baseElement):head.appendChild(node),currentlyAddingScript=null,node;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(url),context.completeLoad(moduleName)}catch(e){context.onError(makeError("importscripts","importScripts failed for "+moduleName+" at "+url,e,[moduleName]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(script){if(head||(head=script.parentNode),dataMain=script.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(name,deps,callback){var node,context;"string"!=typeof name&&(callback=deps,deps=name,name=null),isArray(deps)||(callback=deps,deps=null),!deps&&isFunction(callback)&&(deps=[],callback.length&&(callback.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(match,dep){deps.push(dep)})),deps=(1===callback.length?["require"]:["require","exports","module"]).concat(deps))),useInteractive&&(node=currentlyAddingScript||getInteractiveScript())&&(name||(name=node.getAttribute("data-requiremodule")),context=contexts[node.getAttribute("data-requirecontext")]),context?(context.defQueue.push([name,deps,callback]),context.defQueueMap[name]=!0):globalDefQueue.push([name,deps,callback])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},registry={},enabledRegistry={},undefEvents={},defQueue=[],defined={},urlFetched={},bundlesMap={},requireCounter=1,unnormalizedCounter=1;function normalize(name,baseName,applyMap){var mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"];if(name&&(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=baseParts.slice(0,baseParts.length-1).concat(name)),function(ary){var i,part;for(i=0;i0&&(ary.splice(i-1,2),i-=2)}}(name),name=name.join("/")),applyMap&&map&&(baseParts||starMap)){outerLoop:for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=getOwn(map,baseParts.slice(0,j).join("/")))&&(mapValue=getOwn(mapValue,nameSegment))){foundMap=mapValue,foundI=i;break outerLoop}!foundStarMap&&starMap&&getOwn(starMap,nameSegment)&&(foundStarMap=getOwn(starMap,nameSegment),starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return getOwn(config.pkgs,name)||name}function removeScript(name){isBrowser&&each(scripts(),(function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName)return scriptNode.parentNode.removeChild(scriptNode),!0}))}function hasPathFallback(id){var pathConfig=getOwn(config.paths,id);if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1)return pathConfig.shift(),context.require.undef(id),context.makeRequire(null,{skipMap:!0})([id]),!0}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,nameParts,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=!0,normalizedName="";return name||(isDefine=!1,name="_@r"+(requireCounter+=1)),prefix=(nameParts=splitPrefix(name))[0],name=nameParts[1],prefix&&(prefix=normalize(prefix,parentName,applyMap),pluginModule=getOwn(defined,prefix)),name&&(prefix?normalizedName=pluginModule&&pluginModule.normalize?pluginModule.normalize(name,(function(name){return normalize(name,parentName,applyMap)})):-1===name.indexOf("!")?normalize(name,parentName,applyMap):name:(prefix=(nameParts=splitPrefix(normalizedName=normalize(name,parentName,applyMap)))[0],normalizedName=nameParts[1],isNormalized=!0,url=context.nameToUrl(normalizedName))),{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!(suffix=!prefix||pluginModule||isNormalized?"":"_unnormalized"+(unnormalizedCounter+=1)),url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=getOwn(registry,id);return mod||(mod=registry[id]=new context.Module(depMap)),mod}function on(depMap,name,fn){var id=depMap.id,mod=getOwn(registry,id);!hasProp(defined,id)||mod&&!mod.defineEmitComplete?(mod=getModule(depMap)).error&&"error"===name?fn(mod.error):mod.on(name,fn):"defined"===name&&fn(defined[id])}function onError(err,errback){var ids=err.requireModules,notified=!1;errback?errback(err):(each(ids,(function(id){var mod=getOwn(registry,id);mod&&(mod.error=err,mod.events.error&&(notified=!0,mod.emit("error",err)))})),notified||req.onError(err))}function takeGlobalQueue(){globalDefQueue.length&&(each(globalDefQueue,(function(queueItem){var id=queueItem[0];"string"==typeof id&&(context.defQueueMap[id]=!0),defQueue.push(queueItem)})),globalDefQueue=[])}function cleanRegistry(id){delete registry[id],delete enabledRegistry[id]}function breakCycle(mod,traced,processed){var id=mod.map.id;mod.error?mod.emit("error",mod.error):(traced[id]=!0,each(mod.depMaps,(function(depMap,i){var depId=depMap.id,dep=getOwn(registry,depId);!dep||mod.depMatched[i]||processed[depId]||(getOwn(traced,depId)?(mod.defineDep(i,defined[depId]),mod.check()):breakCycle(dep,traced,processed))})),processed[id]=!0)}function checkLoaded(){var err,usingPathFallback,waitInterval=1e3*config.waitSeconds,expired=waitInterval&&context.startTime+waitInterval<(new Date).getTime(),noLoads=[],reqCalls=[],stillLoading=!1,needCycleCheck=!0;if(!inCheckLoaded){if(inCheckLoaded=!0,eachProp(enabledRegistry,(function(mod){var map=mod.map,modId=map.id;if(mod.enabled&&(map.isDefine||reqCalls.push(mod),!mod.error))if(!mod.inited&&expired)hasPathFallback(modId)?(usingPathFallback=!0,stillLoading=!0):(noLoads.push(modId),removeScript(modId));else if(!mod.inited&&mod.fetched&&map.isDefine&&(stillLoading=!0,!map.prefix))return needCycleCheck=!1})),expired&&noLoads.length)return(err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads)).contextName=context.contextName,onError(err);needCycleCheck&&each(reqCalls,(function(mod){breakCycle(mod,{},{})})),expired&&!usingPathFallback||!stillLoading||!isBrowser&&!isWebWorker||checkLoadedTimeoutId||(checkLoadedTimeoutId=setTimeout((function(){checkLoadedTimeoutId=0,checkLoaded()}),50)),inCheckLoaded=!1}}function callGetModule(args){hasProp(defined,args[0])||getModule(makeModuleMap(args[0],null,!0)).init(args[1],args[2])}function removeListener(node,func,name,ieName){node.detachEvent&&!isOpera?ieName&&node.detachEvent(ieName,func):node.removeEventListener(name,func,!1)}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;return removeListener(node,context.onScriptLoad,"load","onreadystatechange"),removeListener(node,context.onScriptError,"error"),{node:node,id:node&&node.getAttribute("data-requiremodule")}}function intakeDefines(){var args;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0])return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]));callGetModule(args)}context.defQueueMap={}}return handlers={require:function(mod){return mod.require?mod.require:mod.require=context.makeRequire(mod.map)},exports:function(mod){if(mod.usingExports=!0,mod.map.isDefine)return mod.exports?defined[mod.map.id]=mod.exports:mod.exports=defined[mod.map.id]={}},module:function(mod){return mod.module?mod.module:mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return getOwn(config.config,mod.map.id)||{}},exports:mod.exports||(mod.exports={})}}},(Module=function(map){this.events=getOwn(undefEvents,map.id)||{},this.map=map,this.shim=getOwn(config.shim,map.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(depMaps,factory,errback,options){options=options||{},this.inited||(this.factory=factory,errback?this.on("error",errback):this.events.error&&(errback=bind(this,(function(err){this.emit("error",err)}))),this.depMaps=depMaps&&depMaps.slice(0),this.errback=errback,this.inited=!0,this.ignore=options.ignore,options.enabled||this.enabled?this.enable():this.check())},defineDep:function(i,depExports){this.depMatched[i]||(this.depMatched[i]=!0,this.depCount-=1,this.depExports[i]=depExports)},fetch:function(){if(!this.fetched){this.fetched=!0,context.startTime=(new Date).getTime();var map=this.map;if(!this.shim)return map.prefix?this.callPlugin():this.load();context.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return map.prefix?this.callPlugin():this.load()})))}},load:function(){var url=this.map.url;urlFetched[url]||(urlFetched[url]=!0,context.load(this.map.id,url))},check:function(){if(this.enabled&&!this.enabling){var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}else exports=context.execCb(id,factory,depExports,exports);if(this.map.isDefine&&void 0===exports&&((cjsModule=this.module)?exports=cjsModule.exports:this.usingExports&&(exports=this.exports)),err)return err.requireMap=this.map,err.requireModules=this.map.isDefine?[this.map.id]:null,err.requireType=this.map.isDefine?"define":"require",onError(this.error=err)}else exports=factory;if(this.exports=exports,this.map.isDefine&&!this.ignore&&(defined[id]=exports,req.onResourceLoad)){var resLoadMaps=[];each(this.depMaps,(function(depMap){resLoadMaps.push(depMap.normalizedMap||depMap)})),req.onResourceLoad(context,this.map,resLoadMaps)}cleanRegistry(id),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(context.defQueueMap,id)||this.fetch()}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix);this.depMaps.push(pluginMap),on(pluginMap,"defined",bind(this,(function(plugin){var load,normalizedMap,normalizedMod,bundleId=getOwn(bundlesMap,this.map.id),name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null,localRequire=context.makeRequire(map.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(plugin.normalize&&(name=plugin.normalize(name,(function(name){return normalize(name,parentName,!0)}))||""),on(normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap),"defined",bind(this,(function(value){this.map.normalizedMap=normalizedMap,this.init([],(function(){return value}),null,{enabled:!0,ignore:!0})}))),void((normalizedMod=getOwn(registry,normalizedMap.id))&&(this.depMaps.push(normalizedMap),this.events.error&&normalizedMod.on("error",bind(this,(function(err){this.emit("error",err)}))),normalizedMod.enable()))):bundleId?(this.map.url=context.nameToUrl(bundleId),void this.load()):((load=bind(this,(function(value){this.init([],(function(){return value}),null,{enabled:!0})}))).error=bind(this,(function(err){this.inited=!0,this.error=err,err.requireModules=[id],eachProp(registry,(function(mod){0===mod.map.id.indexOf(id+"_unnormalized")&&cleanRegistry(mod.map.id)})),onError(err)})),load.fromText=bind(this,(function(text,textAlt){var moduleName=map.name,moduleMap=makeModuleMap(moduleName),hasInteractive=useInteractive;textAlt&&(text=textAlt),hasInteractive&&(useInteractive=!1),getModule(moduleMap),hasProp(config.config,id)&&(config.config[moduleName]=config.config[id]);try{req.exec(text)}catch(e){return onError(makeError("fromtexteval","fromText eval for "+id+" failed: "+e,e,[id]))}hasInteractive&&(useInteractive=!0),this.depMaps.push(moduleMap),context.completeLoad(moduleName),localRequire([moduleName],load)})),void plugin.load(map.name,localRequire,load,config))}))),context.enable(pluginMap,this),this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){enabledRegistry[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(depMap,i){var id,mod,handler;if("string"==typeof depMap){if(depMap=makeModuleMap(depMap,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=depMap,handler=getOwn(handlers,depMap.id))return void(this.depExports[i]=handler(this));this.depCount+=1,on(depMap,"defined",bind(this,(function(depExports){this.undefed||(this.defineDep(i,depExports),this.check())}))),this.errback?on(depMap,"error",bind(this,this.errback)):this.events.error&&on(depMap,"error",bind(this,(function(err){this.emit("error",err)})))}id=depMap.id,mod=registry[id],hasProp(handlers,id)||!mod||mod.enabled||context.enable(depMap,this)}))),eachProp(this.pluginMaps,bind(this,(function(pluginMap){var mod=getOwn(registry,pluginMap.id);mod&&!mod.enabled&&context.enable(pluginMap,this)}))),this.enabling=!1,this.check()},on:function(name,cb){var cbs=this.events[name];cbs||(cbs=this.events[name]=[]),cbs.push(cb)},emit:function(name,evt){each(this.events[name],(function(cb){cb(evt)})),"error"===name&&delete this.events[name]}},context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,defQueue:defQueue,defQueueMap:{},Module:Module,makeModuleMap:makeModuleMap,nextTick:req.nextTick,onError:onError,configure:function(cfg){if(cfg.baseUrl&&"/"!==cfg.baseUrl.charAt(cfg.baseUrl.length-1)&&(cfg.baseUrl+="/"),"string"==typeof cfg.urlArgs){var urlArgs=cfg.urlArgs;cfg.urlArgs=function(id,url){return(-1===url.indexOf("?")?"?":"&")+urlArgs}}var shim=config.shim,objs={paths:!0,bundles:!0,config:!0,map:!0};eachProp(cfg,(function(value,prop){objs[prop]?(config[prop]||(config[prop]={}),mixin(config[prop],value,!0,!0)):config[prop]=value})),cfg.bundles&&eachProp(cfg.bundles,(function(value,prop){each(value,(function(v){v!==prop&&(bundlesMap[v]=prop)}))})),cfg.shim&&(eachProp(cfg.shim,(function(value,id){isArray(value)&&(value={deps:value}),!value.exports&&!value.init||value.exportsFn||(value.exportsFn=context.makeShimExports(value)),shim[id]=value})),config.shim=shim),cfg.packages&&each(cfg.packages,(function(pkgObj){var name;name=(pkgObj="string"==typeof pkgObj?{name:pkgObj}:pkgObj).name,pkgObj.location&&(config.paths[name]=pkgObj.location),config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(registry,(function(mod,id){mod.inited||mod.map.unnormalized||(mod.map=makeModuleMap(id,null,!0))})),(cfg.deps||cfg.callback)&&context.require(cfg.deps||[],cfg.callback)},makeShimExports:function(value){return function(){var ret;return value.init&&(ret=value.init.apply(global,arguments)),ret||value.exports&&getGlobal(value.exports)}},makeRequire:function(relMap,options){function localRequire(deps,callback,errback){var id,requireMod;return options.enableBuildCallback&&callback&&isFunction(callback)&&(callback.__requireJsBuild=!0),"string"==typeof deps?isFunction(callback)?onError(makeError("requireargs","Invalid require call"),errback):relMap&&hasProp(handlers,deps)?handlers[deps](registry[relMap.id]):req.get?req.get(context,deps,relMap,localRequire):(id=makeModuleMap(deps,relMap,!1,!0).id,hasProp(defined,id)?defined[id]:onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName+(relMap?"":". Use require([])")))):(intakeDefines(),context.nextTick((function(){intakeDefines(),(requireMod=getModule(makeModuleMap(null,relMap))).skipMap=options.skipMap,requireMod.init(deps,callback,errback,{enabled:!0}),checkLoaded()})),localRequire)}return options=options||{},mixin(localRequire,{isBrowser:isBrowser,toUrl:function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0];return-1!==index&&(!("."===segment||".."===segment)||index>1)&&(ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length),moduleNamePlusExt=moduleNamePlusExt.substring(0,index)),context.nameToUrl(normalize(moduleNamePlusExt,relMap&&relMap.id,!0),ext,!0)},defined:function(id){return hasProp(defined,makeModuleMap(id,relMap,!1,!0).id)},specified:function(id){return id=makeModuleMap(id,relMap,!1,!0).id,hasProp(defined,id)||hasProp(registry,id)}}),relMap||(localRequire.undef=function(id){takeGlobalQueue();var map=makeModuleMap(id,relMap,!0),mod=getOwn(registry,id);mod.undefed=!0,removeScript(id),delete defined[id],delete urlFetched[map.url],delete undefEvents[id],eachReverse(defQueue,(function(args,i){args[0]===id&&defQueue.splice(i,1)})),delete context.defQueueMap[id],mod&&(mod.events.defined&&(undefEvents[id]=mod.events),cleanRegistry(id))}),localRequire},enable:function(depMap){getOwn(registry,depMap.id)&&getModule(depMap).enable()},completeLoad:function(moduleName){var found,args,mod,shim=getOwn(config.shim,moduleName)||{},shExports=shim.exports;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0]){if(args[0]=moduleName,found)break;found=!0}else args[0]===moduleName&&(found=!0);callGetModule(args)}if(context.defQueueMap={},mod=getOwn(registry,moduleName),!found&&!hasProp(defined,moduleName)&&mod&&!mod.inited){if(!(!config.enforceDefine||shExports&&getGlobal(shExports)))return hasPathFallback(moduleName)?void 0:onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]));callGetModule([moduleName,shim.deps||[],shim.exportsFn])}checkLoaded()},nameToUrl:function(moduleName,ext,skipExt){var paths,syms,i,url,parentPath,bundleId,pkgMain=getOwn(config.pkgs,moduleName);if(pkgMain&&(moduleName=pkgMain),bundleId=getOwn(bundlesMap,moduleName))return context.nameToUrl(bundleId,ext,skipExt);if(req.jsExtRegExp.test(moduleName))url=moduleName+(ext||"");else{for(paths=config.paths,i=(syms=moduleName.split("/")).length;i>0;i-=1)if(parentPath=getOwn(paths,syms.slice(0,i).join("/"))){isArray(parentPath)&&(parentPath=parentPath[0]),syms.splice(0,i,parentPath);break}url=syms.join("/"),url=("/"===(url+=ext||(/^data\:|^blob\:|\?/.test(url)||skipExt?"":".js")).charAt(0)||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs&&!/^blob\:/.test(url)?url+config.urlArgs(moduleName,url):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if("load"===evt.type||readyRegExp.test((evt.currentTarget||evt.srcElement).readyState)){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){var parents=[];return eachProp(registry,(function(value,key){0!==key.indexOf("_@r")&&each(value.depMaps,(function(depMap){if(depMap.id===data.id)return parents.push(key),!0}))})),onError(makeError("scripterror",'Script error for "'+data.id+(parents.length?'", needed by: '+parents.join(", "):'"'),evt,[data.id]))}}},context.require=context.makeRequire(),context}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(script){if("interactive"===script.readyState)return interactiveScript=script})),interactiveScript}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if("function"!=typeof n)throw new TypeError("Expected a function");return setTimeout((function(){n.apply(Z,r)}),t)}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!=n&&t!=t:function(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),l=(f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,"[object Object]"==f);c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,(function(t){return t[0]==n})),s=An(o,(function(n){return n[0]==t}));if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=function(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return!1;c=-1;for(var f=!0,a=2&r?[]:Z;++ct&&(t=-t>u?0:u+t),0>(r=r>u?u:r)&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++er?jn(e+r,0):r:0)||0)-1;for(var u=t==t;++rarguments.length,mn)}function G(n,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!=n&&t!=t}function M(n){var t;return(t=null!=n)&&(t="number"==typeof(t=n.length)&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&("[object Function]"==(n=hn.call(n))||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&"object"==typeof n}function K(n){return"number"==typeof n||H(n)&&"[object Number]"==hn.call(n)}function L(n){return"string"==typeof n||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return"string"==typeof n?n:null==n?"":n+""}function W(n){return null==n?[]:function(n,t){return j(t,(function(t){return n[t]}))}(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return mn(o,(function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})})),n}var Z,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un="object"==typeof self&&self&&self.Object===Object&&self,on="object"==typeof global&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un="object"==typeof exports&&exports&&!exports.nodeType&&exports)&&"object"==typeof module&&module&&!module.nodeType&&module,fn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;var mn=function(n){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=-1,i=Object(r);++o(r=null==r?0:Fn(r))&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&renable_solitairey_ui;return function(){const active={name:"freecell",game:null},yui=YUI({base:"js/yui-unpack/yui/build/"});let Y;const games={agnes:"Agnes",klondike:"Klondike",klondike1t:"Klondike1T","flower-garden":"FlowerGarden","forty-thieves":"FortyThieves",freecell:"Freecell",golf:"Golf","grandfathers-clock":"GClock","monte-carlo":"MonteCarlo",pyramid:"Pyramid","russian-solitaire":"RussianSolitaire",scorpion:"Scorpion",spider:"Spider",spider1s:"Spider1S",spider2s:"Spider2S",spiderette:"Spiderette","tri-towers":"TriTowers","will-o-the-wisp":"WillOTheWisp",yukon:"Yukon"},extensions=["auto-turnover","statistics","solitaire-autoplay","solitaire"],Fade=function(){let body,el=null;const css={position:"absolute",display:"none",backgroundColor:"#000",opacity:.7,top:0,left:0,width:0,height:0,zIndex:1e3},element=function(){return null===el&&(el=Y.Node.create("
"),el.setStyles(css),body=Y.one(".solitairey_body").append(el)),el};return{show:function(){const el=element();css.display="block",css.width=el.get("winWidth"),css.height=el.get("winHeight"),el.setStyles(css)},hide:function(){css.display="none",element().setStyles(css)}}}();function switchToGame(name){active.name=name,active.game=Y.Solitaire[games[name]]}function playGame(name){switchToGame(name),enable_cookies()&&$.jStorage.set("FossSolitairey_options",name),newGame()}const GameChooser={selected:null,fade:!1,init:function(){this.refit()},refit:function(){const node=Y.one("#game-chooser");if(!node)return;const height=node.get("winHeight");node.setStyle("min-height",height)},show:function(fade){this.selected||this.select(active.name),fade&&(Fade.show(),this.fade=!0),Y.one("#game-chooser").addClass("show"),Y.one(".solitairey_body").addClass("scrollable")},hide:function(){this.fade&&Fade.hide(),Y.one("#game-chooser").removeClass("show"),Y.fire("gamechooser:hide",this),Y.one(".solitairey_body").removeClass("scrollable")},choose:function(){this.selected&&(this.hide(),playGame(this.selected))},select:function(game){const node=Y.one("#"+game+"> div"),previous=this.selected;previous!==game&&this.unSelect(),node&&(this.selected=game,new Y.Node(document.getElementById(game)).addClass("selected")),previous&&previous!==game&&Y.fire("gamechooser:select",this)},unSelect:function(){this.selected&&(new Y.Node(document.getElementById(this.selected)).removeClass("selected"),this.selected=null)}};const Themes={dondorf:{sizes:[61,79,95,122],61:{hiddenRankHeight:7,rankHeight:25,dimensions:[61,95]},79:{hiddenRankHeight:10,rankHeight:32,dimensions:[79,123]},95:{hiddenRankHeight:12,rankHeight:38,dimensions:[95,148]},122:{hiddenRankHeight:15,rankHeight:48,dimensions:[122,190]}},load:function(name){name in this||(name="dondorf"),Y.Solitaire.Card.base.theme!==name&&this.set(name,122)},set:function(name,size){const theme=this[name][size];Y.mix(Y.Solitaire.Card.base,{theme:name+"/"+size,hiddenRankHeight:theme.hiddenRankHeight,rankHeight:theme.rankHeight,width:theme.dimensions[0],height:theme.dimensions[1]},!0)}};function attachEvents(){if(Y.on("newAppGame",(function(){return newGame()})),enable_solitairey_ui&&(Y.on("click",restart,Y.one("#restart")),Y.on("click",(function(){GameChooser.show(!1)}),Y.one("#choose_game")),Y.on("click",newGame,Y.one("#new_deal")),Y.on("click",(function(){GameChooser.hide()}),Y.one("#close-chooser")),Y.on("click",(function(){active.game.undo()}),Y.one("#undo"))),enable_solitairey_ui){Y.on("click",(function(){const chromestore=Y.one(".chromestore");chromestore&&chromestore.addClass("hidden"),enable_cookies()&&$.jStorage.set("FossSolitairey_disable-chromestore-link",!0)}),Y.one(".chromestore")),Y.delegate("click",(function(e){GameChooser.select(e.currentTarget._node.id),GameChooser.choose()}),"#descriptions","li")}Y.one("document").on("keydown",(function(e){27===e.keyCode&&GameChooser.hide()})),Y.on("afterSetup",(function(){active.game.stationary((function(){resize()}))})),function(){let timer,attachEvent;window.addEventListener?attachEvent="addEventListener":window.attachEvent&&(attachEvent="attachEvent"),window[attachEvent](Y.Solitaire.Application.resizeEvent,(function(){clearTimeout(timer),timer=setTimeout(resize,250)}),!1)}()}const Preloader={loadingCount:0,loaded:function(callback){if(this.loadingCount)setTimeout(function(){this.loaded(callback)}.bind(this),100);else{const loading=Y.one(".loading");loading&&loading.addClass("hidden"),callback(),Fade.hide()}},load:function(path){const image=new Image;image.onload=function(){--this.loadingCount}.bind(this),image.src=path,this.loadingCount++},preload:function(){const that=this;const icons=["agnes","flower-garden","forty-thieves","freecell","gclock","golf","klondike1t","klondike","montecarlo","pyramid","scorpion","spider1s","spider2s","spiderette","spider","tritowers","will-o-the-wisp","yukon"];["s","h","c","d"].forEach((function(suit){for(let rank=1;rank<=13;++rank)that.load(Y.Solitaire.Card.base.theme+"/"+suit+rank+".png")})),this.load(Y.Solitaire.Card.base.theme+"/facedown.png"),enable_solitairey_ui&&icons.forEach((function(image){that.load("layouts/mini/"+image+".png")})),Fade.show();const loading=Y.one(".loading");loading&&loading.removeClass("hidden")}};function _my_load_func(){const save=!!enable_cookies()&&$.jStorage.get("FossSolitairey_saved-game");attachEvents(),function(){if(enable_cookies()){const options=$.jStorage.get("FossSolitairey_options");options&&(active.name=options)}Themes.load("dondorf")}(),Preloader.preload(),Preloader.loaded((function(){save?(clearDOM(),active.game=Y.Solitaire[games[active.name]],active.game.loadGame(save)):enable_solitairey_ui&&playGame(active.name)})),GameChooser.init(),schedule_cb&&schedule_cb(Y)}function resize(){const game=active.game,el=game.container(),padding=Y.Solitaire.padding,offset=Y.Solitaire.offset,width=el.get("winWidth")-padding.x,height=el.get("winHeight")-padding.y;Y.Solitaire.Application.windowHeight=height;const ratio=Math.min((width-offset.left)/game.width(),(height-offset.top)/game.height());active.game.resize(ratio),GameChooser.refit()}function clearDOM(){Y.all(".stack, .card").remove()}function restart(){if(enable_cookies()){const init=Y.Cookie.get("FossSolitairey_initial-game");if(init){clearDOM();const game=active.game;game.cleanup(),game.loadGame(init),game.save()}}}function clearGame(){const game=active.game;clearDOM(),game.cleanup()}function newGame(){clearGame(),active.game.newGame()}newGameRun=function(){playGame("freecell")},schedule=function(cb){schedule_cb=cb},yui.use.apply(yui,function(){const modules=extensions.slice();for(const m in games)games.hasOwnProperty(m)&&modules.unshift(m);return modules}().concat((function(YUI){Y=YUI,Y.on("newGameRun",newGameRun),Y.Solitaire.Application={windowHeight:0,resizeEvent:"resize",GameChooser:GameChooser,newGame:newGame,clearDOM:clearGame,switchToGame:switchToGame},Y.on("domready",_my_load_func)}))),window.setTimeout((function(){yui.use.apply(yui,["solver-freecell"])}),400)}(),{schedule:schedule,newGameRun:newGameRun,setUI:v=>{enable_solitairey_ui=v}}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-stack-clear",(function(Y){const Solitaire=Y.Solitaire;function clearComplete(stack,startIndex){const cards=stack.cards;let count=cards.length-startIndex;const foundation=Y.Array.find(Solitaire.game.foundation.stacks,(function(stack){return!stack.cards.length}));Solitaire.stationary((function(){for(;count;)_.last(cards).moveTo(foundation),count--})),stack.updateCardsPosition()}Y.namespace("Solitaire.AutoStackClear"),Solitaire.AutoStackClear.register=function(){Y.on("solitaire|tableau:afterPush",(function(stack){!function(stack,callback){const cards=stack.cards;let rank,suit,card,i;if(!cards.length)return!1;for(i=cards.length-1,rank=1,suit=cards[i].suit;i>=0&&rank<14;i--,rank++)if(card=cards[i],card.isFaceDown||card.rank!==rank||card.suit!==suit)return!1;const complete=14===rank;complete&&"function"==typeof callback&&callback(stack,i+1)}(stack,clearComplete)}))}}),"0.0.1",{requires:["solitaire"]}),{auto_stack:!0}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-turnover",(function(Y){Y.on("tableau:afterPop",(function(stack){stack.cards.forEach((function(card){card&&card.isFaceDown&&card.isFree()&&card.faceUp()}))}))}),"0.0.1",{requires:["solitaire"]}),{}})),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-autoplay",(function(Y){Y.namespace("Solitaire.Autoplay");const Solitaire=Y.Solitaire,Autoplay=Solitaire.Autoplay;let whenWon=!0,autoPlayInterval=null;const autoPlayable=["Klondike","Klondike1T","FortyThieves","GClock","Freecell","FlowerGarden","Yukon"];function autoPlay(){let played=!1;Solitaire.game.eachStack((function(stack){const field=stack.field;played||"foundation"===field||"deck"===field||(played=!stack.eachCard((function(card){return!card.autoPlay()})))}))}Y.on("endTurn",(function(){whenWon&&-1!==autoPlayable.indexOf(Solitaire.game.name())&&null===autoPlayInterval&&function(){let stop=!1;return Solitaire.game.eachStack((function(stack){const field=stack.field;let prevRank=14;stop||"tableau"!==field&&"waste"!==field||stack.eachCard((function(card){if(card.rank>prevRank||card.isFaceDown)return stop=!0,!1;prevRank=card.rank}))})),!stop}()&&Y.fire("autoPlay")})),Y.on("win",(function(){clearInterval(autoPlayInterval),autoPlayInterval=null})),Y.on("autoPlay",(function(){autoPlayInterval=setInterval(autoPlay,130)})),Y.mix(Autoplay,{enable:function(){whenWon=!0},disable:function(){whenWon=!1}})}),"0.0.1",{requires:["solitaire"]}),{}})),YUI.add("flower-garden",(function(Y){const Solitaire=Y.Solitaire,FlowerGarden=Y.Solitaire.FlowerGarden=Solitaire.instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,i,stack=0;const stacks=this.tableau.stacks;for(deck=this.deck,reserve=this.reserve.stacks[0],i=0;i<36;i++)card=deck.pop(),stacks[stack].push(card.faceUp()),stack++,6===stack&&(stack=0);for(;card=deck.pop();)card.faceUp(),reserve.push(card)},height:function(){return 5.5*this.Card.base.height},maxStackHeight:function(){return 4.4*this.Card.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 4.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:1,layout:{hspacing:1.25,top:function(){return 4.5*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:6,layout:{hspacing:1.25,top:function(){return 1.25*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{rankHeight:24,createProxyStack:function(){let stack;switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this);case"reserve":stack=Solitaire.instance(this.stack),stack.cards=[this],this.proxyStack=stack}return this.proxyStack},moveTo:function(stack){const cards=this.stack.cards,index=cards.indexOf(this);let i,len;for(Solitaire.Card.moveTo.call(this,stack),cards.splice(index,0,null),i=index+1,len=cards.length;istop&&i;i--)deck.my_Last().faceUp().moveTo(waste)},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 3*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck",init:function(){Solitaire.Deck.init.call(this),this.cards.forEach((function(c){c.faceDown()}))},createStack:function(){for(let i=this.cards.length-1;i>=0;i--)this.stacks[0].push(this.cards[i])}}),Waste:{stackConfig:{total:1,layout:{hspacing:0,top:0,left:function(){return 1.25*Solitaire.Card.width}}},field:"waste",draggable:!0},Tableau:{stackConfig:{total:10,layout:{hspacing:1.31,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.suit===this.suit&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});FortyThieves.fields.forEach((function(field){FortyThieves[field].Stack=Solitaire.instance(FortyThieves.Stack)})),Y.mix(FortyThieves.Stack,{cssClass:"freestack",validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(FortyThieves.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(FortyThieves.Deck.Stack,{createDOMElement:function(){Solitaire.Stack.createDOMElement.call(this),this.node.on("click",Solitaire.Events.clickEmptyDeck)}},!0),FortyThieves.Foundation.Stack.cssClass="freefoundation"}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){const instance=solitaire.instance;return YUI.add("freecell",(function(Y){const Solitaire=Y.Solitaire,Freecell=Y.Solitaire.Freecell=instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,stack=0;const stacks=this.tableau.stacks;for(;card=this.deck.pop();)stacks[stack].push(card.faceUp()),stack++,8===stack&&(stack=0)},openSlots:function(exclude){let total=1,freeTableaus=0;const rStacks=this.reserve.stacks,tStacks=this.tableau.stacks;for(let i=0;i<4;i++)rStacks[i].my_Last()||++total;for(let i=0;i<8;i++){const stack=tStacks[i];exclude!==stack&&!stack.my_Last()&&++freeTableaus}return total*Math.pow(2,freeTableaus)},Stack:instance(Solitaire.Stack),height:function(){return 5*this.Card.base.height},Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 6*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:0}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:instance(Solitaire.Card,{playable:function(){switch(this.stack.field){case"reserve":return!0;case"tableau":return this.createProxyStack();case"foundation":return!1}},createProxyStack:function(){const stack=Solitaire.Card.createProxyStack.call(this);return this.proxyStack=stack&&stack.cards.length<=Freecell.openSlots(stack)?stack:null,this.proxyStack},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return!target||target.color!==this.color&&target.rank===this.rank+1;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;case"reserve":return!target}}})});Freecell.fields.forEach((function(field){Freecell[field].Stack=instance(Freecell.Stack)})),Y.mix(Freecell.Stack,{validTarget:function(stack){return!("tableau"!==stack.field||!this.first().validTarget(stack))&&this.cards.length<=Freecell.openSlots(stack)}},!0),Y.mix(Freecell.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),{instance:instance}})),YUI.add("golf",(function(Y){const Solitaire=Y.Solitaire,Golf=Y.Solitaire.Golf=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],deal:function(){let card,stack,row;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(row=0;row<5;row++)for(stack=0;stack<7;stack++)card=deck.pop().faceUp(),stacks[stack].push(card);card=deck.pop().faceUp(),foundation.push(card),deck.createStack()},turnOver:function(){const deck=this.deck.stacks[0],foundation=this.foundation.stacks[0],last=deck.my_Last();last&&last.faceUp().moveTo(foundation)},isWon:function(){let won=!0;return this.eachStack((function(stack){stack.eachCard((function(card){return card&&(won=!1),won}))}),"tableau"),won},height:function(){return 4*this.Card.base.height},Deck:Solitaire.instance(Solitaire.Deck,{field:"deck",stackConfig:{total:1,layout:{hspacing:0,top:function(){return 3*Solitaire.Card.height},left:0}},createStack:function(){let i,len;for(i=0,len=this.cards.length;i=0;){for(card=cards[i],found=!1,rank=2;rank<=13;rank++)if(card.rank===rank&&card.suit===wrap(suits,rank)){found=!0,cards.splice(i,1),clock[rank-2]=card.faceUp();break}found||(stacks[stack].push(card.faceUp()),stack=(stack+1)%8),i--}for(i=0;i<12;i++)foundations[(i+2)%12].push(clock[i])},height:function(){return 6.7*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:12,layout:{hspacing:1.25,top:function(){return 3*Solitaire.Card.height},left:function(){return 3.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 7.25*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{createProxyStack:function(){switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this)}return this.proxyStack},validTarget:function(stack){const target=stack.my_Last();let rank,hour;switch(stack.field){case"tableau":return!target||target.rank===this.rank+1;case"foundation":return hour=(stack.index()+3)%12,rank=target.rank,target.suit===this.suit&&(target.rank+1)%13==this.rank%13&&(low=stack.first().rank,high=hour,value=this.rank,low<=high?low<=value&&value<=high:low<=value||value<=high);default:return!1}var low,high,value}})});function normalize(valOrFunction){const val="function"==typeof valOrFunction?valOrFunction():valOrFunction;return isNaN(val)?void 0:val}GClock.fields.forEach((function(field){GClock[field].Stack=Solitaire.instance(GClock.Stack)})),Y.mix(GClock.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(GClock.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(GClock.Foundation.Stack,{index:function(){return GClock.foundation.stacks.indexOf(this)},layout:function(layout,i){const top=Math.sin(Math.PI*i/6)*Solitaire.Card.height*2.25,left=Math.cos(Math.PI*i/6)*Solitaire.Card.width*3;this.top=top+normalize(layout.top),this.left=left+normalize(layout.left)}},!0)}),"0.0.1",{requires:["solitaire"]}),YUI.add("solitaire-background-fix",(function(Y){let _body;function resize(){const width=body().get("winWidth"),height=body().get("winHeight"),style=document.body.style;Y.UA.mobile||body().setStyles({width:width,height:height}),void 0===style.backgroundSize&&void 0===style.MozBackgroundSize&&body().setStyles({backgroundImage:"url(greentiled.jpg)",backgroundRepeat:"repeat"})}function body(){return _body||(_body=new Y.Node(document.body)),_body}Y.on("load",resize),Y.on("resize",resize)}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-ios",(function(Y){if(Y.UA.ios){var setCardPosition,Solitaire=Y.Solitaire,_scale=Solitaire.scale,BARE_LAYOUT={hspacing:0,vspacing:0,left:0,top:0},DEFAULTS={scale:1,offset:60,maxStackHeight:155},OPTIONS={Agnes:{offset:[null,5],maxStackHeight:260},FlowerGarden:{offset:[-60,5],maxStackHeight:235},Freecell:{scale:[1,.93],offset:[35,5]},Golf:{scale:[1.1,1],offset:[45,8]},GClock:{scale:.93,offset:5,maxStackHeight:130},Klondike:{offset:[null,5],maxStackHeight:[null,340]},MonteCarlo:{scale:[.88,1],offset:[80,15]},Pyramid:{offset:20},Scorpion:{offset:5,maxStackHeight:[235,380]},Spider:{scale:[1.13,.79],offset:[5,2],maxStackHeight:[160,340]},TriTowers:{scale:.9,offset:10},Yukon:{scale:[.95,1],offset:[50,5],maxStackHeight:[235,390]}},gameOverrides={Agnes:function(){var hspacing={hspacing:1.13};fieldLayout(this,"Reserve",Y.merge(hspacing,{top:60})),fieldLayout(this,"Tableau",Y.merge(hspacing,{top:145})),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:135}))},FlowerGarden:[function(){this.Card.rankHeight=15,fieldLayout(this,"Reserve",{top:0,left:70}),fieldLayout(this,"Foundation",{top:0,left:470,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{top:0,left:140}),Y.mix(this.Reserve.Stack,{setCardPosition:function(card){var last=_.last(this.cards),top=last?last.top+11:this.top,left=this.left;card.left=left,card.top=top},update:Solitaire.noop},!0)},(setCardPosition=Solitaire.FlowerGarden.Reserve.Stack.setCardPosition,function(){fieldLayout(this,"Tableau",{left:10,top:120}),fieldLayout(this,"Reserve",{left:17,top:60}),fieldLayout(this,"Foundation",{left:55,top:0,hspacing:1.5,vspacing:0}),Y.mix(this.Reserve.Stack,{setCardPosition:setCardPosition,update:Solitaire.noop},!0)})],Freecell:[originalLayout("Freecell",["Foundation","Reserve","Tableau"]),function(){var hspacing={hspacing:1.05};fieldLayout(this,"Tableau",hspacing),fieldLayout(this,"Reserve",hspacing),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:157}))}],Golf:[originalLayout("Golf",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{hspacing:1.1}),fieldLayout(this,"Foundation",{left:132})}],GClock:function(){fieldLayout(this,"Foundation",{left:143}),fieldLayout(this,"Tableau",{left:0,top:250,hspacing:1.05})},Klondike:[function(){originalLayout("Klondike","Foundation").call(this),originalLayout("Klondike","Tableau").call(this)},function(){Y.mix(this.Foundation.stackConfig.layout,{left:135,hspacing:1.13},!0),Y.mix(this.Tableau.stackConfig.layout,{hspacing:1.13},!0)}],MonteCarlo:function(){fieldLayout(this,"Tableau",{cardGap:1.1,vspacing:1.05})},Pyramid:[function(){var deck=originalLayout("Pyramid","Deck"),waste=originalLayout("Pyramid","Waste");return function(){deck.call(this),waste.call(this),Y.mix(this.Tableau.stackConfig.layout,{left:190,cardGap:1.1,hspacing:-.55},!0)}}(),function(){Y.mix(this.Deck.stackConfig.layout,{left:-10,top:300},!0),Y.mix(this.Waste.stackConfig.layout,{top:300},!0),Y.mix(this.Tableau.stackConfig.layout,{left:120,cardGap:1.1,hspacing:-.55},!0)}],Scorpion:[function(){fieldLayout(this,"Deck",{top:0,left:0}),fieldLayout(this,"Foundation",{top:0,left:420,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{left:60,top:0,hspacing:1.13})},function(){fieldLayout(this,"Deck",{left:10,top:0}),fieldLayout(this,"Foundation",{left:75,top:0,hspacing:1.5,vspacing:0}),fieldLayout(this,"Tableau",{left:0,top:60,hspacing:1.13})}],Spider:[function(){fieldLayout(this,"Foundation",{left:94,hspacing:1.05}),fieldLayout(this,"Tableau",{top:65,hspacing:1.05})},function(){fieldLayout(this,"Foundation",{left:62,hspacing:1}),fieldLayout(this,"Tableau",{hspacing:1})}],TriTowers:function(){Y.mix(this.Tableau.stackConfig.layout,{hspacing:-.5,rowGaps:[3,2,1,0],cardGap:1},!0)},RussianSolitaire:[originalLayout("RussianSolitaire",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}],Yukon:[originalLayout("Yukon",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}]};OPTIONS.FortyThieves=OPTIONS.Spider1S=OPTIONS.Spider2S=OPTIONS.Spider,gameOverrides.FortyThieves=gameOverrides.Spider1S=gameOverrides.Spider2S=gameOverrides.Spider,OPTIONS.WillOTheWisp=OPTIONS.Spiderette=OPTIONS.Klondike1T=OPTIONS.Klondike,gameOverrides.WillOTheWisp=gameOverrides.Spiderette=gameOverrides.Klondike1T=gameOverrides.Klondike,OPTIONS.RussianSolitaire=OPTIONS.Yukon,Y.mix(Y.DD.DDM,{useHash:!1,_pg_activate:Solitaire.noop,_pg_size:function(){this.activeDrag&&this._pg.setStyles({width:"100%",height:"100%"})}},!0),Y.DD.DDM.set("throttleTime",40),Y.mix(Y.DD.Drop.prototype,{_activateShim:function(){var DDM=Y.DD.DDM;return!!DDM.activeDrag&&(this.get("node")!==DDM.activeDrag.get("node")&&(!this.get("lock")&&void(this.inGroup(DDM.activeDrag.get("groups"))?(DDM._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get("node")),this.sizeShim()):DDM._removeValid(this))))},_deactivateShim:function(){this.overTarget=!1}},!0),Solitaire.Statistics.winDisplay=function(){alert("You win!")},Solitaire.scale=Solitaire.noop,Solitaire.Card.ghost=!1,Solitaire.Animation.animate=!1,Solitaire.Card.base={theme:"mobile",hiddenRankHeight:3,rankHeight:15,width:40,height:50},Y.on("beforeSetup",setLayout),Y.on("beforeResize",setLayout),Y.on("afterResize",scrollToTop),Y.on("load",scrollToTop),Y.on("touchstart",(function(e){e.target._node===document.body&&e.preventDefault()}),document),Y.on("touchmove",(function(e){e.target.test("#descriptions *")||e.preventDefault()}),document),Y.on("domready",(function(){var undo,cancel,showMenu,menu,body,nav,fb,index,closeMenu=function(){menu.removeClass("show")};(index=0,{deleteSelector:function(selector){var rules,idx,ss=document.styleSheets[index];ss&&-1!==(idx=(rules=Array.prototype.splice.call(ss.rules,0)).indexOf(rules.filter((function(rule){return rule.selectorText===selector}))[0]))&&ss.deleteRule(idx)}}).deleteSelector("#menu li:hover"),menu=Y.one("#menu"),body=Y.one("body"),undo=Y.one("#undo"),fb=Y.one("#social"),nav=Y.Node.create("
"),stack=this.proxyStack;if(stack)node.setStyles({opacity:1,top:-this.top,left:-this.left}),this.proxyCards().forEach((function(c){c.proxyStack=stack,node.append(c.node)}));else{if(!this.ghost)return null;node.setStyles({opacity:.6,top:-this.top,left:-this.left}).append(this.node.cloneNode(!0))}return node},updatePosition:function(fields){if(!this.node)return;const to={left:this.left+"px",top:this.top+"px",zIndex:this.zIndex},origin=this.origin;this.positioned||this.node.setStyles({left:normalize(origin.left),top:normalize(origin.top)}),Y.Solitaire.Animation.init(this,to,fields)},pushPosition:function(){const index=this.index>=0?this.index:this.stack.cards.indexOf(this);Solitaire.pushMove({card:this,index:index,from:this.stack})},moveTo:function(stack){const origin=this.stack;return this.pushPosition(),origin.deleteItem(this),stack.push(this),Y.fire(origin.field+":afterPop",origin),this},after:function(callback){this.callback=callback},runCallback:function(){this.callback&&(this.callback.call(this),this.callback=null)}},Y.Solitaire.Stack={cards:null,node:null,images:{tableau:"freeslot.png",deck:"freeslot.png",reserve:"freeslot.png",foundation:"freeslot.png"},serialize:function(){let i,len,card,bite;const cards=this.cards,serialized=[],suits=Game.deck.suits;for(i=0,len=cards.length;i>2&15,deck.suits[3&value]),64&value?card.faceDown(!0):card.faceUp(!0)),card})),this.update()},imageSrc:function(){const basename=this.images[this.field];return basename?Solitaire.Card.base.theme+"/"+basename:"trans.gif"},layout:function(layout){const hoffset=layout.hoffset*Y.Solitaire.Card.width,voffset=layout.voffset*Y.Solitaire.Card.height,gameOffset=Solitaire.offset,self=this;["top","left"].forEach((function(p){self[p]=normalize(layout[p])})),this.left+=hoffset+gameOffset.left,this.top+=voffset+gameOffset.top},deleteItem:function(card){_deleteItem(this.cards,card)},push:function(card,temp){const last=this.my_Last(),to=this.field,from=card.stack?card.stack.field:"deck";last?card.zIndex=last.zIndex+1:"deck"===to||"foundation"===to?card.zIndex=200:"deck"===from&&(card.zIndex=Game.Card.zIndex),temp||(card.stack=this,this.setCardPosition(card),card.truncatePosition(),card.ensureDOM()),this.cards.push(card),temp||card.updatePosition({from:from,to:to})},pushStack:function(proxy){const origin=Solitaire.activeCard.stack,stack=this;origin.eachCard((function(card,i){card.index=i})),Game.stationary((function(){proxy.eachCard((function(card){card.moveTo(stack),card.index=-1})),origin.eachCard((function(card){card.index=-1}))})),origin.updateCardsPosition(),origin.update(),Y.fire(stack.field+":afterPush",stack)},adjustRankHeight:function(){const cards=this.cards,last=this.my_Last(),max=Game.maxStackHeight();let sumRankHeights,i,len,sumHidden=0,sumVisible=0,height=0,countHidden=0,countVisible=0;const Card=Solitaire.Card;if(cards.length<=1)return;for(i=0,len=cards.length-1;i").setAttribute("src",this.imageSrc()).setData("target",this).plug(Y.Plugin.Drop,{useShim:!0});this.updateStyle(),Solitaire.container().append(node)},cleanup:function(){const n=this.node;n&&n.clearData().destroy(!0),this.eachCard((function(c){c.destroyNode()}))},updateDragGroups:function(){const active=Solitaire.activeCard,last=this.my_Last();this.eachCard((function(c){c.node.drop.removeFromGroup("open")})),active.validTarget(this)?(last&&last.node.drop.addToGroup("open"),this.node.drop.addToGroup("open")):this.node.drop.removeFromGroup("open")},validCard:function(){return!0},validProxy:function(card){return card&&card.validTarget(this)&&this.validCard(card)},update:function(){}},Y.Solitaire.Animation={animate:!0,dealing:!1,duration:.5,interval:20,queue:new Y.AsyncQueue,init:function(card,to,fields){if(!this.animate)return card.node.setStyles(to),card.positioned=!0,void setTimeout((function(){card.runCallback()}),0);const node=card.node,q=this.queue,speeds=card.animSpeeds,from=mapAppend(function(that){for(const p in that)that.hasOwnProperty(p)&&(that[p]=parseFloat(that[p]));return that}({top:node.getStyle("top"),left:node.getStyle("left")}),"px");let duration;const zIndex=to.zIndex;if(from.top===to.top&&from.left===to.left)return;duration=this.dealing?speeds.slow:fields&&fields.from!==fields.to&&"waste"!==fields.to&&"foundation"!==fields.to?"deck"===fields.from?speeds.slow:speeds.mid:speeds.fast,node.setStyle("zIndex",500+zIndex),delete to.zIndex;const anim=new Y.Anim({node:node,from:from,to:to,easing:Y.Easing.easeOut,duration:duration});anim.on("end",(function(){card.positioned=!0,node.setStyle("zIndex",zIndex),card.runCallback()})),q.add((function(){anim.run()})),q.run()},initQueue:function(){this.queue.defaults.timeout=this.interval}};const Undo={stack:null,clear:function(){this.stack=[]},push:function(moves){this.stack.push(moves)},pop:function(){return this.stack.pop()||[]},undo:function(){Y.Array.unique(my_Flatten(Y.Array.map(this.pop(),this.act))).forEach((function(stack){stack&&(stack.updateCardsPosition(),stack.update(!0))}))},act:function(move){const from=move.from,card=move.card,to=card.stack,cards=to.cards;return from&&(from===card.stack?cards[cards.indexOf(card)]=null:_deleteItem(cards,card),from.cards[move.index]=card,card.stack=from,Solitaire.container().append(card.node)),"faceDown"in move&&(move.faceDown?card.faceUp(!0):card.faceDown(!0)),[to,from]}}}),"0.0.1",{requires:["dd","dd-plugin","dd-delegate","anim","async-queue","array-extras"]}),{instance:instance,Game:Game,getGame:getGame,setUI:v=>{enable_solitairey_ui=v}}})),define(["./libfcs-wrap","./web-fc-solve","./solitaire","./flatted"],(function(Module,w,solitaire,flatted){"use strict";const FC_Solve=w.FC_Solve,FCS_STATE_SUSPEND_PROCESS=w.FCS_STATE_SUSPEND_PROCESS,FCS_STATE_WAS_SOLVED=w.FCS_STATE_WAS_SOLVED;let getGame,_module_wrapper,_startSolution_cb;let _my_non_promise_module,_my_module,WITH_UI=!1;WITH_UI=!0;let _my_mod_counter=5;const suitTable={s:0,h:1,c:2,d:3};function cardToValue(card){return card?card.rank<<2|suitTable[card.suit]:0}function withSelector(Y,selector,callback){const node=Y.one(selector);node&&callback(node)}function sortedStacks(Y,field){return Y.Array.map(field.stacks,(function(s){return s})).sort((function(s1,s2){return cardToValue(s1.first())-cardToValue(s2.first())}))}function to_int(s){return parseInt(s,10)}const _suits=["S","H","C","D"],_ranks=["A","2","3","4","5","6","7","8","9","T","J","Q","K"];function _rev(arr,delta){const ret={};for(let i=0;i>2)-1]}function _render_suit(c){return _suits[3&c]}function _render_foundation(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)}function cardRank(val){return val>>2}function cardSuit(val){return["s","h","c","d"][3&val]}function _render_freecell(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)}function _str_to_c(s){const m=s.match(/^(.)(.)$/);if(!m)throw"Should not happen";return _ranks_rev[m[1]]<<2|_suits_rev[m[2]]}function _get_stack_c(pre_s,src,card_idx){const arr=pre_s[src+2].replace(/ *$/,"").split(" "),src_c_s=arr[arr.length-card_idx];return":"==src_c_s?0:_str_to_c(src_c_s)}function _get_freecell_c(pre_s,idx){const fc_line=pre_s[1],pat=new RegExp("^Freecells:"+(0==idx?"":"(?:....){"+idx+"}")+"(....)",""),matched=fc_line.match(pat);if(matched){const c_s=matched[1].substring(2,4);return" "==c_s?0:_str_to_c(c_s)}return 0}function _calc__move_content(pre_s,str){let matched=str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)/);if(matched){const num_cards=to_int(matched[1]);return{source:["tableau",_get_stack_c(pre_s,to_int(matched[2]),num_cards)],dest:["tableau",_get_stack_c(pre_s,to_int(matched[3]),1)],num_cards:num_cards}}if(matched=str.match(/^Move a card from (stack|freecell) ([0-9]+) to the foundations/),matched){const src=to_int(matched[2]);let m_t,src_c;"stack"==matched[1]?(src_c=_get_stack_c(pre_s,src,1),m_t="tableau"):(src_c=_get_freecell_c(pre_s,src),m_t="reserve");const f_suit=3&src_c,f_rank=function(pre_s,f){const f_line=pre_s[0],pat=new RegExp(f+"-([0A2-9TJQK])",""),m=f_line.match(pat)[1];return"0"==m?0:_ranks_rev[m]}(pre_s,_suits[f_suit]);return{source:[m_t,src_c],dest:["foundation",0!=f_rank&&f_rank<<2|f_suit],num_cards:1}}if(matched=str.match(/^Move a card from stack ([0-9]+) to freecell ([0-9]+)/),matched)return{source:["tableau",_get_stack_c(pre_s,to_int(matched[1]),1)],dest:["reserve",_get_freecell_c(pre_s,to_int(matched[2]))],num_cards:1};if(matched=str.match(/^Move a card from freecell ([0-9]+) to stack ([0-9]+)/),matched)return{source:["reserve",_get_freecell_c(pre_s,to_int(matched[1]))],dest:["tableau",_get_stack_c(pre_s,to_int(matched[2]),1)],num_cards:1};throw"Must not happen - _calc__move_content() failed with <"+str+">"}function _calc_instance_from_state(state){let exceeded_iters=!1;const instance=new FC_Solve({cmd_line_preset:"video-editing",module_wrapper:_module_wrapper,set_status_callback:function(status){"exceeded"==status&&(exceeded_iters=!0)}}),state_as_string=function(obj){let ret="";const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map(_render_foundation).join("")+"\n",ret+="Freecells:"+reserve.map(_render_freecell).join("")+"\n";for(let i=0;i=this.remainingMovesArr.length)return;const move=function(game,move){const source=move.source,dest=move.dest,ret={top_card:!0};let value=source[1];const source_type=source[0];if(game.eachStack((function(stack){if(ret.card)return;const len=stack.cards.length;stack.eachCard((function(card,i){return!ret.card&&(!card||(card.rank===cardRank(value)&&card.suit===cardSuit(value)?(ret.card=card,"tableau"===source_type&&i!=len-1&&(ret.top_card=!1),!1):void 0))}))}),source_type),!ret.card)throw"Excalibur";if(value=dest[1],game.eachStack((function(stack){if(ret.stack)return;const card=stack.my_Last();card||value||(ret.stack=stack),card&&card.rank===cardRank(value)&&card.suit===cardSuit(value)&&(ret.stack=stack)}),dest[0]),!ret.stack)throw"Must not happen - could not find dest stack for <"+value+">";return ret.num_cards=move.num_cards,ret}(game,this.remainingMovesArr[this.remainingMovesIdx]),card=move.card;if(!card)return;const origin=card.stack;if(move.top_card)card.moveTo(move.stack);else{Solitaire.activeCard=card,card.createProxyStack();const proxyStack=card.proxyStack;proxyStack.cards.length!==move.num_cards&&alert("Error !!! mismatch in num_cards"),proxyStack.cards.forEach((function(card){})),move.stack.pushStack(proxyStack),move.stack.updateCardsPosition(),origin.updateCardsPosition(),Solitaire.endTurn()}return!0},_resetGameFoo:function(){},playCurrent:function(game){const that=this;that._playCurrentHelper(game)||that._resetGameFoo()},prev:function(game){const that=this;that.remainingMovesIdx>0&&(Y.fire("undo",!0),--that.remainingMovesIdx)},next:function(game){const that=this,next_idx=this.remainingMovesIdx+1;Solitaire.Statistics.disable(),that.playCurrent(game),that.remainingMovesIdx=next_idx,that.remainingMovesIdx>=that.remainingMovesArr.length&&that._resetGameFoo(),Y.fire("endTurn",!0)},play:function(game){const that=this;that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(Solitaire.Autoplay.disable(),withSelector(Y,"#solver_bar .play",(function(node){node.removeClass("play"),node.addClass("pause")})),that.next(game),that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(that.timer=window.setTimeout((function(){that.play(game)}),that.interval)))}},Status={bar:null,indicator:null,indicatorTimer:null,indicatorInterval:750,delay:400,updateIndicator:function(ticks){const that=this,indicator=that.indicator;if(!indicator)return;ticks=(ticks||0)%4;let text="Solving";for(let i=0;i'),indicator=Y.Node.create('');function _create_button(args){return Y.Node.create('')}const next=_create_button({cls:"fastforward",title:"Next move"}),prev=_create_button({cls:"rewind",title:"Previous move"}),playPause=_create_button({cls:"play",title:"Play/Pause"}),controls=Y.Node.create("
");next.on("click",(function(){Animation.pause(),Animation.next(getGame())})),prev.on("click",(function(){Animation.pause(),Animation.prev(getGame())})),playPause.on("click",(function(){const that=playPause;that.hasClass("play")?Animation.play(getGame()):that.hasClass("pause")&&Animation.pause()})),controls.append(prev),controls.append(playPause),controls.append(next),bar.append(indicator),bar.append(controls),Y.one(".solitairey_body").append(bar),this.indicator=indicator,this.bar=bar},hide:function(){0}};_startSolution_cb=function(args){return Y.Solitaire.Application.switchToGame("freecell"),Y.Solitaire.Application.clearDOM(),Y.Solitaire.Freecell.setup((()=>{function _from_card(card){return Y.Solitaire.Freecell.Card.create(card.getRank(),game.deck.suits[[2,0,1,3][card.getSuit()]]).faceUp()}const board=args.board,game=getGame(),tableau=game.tableau.stacks;board.columns.forEach(((col,ci)=>{const column=col.col;tableau[ci].setCards(column.getLen(),(function(i){return _from_card(column.getCard(i))}))}));const fc=board.freecells;game.reserve.stacks.forEach(((stack,i)=>{const card=fc?fc.freecells.getCard(i):null;stack.setCards(card?1:0,(function(_unused){return _from_card(card)}))}));const foundations=board.foundations;game.foundation.stacks.forEach((function(stack,suit){stack.setCards(foundations?1+foundations.foundations.getByIdx(0,[1,2,0,3][suit]):0,(function(rank){return Y.Solitaire.Freecell.Card.create(rank,game.deck.suits[suit]).faceUp()}))}))}),{disableDragging:!0}),_solve_cb(Y,FreecellSolver,args.instance._pre_expand_states_and_moves_seq,Animation)},Y.mix(FreecellSolver,{solver_active:!1,currentSolution:null,attached:!1,supportedGames:["Freecell"],isSupported:function(){return-1!==this.supportedGames.indexOf(getGame().name())},enable:function(){this.isSupported()&&this.createUI(),this.attachEvents()},disable:function(){Status.hide()},attachEvents:function(){const that=this;if(that.attached)return;const pause=Animation.pause.bind(Animation);Y.on("afterDealingAnimation",(function(){that.isSupported()?(that.solver_active=!1,Animation.remainingMovesIdx=null,Animation.remainingMovesArr=[],that.solve()):that.disable()})),Y.on("autoPlay",(function(){FreecellSolver.disable()})),Y.on("win",(function(){})),document.documentElement.addEventListener("mousedown",(function(e){e.target.className.match(/\bpause\b/)||pause()}),!0),that.attached=!0},createUI:function(){Status.show()},stop:function(){},solve:function(){const that=this;if(that.solver_active)return;that.solver_active=!0,that.stop(),that.currentSolution=null;const state=function(Y,game){const tableau=Y.Array.map(sortedStacks(Y,game.tableau),(function(s){const buffer=[];return s.eachCard((function(c,i){buffer[i]=cardToValue(c)})),[buffer,s.cards.length]})),reserve=[];sortedStacks(Y,game.reserve).forEach((function(s,i){reserve[i]=cardToValue(s.my_Last())}));const foundation=[];return sortedStacks(Y,game.foundation).forEach((function(s,i){foundation[i]=cardToValue(s.my_Last())})),{reserve:reserve,foundation:foundation,tableau:tableau}}(Y,getGame());function _cb(){window.setTimeout((function(){const instance=_calc_instance_from_state(state);return _solve_cb(Y,that,instance?instance._pre_expand_states_and_moves_seq:null,Animation)}),400)}var callback;_my_non_promise_module?_cb():(callback=_cb,_my_mod_counter>=5?(_my_module=Module({onRuntimeInitialized:()=>{_my_module.then((result=>{_my_non_promise_module=result;const module_wrapper=w.FC_Solve_init_wrappers_with_module(_my_non_promise_module);_module_wrapper=module_wrapper,callback()}))}}),_my_mod_counter=0):++_my_mod_counter)}}),Y.on("beforeSetup",FreecellSolver.enable.bind(FreecellSolver))}),"0.0.1",{requires:["solitaire"]}),{startSolution:function(args){return _startSolution_cb(args)}}})),importScripts("libfreecell-solver.min.js","web-fc-solve--expand-moves.js","web-fc-solve.js");let attempts=0;const maxFastAttempts=15e4;function GameState(obj){if(!obj)return;let i,stack;for(this.reserve=new Uint8Array(obj.reserve),this.foundation=new Uint8Array(obj.foundation),this.tableau=[],i=0;i200)return 200;if(state.solved())return state.becomeChild(),0;for(i=0;i<4;i++)if(val=state.reserve[i],val){if(destIndex=state.validTarget("foundation",val),destIndex>-1&&(moves.push({source:["reserve",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["reserve",i],dest:["tableau",destIndex]})}const tableau=state.tableau;for(i=0;i-1&&(moves.push({source:["tableau",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=state.validTarget("reserve",val),destIndex>-1&&moves.push({source:["tableau",i],dest:["reserve",destIndex]}),destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["tableau",i],dest:["tableau",destIndex]})}for(foundFoundation?movesSinceFoundation=0:movesSinceFoundation++,i=0;i=20&&(scale=.7),fastSearch&&++attempts>maxFastAttempts&&(scale=.001),i=0;i>2)-1]}const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map((function(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)})).join("")+"\n",ret+="Freecells:"+reserve.map((function(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)})).join("")+"\n";for(let i=0;i>2!=13)return!1;return!0},eachTableau:function(callback){const tableau=this.tableau;for(let i=0,len=tableau.length;i>2,suit=3&value;let dest,tableau,i,len;if(!value)return-1;switch(void 0===start?start=0:start++,field){case"foundation":for(i=0;i<4;i++)if(dest=this.foundation[i],!dest&&1===rank||suit===(3&dest)&&rank===1+(dest>>2))return i;break;case"reserve":for(i=0;i<4;i++)if(!this.reserve[i])return i;break;case"tableau":for(tableau=this.tableau,i=start,len=tableau.length;i>2)-1)return i}return-1},move:function(sourceField,sourceStack,destField,destStack){const val=this.pop(sourceField,sourceStack);this.push(destField,destStack,val)},pop:function(field,stack){let val;if("reserve"===field||"foundation"===field)return val=this[field][stack],this[field]=new Uint8Array(this[field]),this[field][stack]=0,val;const tableau=this.tableau,bufferLength=tableau[stack][1];return bufferLength?(val=tableau[stack][0][bufferLength-1],this.copyTableau(stack,bufferLength-1),val):0},push:function(field,stack,val){if(!val)return;if("reserve"===field||"foundation"===field)return this[field]=new Uint8Array(this[field]),void(this[field][stack]=val);const newLength=this.tableau[stack][1]+1;this.copyTableau(stack,newLength),this.tableau[stack][0][newLength-1]=val},copyTableau:function(stack,newLength){const old=this.tableau,tableau=old[stack][0],newBuffer=new Uint8Array(new ArrayBuffer(newLength));for(let i=0;i=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=15-(length-2-i)+(13-(stack[0][i]>>2)));this.validTarget("tableau",stack[0][length-2])>-1&&(rating+=10)}if("reserve"===sourceField&&(rating+=10,card=this.reserve[sourceIndex]),"tableau"===destField){for(rating+=2,stack=this.tableau[destIndex],length=stack[1],i=length-1;i>=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=-5*(length-i));if(0===stack[1]){if("tableau"===sourceField&&1===this.tableau[sourceIndex][1])return-1e3;for(i=0;i<4;i++)nextCard=this.reserve[i],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);for(i=0;i<8;i++)stack=this.tableau[i],nextCard=stack[0][stack[1]-1],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);followup||(rating+=-10)}}return"reserve"===destField&&(rating+=-1),rating},transformParentMove:function(){const move=this.parentMove,parent=this.parent;move&&parent&&(move.source[1]=parent.lastCard(move.source[0],move.source[1]),move.dest[1]=parent.lastCard(move.dest[0],move.dest[1]))},lastCard:function(field,index){switch(field){case"reserve":case"foundation":return this[field][index];case"tableau":const stack=this[field][index],length=stack[1];return stack[0][length-1]}},becomeChild:function(){const parent=this.parent;parent&&(parent.child=this,this.transformParentMove())}},onmessage=function(e){let solution;const data=e.data;"solve"===data.action&&(solution=attemptSolution(data.param,!0),solution||(solution=attemptSolution(data.param,!1)),self.postMessage({solution:solution}))},YUI.add("spider",(function(Y){const Solitaire=Y.Solitaire,Spider=Solitaire.Spider=Solitaire.instance(Solitaire,{fields:["Foundation","Deck","Tableau"],createEvents:function(){Solitaire.AutoStackClear.register(),Solitaire.createEvents.call(this)},deal:function(){const deck=this.deck,stacks=this.tableau.stacks;for(let row=0;row<5;row++)for(let stack=0;stack<10;stack++)(stack<4||row<4)&&stacks[stack].push(deck.pop());for(let stack=0;stack<10;stack++)stacks[stack].push(deck.pop().faceUp());deck.createStack()},redeal:function(){},turnOver:function(){const deck=this.deck.stacks[0],that=this;hasFreeTableaus()||this.eachStack((function(stack){const card=deck.my_Last();card&&card.faceUp().moveTo(stack).after((function(){that.stack.updateCardsPosition()}))}),"tableau")},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 2.5*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck"}),Tableau:{stackConfig:{total:10,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau"},Card:Solitaire.instance(Solitaire.Card,{playable:function(){this.stack[this.index-1];switch(this.stack.field){case"tableau":return this.createProxyStack();case"deck":return!hasFreeTableaus();case"foundation":return!1}},validTarget:function(stack){if("tableau"!==stack.field)return!1;const target=stack.my_Last();return!target||!target.isFaceDown&&target.rank===this.rank+1}})});function hasFreeTableaus(){return Y.Array.some(Solitaire.getGame().tableau.stacks,(function(stack){return!stack.cards.length}))}Spider.fields.forEach((function(field){Spider[field].Stack=Solitaire.instance(Spider.Stack)})),Y.mix(Spider.Stack,{validCard:function(card){return card.suit===_.last(this.cards).suit},validTarget:function(stack){switch(stack.field){case"tableau":return this.first().validTarget(stack);case"foundation":return 13===this.cards.length}}},!0),Y.mix(Spider.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["auto-stack-clear"]}),YUI.add("spider1s",(function(Y){const Solitaire=Y.Solitaire;(Y.Solitaire.Spider1S=Solitaire.instance(Y.Solitaire.Spider)).Deck=Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s"],count:8})}),"0.0.1",{requires:["spider"]}),YUI.add("spider2s",(function(Y){(Y.Solitaire.Spider2S=Y.Solitaire.instance(Y.Solitaire.Spider)).Deck=Y.Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s","h"],count:4})}),"0.0.1",{requires:["spider"]}),YUI.add("spiderette",(function(Y){const Solitaire=Y.Solitaire,Klondike=Solitaire.Klondike,Spider=Solitaire.Spider;Y.Solitaire.Spiderette=Solitaire.instance(Spider,{height:Klondike.height,deal:Klondike.deal,Tableau:Solitaire.instance(Spider.Tableau,{stackConfig:Klondike.Tableau.stackConfig}),Foundation:Solitaire.instance(Spider.Foundation,{stackConfig:Klondike.Foundation.stackConfig}),Deck:Solitaire.instance(Spider.Deck,{count:1})})}),"0.0.1",{requires:["klondike","spider"]}),define(["./solitaire"],(function(solitaire){const getGame=solitaire.getGame;return YUI.add("statistics",(function(Y){let loaded,won,enabled=!0;const localStorage=window.localStorage,Solitaire=Y.Solitaire,Statistics=Y.namespace("Solitaire.Statistics");function winDisplay(){const stats=function(raw){function parse(){const entries=raw.split("|");return entries.splice(entries.length-1),Y.Array.map(entries,(function(entry){return entry=entry.split("_"),{date:new Date(entry[0]),won:!!parseInt(entry[1],10)}}))}function won(entry){return entry.won}const record=parse();return{streaks:function(){const streaks=[];let streak=null;return record.forEach((function(entry){entry.won?(streak||(streak=[]),streak.push(entry)):(streak&&streaks.push(streak),streak=null)})),streak&&streaks.push(streak),streaks},wins:function(){return Y.Array.filter(record,won)},loses:function(){return Y.Array.reject(record,won)}}}(localStorage[Solitaire.game.name()+"record"]);let output="
";const streakCount=_.last(stats.streaks()).length,winCount=stats.wins().length,loseCount=stats.loses().length;return output+="

You win! You're awesome.

",output+="

"+{Agnes:"Agnes",Klondike:"Klondike",Klondike1T:"Klondike (Vegas style)",FlowerGarden:"Flower Garden",FortyThieves:"Forty Thieves",Freecell:"Freecell",Golf:"Golf",GClock:"Grandfather's Clock",MonteCarlo:"Monte Carlo",Pyramid:"Pyramid",RussianSolitaire:"Russian Solitaire",Scorpion:"Scorpion",Spider:"Spider",Spider1S:"Spider (1 Suit)",Spider2S:"Spider (2 Suit)",Spiderette:"Spiderette",WillOTheWisp:"Will O' The Wisp",TriTowers:"Tri Towers",Yukon:"Yukon"}[Solitaire.game.name()]+" stats:

",output+="
    ",output+="
  • Current win streak: "+streakCount+"
  • ",output+="
  • Total wins: "+winCount+"
  • ",output+="
  • Total loses: "+loseCount+"
  • ",output+='
    ',output+="
",output}function record(value){const key=localStorage.currentGame+"record";let record=localStorage[key]||"";record+=(new Date).getTime()+"_"+value+"|",localStorage[key]=record}function clearProgress(){localStorage.removeItem("currentGame")}function saveProgress(){localStorage.currentGame=Solitaire.game.name()}localStorage&&(Y.on("newGame",(function(){loaded&&(record(0),clearProgress()),won=!1,loaded=null})),Y.on("loadGame",(function(){loaded=Solitaire.game.name(),saveProgress(),won=!1})),Y.on("endTurn",(function(){loaded||(loaded=Solitaire.game.name(),saveProgress())})),Y.on("win",(function(){!won&&enabled&&(loaded=null,won=!0,record(1),clearProgress(),function(){const delay=500,duration=900,interval=900;getGame().eachStack((function(stack){stack.eachCard((function(card){if(!card)return;const node=card.node;card===stack.my_Last()?(node.plug(Y.Breakout,{columns:5}),function(node){setTimeout((function(){node.breakout.explode({random:.65,duration:duration})}),delay)}(node),delay+=interval):node.addClass("hidden")}))}),"foundation"),setTimeout((function(){Statistics.winDisplay()}),delay+200)}())})),Y.on("beforeSetup",(function(){const winDisplay=Y.one("#win_display");winDisplay&&winDisplay.remove(),Statistics.enable()})),Y.mix(Statistics,{winDisplay:function(){const Application=Solitaire.Application;Y.one(".solitairey_body").append(winDisplay()),Y.on("click",(function(){Application.newGame()}),Y.one("#win_display .new_deal"))},enable:function(){enabled=!0},disable:function(){enabled=!1}}))}),"0.0.1",{requires:["solitaire","array-extras","breakout"]}),{}})),YUI.add("tri-towers",(function(Y){const Solitaire=Y.Solitaire,TriTowers=Y.Solitaire.TriTowers=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],width:function(){return 15*this.Card.base.width},height:function(){return 5*this.Card.base.height},createEvents:function(){Y.on("solitaire|endTurn",(function(){const tableaus=Solitaire.game.tableau.stacks;for(let i=0;i<3;i++)Y.fire("tableau:afterPop",tableaus[i])})),Solitaire.createEvents.call(this)},deal:function(){let card,stack,i,stackLength;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(stack=0;stack<4;stack++)for(stackLength=3*(stack+1),i=0;i=0;){for(card=deck.pop().faceUp(),stacks[6-piles].push(card),stack=7-piles;stack<7;stack++)card=deck.pop(),stacks[stack].push(card);piles--}for(stack=1;deck.cards.length;)card=deck.pop().faceUp(),stacks[stack].push(card),stack=stack%6+1},height:function(){return 4.8*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{vspacing:1.25,top:0,left:function(){return 9*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:7,layout:{hspacing:1.25,top:0,left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{playable:function(){return"tableau"===this.stack.field&&!this.isFaceDown},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.color!==this.color&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});Yukon.fields.forEach((function(field){Yukon[field].Stack=Solitaire.instance(Yukon.Stack)})),Y.mix(Yukon.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validProxy:function(card){return!0}},!0),Y.mix(Yukon.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),define(["require","exports","./prange","./french-cards"],(function(require,exports,prange_1,french_cards_1){"use strict";function is_int(input){const value=""+input;return parseFloat(value)===parseInt(value,10)&&!isNaN(input)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BoardParseResult=exports.ParseErrorType=exports.ErrorLocationType=exports.Foundations=exports.suits__str_to_int=exports.MAX_RANK=exports.MIN_RANK=exports.NUM_SUITS=exports.ranks__str_to_int=void 0,exports.capitalize_cards=function(board){return board.match(/[^\n]*\n?/g).map((l=>new BoardTextLine(l).capitalize())).join("")},exports.fcs_js__card_from_string=fcs_js__card_from_string,exports.fcs_js__column_from_string=fcs_js__column_from_string,exports.fcs_js__freecells_from_string=fcs_js__freecells_from_string,exports.fcs_js__foundations_from_string=fcs_js__foundations_from_string,exports.determine_if_string_is_board_like=function(s){return lax_card_three_matches.test(s)};exports.ranks__str_to_int={},exports.NUM_SUITS=4;const _suits=(0,prange_1.perl_range)(0,exports.NUM_SUITS-1);exports.MIN_RANK=1,exports.MAX_RANK=13;const _ranks=(0,prange_1.perl_range)(exports.MIN_RANK,exports.MAX_RANK);for(const rank of _ranks)exports.ranks__str_to_int["0A23456789TJQK".substring(rank,rank+1)]=rank;exports.suits__str_to_int=new Map;for(const suit of _suits)exports.suits__str_to_int.set(french_cards_1.suits__int_to_str.substring(suit,suit+1),suit);class Card{constructor(rank,suit){if(this.rank=rank,this.suit=suit,!is_int(rank))throw"rank is not an integer.";if(!is_int(suit))throw"suit is not an integer.";if(rank<1)throw"rank is too low.";if(rank>exports.MAX_RANK)throw"rank is too high.";if(suit<0)throw"suit is negative.";if(suit>=exports.NUM_SUITS)throw"suit is too high."}getRank(){return this.rank}getSuit(){return this.suit}toString(){return"0A23456789TJQK".substring(this.rank,this.rank+1)+french_cards_1.suits__int_to_str.substring(this.suit,this.suit+1)}}class BoardTextLine{constructor(line){this.line=line;const that=this,m1=line.match(/^([^\n\r]*)([\n\r]*)$/);that.newline=m1[2];let l=m1[1];if(m1[1].match(/#/)){const m2=m1[1].match(/^(.*?)(#.*)/);that.comment=m2[2],l=m2[1]}else that.comment="";if(l.match(/:/)){const m3=l.match(/^([^:]*:)(.*)/);that.prefix=m3[1],that.content=m3[2]}else that.prefix="",that.content=l}getContent(){return this.content}capitalize(){return this.prefix+this.getContent().toUpperCase()+this.comment+this.newline}}class Column{constructor(cards){this.cards=cards}getLen(){return this.cards.length}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getLen())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getLen()-1).map((i=>that.getCard(i).toString()))}toString(){return Array.prototype.concat.apply([],[[":"],this.getArrOfStrs()]).join(" ")+"\n"}}const card_re="("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")";function fcs_js__card_from_string(s){const m=s.match("^"+card_re+"$");if(!m)throw'Invalid format for a card - "'+s+'"';return new Card(exports.ranks__str_to_int[m[1]],exports.suits__str_to_int.get(m[2]))}class BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error){this.is_correct=is_correct,this.start_char_idx=start_char_idx,this.num_consumed_chars=num_consumed_chars,this.error=error}getEnd(){return this.start_char_idx+this.num_consumed_chars}}class ColumnParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,cards){super(is_correct,start_char_idx,num_consumed_chars,error),this.col=new Column(cards)}getLen(){return this.col.getLen()}toString(){return this.col.toString()}}class StringParser{constructor(s){this.s=s,this.consumed=0}consume(m){const len_match=m[1].length;this.consumed+=len_match,this.s=this.s.substring(len_match)}getConsumed(){return this.consumed}isNotEmpty(){return this.s.length>0}match(re){return this.s.match(re)}consume_match(re){const that=this,m=that.match(re);return m&&that.consume(m),m}skipComments(){this.consume_match(/^((?:[ \t]*#[^\n\r]*\r?\n)*)/)}}class CardsStringParser extends StringParser{constructor(s,card_mapper){super(s),this.card_mapper=card_mapper,this.cards=[],this.is_start=!0}afterStart(){this.is_start=!1}getStartSpace(){return this.is_start?"":" +"}should_loop(){return this.isNotEmpty()&&!this.consume_match(/^(\s*(?:#[^\n]*)?\n?)$/)}add(m){this.cards.push(this.card_mapper(m[2])),this.afterStart()}loop(re,callback){const p=this;for(;p.should_loop();){const m=p.consume_match("^("+p.getStartSpace()+"("+re+"))");if(!m)return p.consume_match("^( *)"),callback();p.add(m)}return null}}function calc_1H_error_string(suit){return'Wrong rank specifier "1" (followed by "[R]"). Perhaps you meant either "A[R]" (for ace) or "T[R]" (for rank ten).'.replace(/\[R\]/g,suit)}function fcs_js__column_from_string(start_char_idx,orig_s,force_leading_colon){const p=new CardsStringParser(orig_s,fcs_js__card_from_string),match=p.consume_match("^((?:: +|:(?:$|(?=\\n)))?)");if(force_leading_colon&&!match[1].length)return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),'Columns must start with a ":" in strict mode.',[]);const ret=p.loop(card_re,(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]",[])}));return ret||new ColumnParseResult(!0,start_char_idx,p.getConsumed(),"",p.cards)}class Freecells{constructor(num_freecells,cards){if(this.num_freecells=num_freecells,this.cards=cards,!is_int(num_freecells))throw"num_freecells is not an integer.";if(cards.length!==num_freecells)throw"cards length mismatch."}getNum(){return this.num_freecells}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getNum())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getNum()-1).map((i=>{const card=that.getCard(i);return null!==card?card.toString():"-"}))}toString(){return Array.prototype.concat.apply([],[["Freecells:"],this.getArrOfStrs()]).join(" ")+"\n"}}class FreecellsParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,num_freecells,fc){super(is_correct,start_char_idx,num_consumed_chars,error),is_correct&&(this.freecells=new Freecells(num_freecells,fc))}}function fcs_js__freecells_from_string(num_freecells,start_char_idx,orig_s){const p=new CardsStringParser(orig_s,(card_str=>"-"===card_str?null:fcs_js__card_from_string(card_str)));function make_ret(verdict,err_str){return new FreecellsParseResult(verdict,start_char_idx,p.getConsumed(),err_str,num_freecells,verdict?p.cards:[])}if(!p.consume_match(new RegExp("^("+freecells_prefix_re+":(?: +|$|(?=\\n)))")))return make_ret(!1,'Wrong line prefix for freecells - should be "Freecells:"');const ret=p.loop("\\-|(?:"+card_re+")",(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return make_ret(!1,m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]")}));if(ret)return ret;for(;p.cards.length=0&&rank<=exports.MAX_RANK))throw"rank is out of range.";return!(this.ranks[suit]>=0)&&(this.ranks[suit]=rank,!0)}finalize(){const that=this;for(let i=0;i0&&arr.push(french_cards_1.suits__int_to_str[suit]+"-"+"0A23456789TJQK"[val])}return Array.prototype.concat.apply([],[["Foundations:"],arr]).join(" ")+"\n"}_validateDeckSuit(deck,suit){if(0!==deck)throw"multiple decks are not supported.";if(!is_int(suit))throw"suit is not an integer.";if(!(suit>=0&&suitnew BoardTextLine(l)));for(const l of lines){{const matches=l.getContent().match(/[a-z]+/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.LOWERCASE_LETTERS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}{const matches=l.getContent().match(/10/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.HAS_10_STRINGS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}}that.columns=[];const counter=_suits.map((i=>(0,prange_1.perl_range)(0,exports.MAX_RANK).map((i=>[])))),p=new StringParser(orig_s);if(p.skipComments(),p.match(foundations_prefix_re)){const start_char_idx=p.getConsumed(),fo=fcs_js__foundations_from_string(1,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.foundations=fo,!fo.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Foundations,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}if(p.skipComments(),p.match(new RegExp("^"+freecells_prefix_re+":"))){const start_char_idx=p.getConsumed(),fc=fcs_js__freecells_from_string(num_freecells,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.freecells=fc,!fc.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Freecells,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}for(let i=0;i{const col=col_res.col;for(const h of(0,prange_1.perl_range)(0,col.getLen()-1)){const card=col.getCard(h);counter[card.getSuit()][card.getRank()].push(new ParseLocation(ErrorLocationType.Column,idx,h))}}));const too_many_cards__errors=[],not_enough_cards__errors=[];for(const suit of _suits)for(const rank of _ranks){const count=counter[suit][rank];function add_error(arr,type_,locs){arr.push(new ParseError(type_,locs,new Card(rank,suit))),that.is_valid=!1}if(count.length>1){const locs=count.map((v=>new ErrorLocation(v.type_,v.row,0,0)));add_error(too_many_cards__errors,ParseErrorType.TOO_MUCH_OF_CARD,locs)}else count.length<1&&add_error(not_enough_cards__errors,ParseErrorType.NOT_ENOUGH_OF_CARD,[])}that.errors.push(...too_many_cards__errors),that.errors.push(...not_enough_cards__errors)}getBoardString(){const that=this;let ret="";that.foundations&&(ret+=that.foundations.foundations.toString()),that.freecells&&(ret+=that.freecells.freecells.toString());for(const col of that.columns)ret+=col.toString();return ret}_calc_filled(){return this.columns.filter((c=>c.getLen()>0))}checkIfFlipped(){let i=0;const my_filled_columns=this._calc_filled();for(;i<6;++i){if(i>=my_filled_columns.length)return!1;if(8!=my_filled_columns[i].getLen())return!1}for(;i<7;++i){if(i>=my_filled_columns.length)return!1;if(4!=my_filled_columns[i].getLen())return!1}for(;imy_filled_columns[c].col.getCard(i).toString())).join(" ")+"\n",!1));return new BoardParseResult(8,4,new_columns.map((col=>col.toString())).join(""))}}exports.BoardParseResult=BoardParseResult;const lax_card_rank_re="(?:(?:"+french_cards_1.rank_re+")|10|[01])",lax_card_with_spaces_re="(?:(?:\\s|^)"+("(?:(?:"+lax_card_rank_re+french_cards_1.suit_re+")|(?:"+french_cards_1.suit_re+lax_card_rank_re+"))")+"(?=(?:\\s|$)))",lax_card_three_matches=new RegExp(lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re,"ims")})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rank_re=exports.rank_str=exports.suit_re=exports.suits__int_to_str=void 0,exports.suits__int_to_str="HCDS",exports.suit_re="["+exports.suits__int_to_str+"]",exports.rank_str="A23456789TJQK",exports.rank_re="["+exports.rank_str+"]"})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.perl_range=function(start,end){const ret=[];for(let i=start;i<=end;++i)ret.push(i);return ret}})),define(["require","exports"],(function(require,exports){"use strict";function _to_int(s){return parseInt(s,10)}function _find_max_step(n){let x=1;for(;x<<1{},this.past_first_output_state_promise=expander=>expander.past_first_output_state()}init_from_string(num_stacks,num_freecells,ultimate_source,ultimate_dest,initial_src_state_str){const expander=this,col_matches=initial_src_state_str.match(/(\n:[^\n]*)/g);if(!col_matches||col_matches.length!==num_stacks)throw"Miscount of stacks.";for(let idx=0;idxfc?"s"===fc.t?fc.s:" "+fc.c:" ")).join("")+"\n"+this.modified_state.c.map((col=>": "+col.join(" ")+"\n")).join("");this.ret_array.push({str:state_string,type:"s"})}move_using_freecells(source,dest,count){const expander=this,num_cards_thru_freecell=count-1;for(let i=0;i=0;--i)expander.add_move({t:"f2s",src:expander.empty_fc_indexes[i],dest:dest})}recursive_move(source,dest,num_cards_r,empty_cols){const expander=this;if(num_cards_r<=0)return;const running_empty_cols=empty_cols.slice(0),steps=[];for(;Math.ceil(num_cards_r/expander.step_width)>1;){const count_cards=_find_max_step(Math.ceil(num_cards_r/expander.step_width))*expander.step_width,temp_dest=running_empty_cols.shift();expander.recursive_move(source,temp_dest,count_cards,running_empty_cols),steps.push({count:count_cards,dest:temp_dest,source:source}),num_cards_r-=count_cards}expander.move_using_freecells(source,dest,num_cards_r);for(const s of steps.reverse())expander.recursive_move(s.dest,dest,s.count,running_empty_cols),running_empty_cols.push(s.dest),running_empty_cols.sort(((a,b)=>a-b))}add_move(my_move){this.output_state_promise(this),this.ret_array.push({str:_render_move(my_move),type:"m"}),this.perform_move(my_move),this.output_state_promise=this.past_first_output_state_promise}perform_move(my_move){const expander=this,src=my_move.src,dest=my_move.dest;if("s2f"===my_move.t)expander.modified_state.f[dest]={c:expander.modified_state.c[src].pop(),t:"c"};else if("s2s"===my_move.t)expander.modified_state.c[dest].push(expander.modified_state.c[src].pop());else{if("c"!==expander.modified_state.f[src].t)throw"Wrong val in "+src+"Freecell.";expander.modified_state.c[dest].push(expander.modified_state.f[src].c),expander.modified_state.f[src]=null}}}})),define(["require","exports","./fcs-validate","./web-fcs-api-base","./web-fc-solve--expand-moves","./french-cards"],(function(require,exports,validate,BaseApi,web_fc_solve__expand_moves_1,french_cards_1){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FC_Solve=exports.DisplayFilter=exports.FCS_STATE_SUSPEND_PROCESS=exports.FCS_STATE_WAS_SOLVED=void 0,exports.FC_Solve_init_wrappers_with_module=function(Module){const module_wrapper=BaseApi.base_calc_module_wrapper(Module);return module_wrapper.fc_solve_allocate_i8=p1=>Module.allocate(p1,"i8",Module.ALLOC_STACK),module_wrapper.user_alloc=Module.cwrap("freecell_solver_user_alloc","number",[]),module_wrapper.user_solve_board=Module.cwrap("freecell_solver_user_solve_board","number",["number","string"]),module_wrapper.user_resume_solution=Module.cwrap("freecell_solver_user_resume_solution","number",["number"]),module_wrapper.user_cmd_line_read_cmd_line_preset=Module.cwrap("freecell_solver_user_cmd_line_read_cmd_line_preset","number",["number","string","number","number","number","string"]),module_wrapper.user_get_next_move=Module.cwrap("freecell_solver_user_get_next_move","number",["number","number"]),module_wrapper.user_get_num_freecells=Module.cwrap("freecell_solver_user_get_num_freecells","number",["number"]),module_wrapper.user_get_num_stacks=Module.cwrap("freecell_solver_user_get_num_stacks","number",["number"]),module_wrapper.user_get_unrecognized_cmd_line_flag=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag","number",["number","number"]),module_wrapper.user_get_unrecognized_cmd_line_flag_status=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag_status","number",["number","number"]),module_wrapper.user_current_state_stringify=Module.cwrap("freecell_solver_user_current_state_stringify","number",["number","number","number","number","number"]),module_wrapper.user_stringify_move_ptr=Module.cwrap("freecell_solver_user_stringify_move_ptr","number",["number","number","number","number"]),module_wrapper.user_free=Module.cwrap("freecell_solver_user_free","number",["number"]),module_wrapper.user_limit_iterations_long=Module.cwrap("freecell_solver_user_limit_iterations_long","number",["number","number"]),module_wrapper.user_get_invalid_state_error_into_string=Module.cwrap("freecell_solver_user_get_invalid_state_error_into_string","number",["number","number","number"]),module_wrapper.user_cmd_line_parse_args_with_file_nesting_count=Module.cwrap("freecell_solver_user_cmd_line_parse_args_with_file_nesting_count","number",["number","number","number","number","number","number","number","number","number","number","number"]),module_wrapper.alloc_wrap=(my_malloc=>(size,desc,error)=>{const buffer=my_malloc(size);if(0===buffer)throw alert("Could not allocate "+desc+" (out of memory?)"),error;return buffer})(Module.cwrap("malloc","number",["number"])),module_wrapper.c_free=Module.cwrap("free","number",["number"]),module_wrapper.fc_solve_Pointer_stringify=ptr=>Module.UTF8ToString(ptr,1e4),module_wrapper};const remove_trailing_space_re=/[ \t]+$/gm;exports.FCS_STATE_WAS_SOLVED=0;exports.FCS_STATE_SUSPEND_PROCESS=5;const fc_solve_2uni_suit_map={H:"♥",C:"♣",D:"♦",S:"♠"},fc_solve_2uni_suit_map_num={H:1,C:3,D:2,S:0};function fc_solve_2uni_card(match,p1,p2,offset,mystring){return p1+fc_solve_2uni_suit_map[p2]}function fc_solve_2uni_char_card(match,p1,p2,offset,mystring){const rank=validate.ranks__str_to_int[p1];return String.fromCodePoint(16*fc_solve_2uni_suit_map_num[p2]+127136+rank)}function fc_solve_2uni_found(match,p1,p2,offset,mystring){return fc_solve_2uni_suit_map[p1]+p2}const card_re=new RegExp("\\b("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")\\b","g"),found_re=new RegExp("\\b("+french_cards_1.suit_re+")(-[0A2-9TJQK])\\b","g");exports.DisplayFilter=class{constructor(args){this.is_unicode_cards=args.is_unicode_cards,this.is_unicode_cards_chars=args.is_unicode_cards_chars}unicode_preprocess(out_buffer){return this.is_unicode_cards?this._replace_found(this.is_unicode_cards_chars?this._replace_char_card(out_buffer):this._replace_card(out_buffer)):out_buffer}_replace_char_card(s){return s.replace(card_re,fc_solve_2uni_char_card)}_replace_card(s){return s.replace(card_re,fc_solve_2uni_card)}_replace_found(s){return s.replace(found_re,fc_solve_2uni_found)}};exports.FC_Solve=class{constructor(args){const that=this;that.module_wrapper=args.module_wrapper,that._do_not_alert=!1,that.dir_base=args.dir_base,that.string_params=args.string_params?[args.string_params]:null,that.set_status_callback=args.set_status_callback,that.cmd_line_preset=args.cmd_line_preset,that.current_iters_limit=0,that.obj=(()=>{const ret_obj=that.module_wrapper.user_alloc();if(0===ret_obj)throw alert("Could not allocate solver instance (out of memory?)"),"Foo";if(0!==that._initialize_obj(ret_obj))throw that._do_not_alert?that._do_not_alert=!1:alert("Failed to initialize solver (Bug!)"),that.module_wrapper.user_free(ret_obj),"Bar";return ret_obj})(),that.proto_states_and_moves_seq=null,that._pre_expand_states_and_moves_seq=null,that._post_expand_states_and_moves_seq=null,that._state_string_buffer=that.module_wrapper.alloc_wrap(500,"state string buffer","Zam"),that._move_string_buffer=that.module_wrapper.alloc_wrap(200,"move string buffer","Plum")}set_status(myclass,mylabel){return this.set_status_callback(myclass,mylabel)}handle_err_code(solve_err_code){const that=this;if(8===solve_err_code){const error_string_ptr=that.module_wrapper.alloc_wrap(300,"state error string","Gum");that.module_wrapper.user_get_invalid_state_error_into_string(that.obj,error_string_ptr,1);const error_string=that.module_wrapper.fc_solve_Pointer_stringify(error_string_ptr);throw that.module_wrapper.c_free(error_string_ptr),alert(error_string+"\n"),"Foo"}if(solve_err_code===exports.FCS_STATE_SUSPEND_PROCESS)return that.current_iters_limit>=131072?void that.set_status("exceeded","Iterations count exceeded at "+that.current_iters_limit):void that.set_status("running","Running ("+that.current_iters_limit+" iterations)");if(solve_err_code!==exports.FCS_STATE_WAS_SOLVED){if(1!==solve_err_code)throw alert("Unknown Error code "+solve_err_code+"!"),"Foo";that.set_status("impossible","Could not solve.")}else that.set_status("solved","Solved")}resume_solution(){this._increase_iters_limit();const solve_err_code=this.module_wrapper.user_resume_solution(this.obj);return this.handle_err_code(solve_err_code),solve_err_code}do_solve(proto_board_string){const that=this;that.set_status("running","Running");try{that._increase_iters_limit();const board_string=that._process_board_string(proto_board_string),solve_err_code=that.module_wrapper.user_solve_board(that.obj,board_string);return that.handle_err_code(solve_err_code),solve_err_code}catch(e){return void that.set_status("error","Error")}}unicode_preprocess(out_buffer,display){return display.unicode_preprocess(out_buffer)}display_solution(args){const that=this,displayer=args.displayer;let ret;try{that._calc_states_and_moves_seq(),that.set_status("solved","Solved"),ret=that._display_specific_sol(that._pre_expand_states_and_moves_seq,displayer)}catch(e){return}return ret}display_expanded_moves_solution(args){return this._calc_expanded_seq(),this.set_status("solved","Solved"),this._display_specific_sol(this._post_expand_states_and_moves_seq,args.displayer)}calc_expanded_move(idx){const states_and_moves_sequence=this.proto_states_and_moves_seq;return states_and_moves_sequence[idx].exp||(states_and_moves_sequence[idx].exp=(0,web_fc_solve__expand_moves_1.fc_solve_expand_move)(8,4,states_and_moves_sequence[idx-1].str,states_and_moves_sequence[idx].m,states_and_moves_sequence[idx+1].str)),states_and_moves_sequence[idx].exp}generic_display_sol(args){return args.expand?this.display_expanded_moves_solution(args):this.display_solution(args)}get_num_freecells(){return this.module_wrapper.user_get_num_freecells(this.obj)}get_num_stacks(){return this.module_wrapper.user_get_num_stacks(this.obj)}_calc_states_and_moves_seq(){const that=this;if(that._pre_expand_states_and_moves_seq)return;const states_and_moves_sequence=[];function _out_state(s){states_and_moves_sequence.push({type:"s",str:s})}function get_state_str(){return that.module_wrapper.user_current_state_stringify(that.obj,that._state_string_buffer,1,0,1),that.module_wrapper.fc_solve_Pointer_stringify(that._state_string_buffer)}let move_ret_code;_out_state(get_state_str());const move_buffer=that.module_wrapper.alloc_wrap(128,"a buffer for the move","maven");for(;0===(move_ret_code=that.module_wrapper.user_get_next_move(that.obj,move_buffer));){const state_as_string=get_state_str();that.module_wrapper.user_stringify_move_ptr(that.obj,that._move_string_buffer,move_buffer,0);const move_as_string=that.module_wrapper.fc_solve_Pointer_stringify(that._move_string_buffer);states_and_moves_sequence.push({exp:null,is_exp:!1,m:{str:move_as_string,type:"m"},type:"m"}),_out_state(state_as_string)}that.proto_states_and_moves_seq=states_and_moves_sequence,that._pre_expand_states_and_moves_seq=states_and_moves_sequence.map((item=>"m"===item.type?item.m:item)),that._post_expand_states_and_moves_seq=null,that.module_wrapper.c_free(move_buffer),that.module_wrapper.user_free(that.obj),that.obj=0,that.module_wrapper.c_free(that._state_string_buffer),that._state_string_buffer=0,that.module_wrapper.c_free(that._move_string_buffer),that._move_string_buffer=0}_calc_expanded_seq(){const that=this;if(that._post_expand_states_and_moves_seq)return;that._calc_states_and_moves_seq();const states_and_moves_sequence=that.proto_states_and_moves_seq,new_array=[states_and_moves_sequence[0]];for(let i=1;i[]));let deck=(0,prange_1.perl_range)(0,51);randomizer.shuffle(deck),deck=deck.reverse();for(let i=0;i<52;i++)columns[i%8].push(deck[i]);function render_card(card){const suit=card%4,rank=Math.floor(card/4);return"A23456789TJQK".charAt(rank)+"CDHS".charAt(suit)}return columns.map((function(col){return": "+col.map(render_card).join(" ")+"\n"})).join("")};class MSRand{constructor(args){this.module_wrapper=args.module_wrapper,this.gamenumber=args.gamenumber,this.rander=this.module_wrapper.ms_rand__get_singleton(),this.module_wrapper.ms_rand__init(this.rander,""+this.gamenumber)}max_rand(mymax){return this.module_wrapper.ms_rand__mod_rand(this.rander,mymax)}shuffle(deck){if(deck.length){let i=deck.length;for(;--i;){const j=this.max_rand(i+1),tmp=deck[i];deck[i]=deck[j],deck[j]=tmp}}return deck}}})); \ No newline at end of file +YUI.add("breakout",(function(Y){function Breakout(config){var rows=config.rows,columns=config.columns;this._host=config.host,this._container=Y.Node.create("
"),this._nodes=[],rows||columns||(rows=8),this._rows=rows,this._columns=columns,Breakout.superclass.constructor.apply(this,arguments)}Breakout.NS="breakout",Breakout.Name="Breakout",Y.extend(Breakout,Y.Plugin.Base,{_splitNode:function(){var r,c,x,y,host,row,width=Math.round(this._blockWidth),height=Math.round(this._blockHeight),rows=this._rows,columns=this._columns,origin=this._host.getXY(),container=this._container,nodes=this._nodes=[],mask=Y.Node.create('
');for(container.setXY(origin),r=0;r-1&&(VERSION="3.5.0"),proto={applyConfig:function(o){o=o||NOOP;var attr,name,config=this.config,mods=config.modules,groups=config.groups,aliases=config.aliases,loader=this.Env._loader;for(name in o)o.hasOwnProperty(name)&&(attr=o[name],mods&&"modules"==name?clobber(mods,attr):aliases&&"aliases"==name?clobber(aliases,attr):groups&&"groups"==name?clobber(groups,attr):"win"==name?(config[name]=attr&&attr.contentWindow||attr,config.doc=config[name]?config[name].document:null):"_yuid"==name||(config[name]=attr));loader&&loader._config(o)},_config:function(o){this.applyConfig(o)},_init:function(){var filter,el,prop,Y=this,G_ENV=YUI.Env,Env=Y.Env;if(Y.version=VERSION,!Env){if(Y.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:BASE,cdn:BASE+VERSION+"/",_idx:0,_used:{},_attached:{},_exported:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(src,pattern){var path,filter,match=src.match(pattern);return match&&(path=RegExp.leftContext||src.slice(0,src.indexOf(match[0])),filter=match[3],match[1]&&(path+="?"+match[1]),path={filter:filter,path:path}),path},getBase:G_ENV&&G_ENV.getBase||function(pattern){var parsed,i,len,src,nodes=doc&&doc.getElementsByTagName("script")||[],path=Env.cdn;for(i=0,len=nodes.length;i
',YUI.Env.cssStampEl=el.firstChild,doc.body?doc.body.appendChild(YUI.Env.cssStampEl):docEl.insertBefore(YUI.Env.cssStampEl,docEl.firstChild)):doc&&doc.getElementById("yui3-css-stamp")&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=doc.getElementById("yui3-css-stamp")),Y.config.lang=Y.config.lang||"en-US",Y.config.base=YUI.config.base||YUI.config.defaultBase&&YUI.config.root&&YUI.config.defaultBase+YUI.config.root||Y.Env.getBase(Y.Env._BASE_RE),filter&&"mindebug".indexOf(filter)||(filter="min"),filter=filter?"-"+filter:filter,Y.config.loaderPath=YUI.config.loaderPath||"loader/loader"+filter+".js"},_afterConfig:function(){this.config.hasOwnProperty("global")||(this.config.global=Function("return this")())},_setup:function(){var i,Y=this,core=[],mods=YUI.Env.mods,extendedCore=Y.config.extendedCore||[],extras=Y.config.core||[].concat(YUI.Env.core).concat(extendedCore);for(i=0;i-1)for(j="YAHOO"==(d=arg.split("."))[0]?1:0;j-1?value(o,key):o[key];return void 0===val?match:val})):s},L.trim=L._isNative(STRING_PROTO.trim)&&!WHITESPACE.trim()?function(s){return s&&s.trim?s.trim():s}:function(s){try{return s.replace(TRIMREGEX,"")}catch(e){return s}},L.trimLeft=L._isNative(STRING_PROTO.trimLeft)&&!WHITESPACE.trimLeft()?function(s){return s.trimLeft()}:function(s){return s.replace(TRIM_LEFT_REGEX,"")},L.trimRight=L._isNative(STRING_PROTO.trimRight)&&!WHITESPACE.trimRight()?function(s){return s.trimRight()}:function(s){return s.replace(TRIM_RIGHT_REGEX,"")},L.type=function(o){return TYPES[typeof o]||TYPES[TOSTRING.call(o)]||(o?"object":"null")};var Lang=Y.Lang,Native=Array.prototype,hasOwn=Object.prototype.hasOwnProperty;function YArray(thing,startIndex,force){var len,result;if(startIndex||(startIndex=0),force||YArray.test(thing))try{return Native.slice.call(thing,startIndex)}catch(ex){for(result=[],len=thing.length;startIndexi&&i in values)||values[i]);return hash},YArray.indexOf=Lang._isNative(Native.indexOf)?function(array,value,from){return Native.indexOf.call(array,value,from)}:function(array,value,from){var len=array.length;for((from=((from=+from||0)>0||-1)*Math.floor(Math.abs(from)))<0&&(from+=len)<0&&(from=0);from1?Array.prototype.join.call(arguments,"__"):String(arg);return(!(key in cache)||refetch&&cache[key]==refetch)&&(cache[key]=source.apply(source,arguments)),cache[key]}},Y.getLocation=function(){var win=Y.config.win;return win&&win.location},Y.merge=function(){for(var key,obj,i=0,len=arguments.length,result={};i-1},O.each=function(obj,fn,thisObj,proto){var key;for(key in obj)(proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj);return Y},O.some=function(obj,fn,thisObj,proto){var key;for(key in obj)if((proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj))return!0;return!1},O.getValue=function(o,path){if(Lang.isObject(o)){var i,p=Y.Array(path),l=p.length;for(i=0;undefined!==o&&i=0){for(i=0;undefined!==ref&&i0),subUA||("object"==typeof process&&process.versions&&process.versions.node&&(o.os=process.platform,o.nodejs=numberify(process.versions.node)),YUI.Env.UA=o),o},Y.UA=YUI.Env.UA||YUI.Env.parseUA(),Y.UA.compareVersions=function(a,b){var aPart,aParts,bPart,bParts,i,len;if(a===b)return 0;for(aParts=(a+"").split("."),bParts=(b+"").split("."),i=0,len=Math.max(aParts.length,bParts.length);ibPart)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],"loader-pathogen-encoder":["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",(function(Y,NAME){var CUSTOM_ATTRS,Get,Transaction,Lang=Y.Lang;Y.Get=Get={cssOptions:{attributes:{rel:"stylesheet"},doc:Y.config.linkDoc||Y.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:Y.config.scriptDoc||Y.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(transaction){var i,id,item,len,pending;if(Y.log("`Y.Get.abort()` is deprecated as of 3.5.0. Use the `abort()` method on the transaction instead.","warn","get"),!transaction.abort)if(id=transaction,transaction=null,(pending=this._pending)&&pending.transaction.id===id)transaction=pending.transaction,this._pending=null;else for(i=0,len=this._queue.length;i=threshold&&(Y.log("autopurge triggered after "+this._purgeNodes.length+" nodes","info","get"),this._purge(this._purgeNodes))},_getEnv:function(){var doc=Y.config.doc,ua=Y.UA;return this._env={async:doc&&!0===doc.createElement("script").async||ua.ie>=10,cssFail:ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0,cssLoad:(!ua.gecko&&!ua.webkit||ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0)&&!(ua.chrome&&ua.chrome<=18),preservesScriptOrder:!!(ua.gecko||ua.opera||ua.ie&&ua.ie>=10)}},_getTransaction:function(urls,options){var i,len,req,url,requests=[];for(Lang.isArray(urls)||(urls=[urls]),(options=Y.merge(this.options,options)).attributes=Y.merge(this.options.attributes,options.attributes),i=0,len=urls.length;i-1&&purgeNodes.splice(index,1))}},Get.script=Get.js,Get.Transaction=Transaction=function(requests,options){this.id=Transaction._lastId+=1,this.data=options.data,this.errors=[],this.nodes=[],this.options=options,this.requests=requests,this._callbacks=[],this._queue=[],this._reqsWaiting=0,this.tId=this.id,this.win=options.win||Y.config.win},Transaction._lastId=0,Transaction.prototype={_state:"new",abort:function(msg){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:msg||"Aborted"}),this._finish()},execute:function(callback){var i,len,queue,req,self=this,requests=self.requests,state=self._state;if("done"!==state){if(callback&&self._callbacks.push(callback),"executing"!==state){for(self._state="executing",self._queue=queue=[],self.options.timeout&&(self._timeout=setTimeout((function(){self.abort("Timeout")}),self.options.timeout)),self._reqsWaiting=requests.length,i=0,len=requests.length;i=10?(node.onerror=function(){setTimeout(onError,0)},node.onload=function(){setTimeout(onLoad,0)}):(node.onerror=onError,node.onload=onLoad),env.cssFail||isScript||(cssTimeout=setTimeout(onError,req.timeout||3e3))):this._poll(req),this.nodes.push(node),insertBefore.parentNode.insertBefore(node,insertBefore)},_next:function(){this._pending||(this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish())},_poll:function(newReq){var i,j,nodeHref,req,sheets,self=this,pendingCSS=self._pendingCSS,isWebKit=Y.UA.webkit;if(!newReq||(pendingCSS||(pendingCSS=self._pendingCSS=[]),pendingCSS.push(newReq),!self._pollTimer)){for(self._pollTimer=null,i=0;i=0;)if(sheets[j].href===nodeHref){pendingCSS.splice(i,1),i-=1,self._progress(null,req);break}}else try{!!req.node.sheet.cssRules,pendingCSS.splice(i,1),i-=1,self._progress(null,req)}catch(ex){}pendingCSS.length&&(self._pollTimer=setTimeout((function(){self._poll.call(self)}),self.options.pollInterval))}},_progress:function(err,req){var options=this.options;err&&(req.error=err,this.errors.push({error:err,request:req}),Y.log(err,"error","get")),req.node._yuiget_finished=req.finished=!0,options.onProgress&&options.onProgress.call(options.context||this,this._getEventData(req)),req.autopurge&&(Get._autoPurge(this.options.purgethreshold),Get._purgeNodes.push(req.node)),this._pending===req&&(this._pending=null),this._reqsWaiting-=1,this._next()}}}),"3.18.1",{requires:["yui-base"]}),YUI.add("features",(function(Y,NAME){var feature_tests={};Y.mix(Y.namespace("Features"),{tests:feature_tests,add:function(cat,name,o){feature_tests[cat]=feature_tests[cat]||{},feature_tests[cat][name]=o},all:function(cat,args){var cat_o=feature_tests[cat],result=[];return cat_o&&Y.Object.each(cat_o,(function(v,k){result.push(k+":"+(Y.Features.test(cat,k,args)?1:0))})),result.length?result.join(";"):""},test:function(cat,name,args){args=args||[];var result,ua,test,cat_o=feature_tests[cat],feature=cat_o&&cat_o[name];return feature?(result=feature.result,Y.Lang.isUndefined(result)&&((ua=feature.ua)&&(result=Y.UA[ua]),!(test=feature.test)||ua&&!result||(result=test.apply(Y,args)),feature.result=result)):Y.log("Feature test "+cat+", "+name+" not found"),result}});var add=Y.Features.add;add("load","0",{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"}),add("load","1",{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"}),add("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),add("load","3",{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"}),add("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),add("load","5",{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"}),add("load","6",{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","7",{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","8",{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","9",{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","10",{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","11",{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","12",{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"}),add("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),add("load","14",{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"}),add("load","15",{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"}),add("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),add("load","17",{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"}),add("load","18",{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"}),add("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),add("load","20",{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"}),add("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs"}),add("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs"})}),"3.18.1",{requires:["yui-base"]}),YUI.add("intl-base",(function(Y,NAME){var SPLIT_REGEX=/[, ]/;Y.mix(Y.namespace("Intl"),{lookupBestLang:function(preferredLanguages,availableLanguages){var i,language,result,index;function scan(language){var i;for(i=0;i0;){if(result=scan(language))return result;if(!((index=language.lastIndexOf("-"))>=0))break;language=language.substring(0,index),index>=2&&"-"===language.charAt(index-2)&&(language=language.substring(0,index-2))}return""}})}),"3.18.1",{requires:["yui-base"]}),YUI.add("yui-log",(function(Y,NAME){var INSTANCE=Y,LEVELS={debug:1,info:2,warn:4,error:8};INSTANCE.log=function(msg,cat,src,silent){var bail,excl,incl,m,f,minlevel,Y=INSTANCE,c=Y.config,publisher=Y.fire?Y:YUI.Env.globalEvents;return c.debug&&(void 0!==(src=src||"")&&(excl=c.logExclude,(incl=c.logInclude)&&!(src in incl)?bail=1:incl&&src in incl?bail=!incl[src]:excl&&src in excl&&(bail=excl[src]),void 0===cat&&(cat="info"),Y.config.logLevel=Y.config.logLevel||"debug",minlevel=LEVELS[Y.config.logLevel.toLowerCase()],cat in LEVELS&&LEVELS[cat]-1,this.comboSep="&",this.maxURLLength=1024,this.ignoreRegistered=o.ignoreRegistered,this.root=Y.Env.meta.root,this.timeout=0,this.forceMap={},this.allowRollup=!1,this.filters={},this.required={},this.patterns={},this.moduleInfo={},this.groups=Y.merge(Y.Env.meta.groups),this.skin=Y.merge(Y.Env.meta.skin),this.conditions={},this.config=o,this._internal=!0,this._populateConditionsCache(),this.loaded=GLOBAL_LOADED[VERSION],this.async=!0,this._inspectPage(),this._internal=!1,this._config(o),this.forceMap=this.force?Y.Array.hash(this.force):{},this.testresults=null,Y.config.tests&&(this.testresults=Y.config.tests),this.sorted=[],this.dirty=!0,this.inserted={},this.skipped={},this.tested={},this.ignoreRegistered&&this._resetModules()},Y.Loader.prototype={getModuleInfo:function(name){var rawMetaModules,globalRenderedMods,internal,v,m=this.moduleInfo[name];return m||(rawMetaModules=META.modules,globalRenderedMods=GLOBAL_ENV._renderedMods,internal=this._internal,globalRenderedMods&&globalRenderedMods.hasOwnProperty(name)&&!this.ignoreRegistered?this.moduleInfo[name]=Y.merge(globalRenderedMods[name]):rawMetaModules.hasOwnProperty(name)&&(this._internal=!0,(v=this.addModule(rawMetaModules[name],name))&&v.type===CSS&&this.isCSSLoaded(v.name,!0)&&(Y.log("Found CSS module on page: "+v.name,"info","loader"),this.loaded[v.name]=!0),this._internal=internal),this.moduleInfo[name])},_expandAliases:function(list){var i,name,expanded=[],aliases=YUI.Env.aliases;for(list=Y.Array(list),i=0;i-1&&(skinpar=i);if(skindef&&(skindef[name]||skinpar&&skindef[skinpar]))for(skinname=name,skindef[skinpar]&&(skinname=skinpar),i=0;i-1},getModule:function(mname){if(!mname)return null;var p,found,pname,m=this.getModuleInfo(mname),patterns=this.patterns;if(!m||m&&m.ext)for(pname in patterns)if(patterns.hasOwnProperty(pname)&&((p=patterns[pname]).test||(p.test=this._patternTest),p.test(mname,pname))){found=p;break}return m?found&&m&&found.configFn&&!m.configFn&&(m.configFn=found.configFn,m.configFn(m)):found&&(p.action?p.action.call(this,mname,pname):(Y.log("Undefined module: "+mname+", matched a pattern: "+pname,"info","loader"),(m=this.addModule(Y.merge(found,{test:void 0,temp:!0}),mname))&&found.configFn&&(m.configFn=found.configFn))),m},_rollup:function(){},_reduce:function(r){r=r||this.required;var i,j,s,m,type=this.loadType,ignore=!!this.ignore&&yArray.hash(this.ignore);for(i in r)if(r.hasOwnProperty(i)&&(m=this.getModule(i),((this.loaded[i]||ON_PAGE[i])&&!this.forceMap[i]&&!this.ignoreRegistered||type&&m&&m.type!==type)&&delete r[i],ignore&&ignore[i]&&delete r[i],s=m&&m.supersedes))for(j=0;j0&&(_queue.running=!0,_queue.next()())},insert:function(o,type,skipsort){Y.log("public insert() "+(type||"")+", "+Y.Object.keys(this.required),"info","loader");var self=this,copy=Y.merge(this);delete copy.require,delete copy.dirty,_queue.add((function(){self._insert(copy,o,type,skipsort)})),this._continue()},loadNext:function(){Y.log("loadNext was called..","error","loader")},_filter:function(u,name,group){var f=this.filter,hasFilter=name&&name in this.filters,modFilter=hasFilter&&this.filters[name],groupName=group||(this.getModuleInfo(name)||{}).group||null;return groupName&&this.groups[groupName]&&this.groups[groupName].filter&&(modFilter=this.groups[groupName].filter,hasFilter=!0),u&&(hasFilter&&(f=L.isString(modFilter)?this.FILTER_DEFS[modFilter.toUpperCase()]||null:modFilter),f&&(u=u.replace(new RegExp(f.searchExp,"g"),f.replaceStr))),u},_url:function(path,name,base){return this._filter((base||this.base||"")+path,name)},resolve:function(calc,sorted){var addSingle,self=this,resolved={js:[],jsMods:[],css:[],cssMods:[]},usePathogen=Y.config.comboLoader&&Y.config.customComboBase;(self.skin.overrides||"sam"!==self.skin.defaultSkin||self.ignoreRegistered)&&self._resetModules(),calc&&self.calculate(),sorted=sorted||self.sorted,addSingle=function(mod){if(mod){var url,group=mod.group&&self.groups[mod.group]||NOT_FOUND;!1===group.async&&(mod.async=group.async),url=mod.fullpath?self._filter(mod.fullpath,mod.name):self._url(mod.path,mod.name,group.base||mod.base),(mod.attributes||!1===mod.async)&&(url={url:url,async:mod.async},mod.attributes&&(url.attributes=mod.attributes)),resolved[mod.type].push(url),resolved[mod.type+"Mods"].push(mod)}else Y.log("Undefined Module","warn","loader")};var comboSources,maxURLLength,comboMeta,comboBase,comboSep,group,mod,len,i,inserted=self.ignoreRegistered?{}:self.inserted,hasComboModule=!1;for(i=0,len=sorted.length;imaxURLLength){for(Y.log("Exceeded maxURLLength ("+maxURLLength+") for "+type+", splitting","info","loader"),fragSubset=[],i=0,len=frags.length;imaxURLLength&&(frag=fragSubset.pop(),tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)),fragSubset=[],frag&&fragSubset.push(frag));fragSubset.length&&(tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)))}else resolved[type].push(this._filter(tmpBase,null,comboMeta.group))}return resolved},load:function(cb){if(cb){var self=this,out=self.resolve(!0);self.data=out,self.onEnd=function(){cb.apply(self.context||self,arguments)},self.insert()}else Y.log("No callback supplied to load()","error","loader")}}}),"3.18.1",{requires:["get","features"]}),YUI.add("loader-rollup",(function(Y,NAME){Y.Loader.prototype._rollup=function(){var i,j,m,s,roll,rolled,c,smod,r=this.required,info=this.moduleInfo;if(this.dirty||!this.rollups)for(i in this.rollups={},info)info.hasOwnProperty(i)&&(m=this.getModule(i))&&m.rollup&&(this.rollups[i]=m);for(;;){for(i in rolled=!1,this.rollups)if(this.rollups.hasOwnProperty(i)&&!r[i]&&(!this.loaded[i]||this.forceMap[i])){if(s=(m=this.getModule(i)).supersedes||[],roll=!1,!m.rollup)continue;for(c=0,j=0;j=m.rollup))break}roll&&(r[i]=!0,rolled=!0,this.getRequires(m))}if(!rolled)break}}}),"3.18.1",{requires:["loader-base"]}),YUI.add("loader-yui3",(function(Y,NAME){YUI.Env[Y.version].modules=YUI.Env[Y.version].modules||{},Y.mix(YUI.Env[Y.version].modules,{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style","color-base"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-observable","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{use:["attribute-observable"]},"attribute-extras":{requires:["oop"]},"attribute-observable":{requires:["event-custom"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en","es","hu","it"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},axes:{use:["axis-numeric","axis-category","axis-time","axis-stacked"]},"axes-base":{use:["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"]},axis:{requires:["dom","widget","widget-position","widget-stack","graphics","axis-base"]},"axis-base":{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]},"axis-category":{requires:["axis","axis-category-base"]},"axis-category-base":{requires:["axis-base"]},"axis-numeric":{requires:["axis","axis-numeric-base"]},"axis-numeric-base":{requires:["axis-base"]},"axis-stacked":{requires:["axis-numeric","axis-stacked-base"]},"axis-stacked-base":{requires:["axis-numeric-base"]},"axis-time":{requires:["axis","axis-time-base"]},"axis-time-base":{requires:["axis-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{requires:["attribute-base","base-core","base-observable"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-observable":{requires:["attribute-observable","base-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base","escape"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","es","es-AR","fr","hu","it","ja","nb-NO","nl","pt-BR","ru","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-HANT-TW"],requires:["widget","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0},charts:{use:["charts-base"]},"charts-base":{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},color:{use:["color-base","color-hsl","color-harmony"]},"color-base":{requires:["yui-base"]},"color-harmony":{requires:["color-hsl"]},"color-hsl":{requires:["color-base"]},"color-hsv":{requires:["color-base"]},console:{lang:["en","es","hu","it","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},"content-editable":{requires:["node-base","editor-selection","stylesheet","plugin"]},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssnormalize"],type:"css"},"cssgrids-base":{optional:["cssnormalize"],type:"css"},"cssgrids-responsive":{optional:["cssnormalize"],requires:["cssgrids","cssgrids-responsive-base"],type:"css"},"cssgrids-units":{optional:["cssnormalize"],requires:["cssgrids-base"],type:"css"},cssnormalize:{type:"css"},"cssnormalize-context":{type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-foot":{requires:["datatable-core","view"]},"datatable-formatters":{requires:["datatable-body","datatype-number-format","datatype-date-format","escape"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-highlight":{requires:["datatable-base","event-hover"],skinnable:!0},"datatable-keynav":{requires:["datatable-base"]},"datatable-message":{lang:["en","fr","es","hu","it"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-paginator":{lang:["en","fr"],requires:["model","view","paginator-core","datatable-foot","datatable-paginator-templates"],skinnable:!0},"datatable-paginator-templates":{requires:["template"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-sort":{lang:["en","fr","es","hu"],requires:["datatable-base"],skinnable:!0},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","hu","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{requires:["escape"]},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base","selector-css2"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es","hu"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"},requires:["dom-style","color-base"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-inline":{requires:["editor-base","content-editable"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","plugin","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}},"graphics-group":{requires:["graphics"]},"graphics-svg":{condition:{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-pathogen-combohandler":{},"loader-pathogen-encoder":{use:["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-local":{requires:["model","json-stringify"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base","dom-style"]},"node-core":{requires:["dom-core","selector"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},paginator:{requires:["paginator-core"]},"paginator-core":{requires:["base"]},"paginator-url":{requires:["paginator"]},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swfdetect","escape","widget","base","cssbutton","node","event-custom","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"},requires:["yql","jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs"},requires:["yql"]},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs"},requires:["yql"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[Y.version].md5="2fd2be6b12ee9f999b4367499ae61aae"}),"3.18.1",{requires:["loader-base"]}),YUI.add("yui",(function(Y,NAME){}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,(function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))})),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),(function(e){t=t[e]})),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function i(e,i,r){var o,a,s,u,c,d,p,f,l,h,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(d=(e=e.split("/")).length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),function(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&v&&(g||x)){e:for(s=(a=e.split("/")).length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if((o=getOwn(v,g.slice(0,u).join("/")))&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return getOwn(y.pkgs,e)||e}function r(e){isBrowser&&each(scripts(),(function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0}))}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),d=(c=o(e))[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=s&&s.normalize?s.normalize(e,(function(e){return i(e,p,n)})):-1===e.indexOf("!")?i(e,p,n):e:(d=(c=o(h=i(e,p,n)))[0],h=c[1],r=!0,a=q.nameToUrl(h))),{prefix:d,name:h,parentMap:t,unnormalized:!!(u=!d||s||r?"":"_unnormalized"+(A+=1)),url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,(function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))})),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,(function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)})),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,(function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))})),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,(function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1})),o&&a.length)return(e=makeError("timeout","Load timeout for modules: "+a,null,a)).contextName=q.contextName,c(e);d&&each(s,(function(e){f(e,{},{})})),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout((function(){w=0,l()}),50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(null===(e=O.shift())[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,(function(e){this.emit("error",e)}))),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return e.prefix?this.callPlugin():this.load()}))):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((t=this.module)?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,(function(e){a.push(e.normalizedMap||e)})),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,(function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,(function(e){return i(e,h,!0)}))||""),u(o=a(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,(function(e){this.map.normalizedMap=o,this.init([],(function(){return e}),null,{enabled:!0,ignore:!0})}))),void((d=getOwn(S,o.id))&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,(function(e){this.emit("error",e)}))),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,(function(e){this.init([],(function(){return e}),null,{enabled:!0})})),n.error=bind(this,(function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,(function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)})),c(e)})),n.fromText=bind(this,(function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)})),void r.load(e.name,m,n,y))}))),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,(function(e){this.undefed||(this.defineDep(t,e),this.check())}))),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,(function(e){this.emit("error",e)})))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)}))),eachProp(this.pluginMaps,bind(this,(function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)}))),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],(function(e){e(t)})),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(-1===i.indexOf("?")?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,(function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e})),e.bundles&&eachProp(e.bundles,(function(e,t){each(e,(function(e){e!==t&&(R[e]=t)}))})),e.shim&&(eachProp(e.shim,(function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e})),y.shim=i),e.packages&&each(e.packages,(function(e){var i;i=(e="string"==typeof e?{name:e}:e).name,e.location&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(S,(function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))})),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,n){function o(i,r,u){var d,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(d=a(i,t,!1,!0).id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick((function(){v(),(f=s(a(null,t))).skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()})),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,(function(t,i){t[0]===e&&O.splice(i,1)})),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){getOwn(S,e.id)&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(null===(i=O.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,o=(n=e.split("/")).length;o>0;o-=1)if(u=getOwn(r,n.slice(0,o).join("/"))){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s=("/"===(s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js")).charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,(function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,(function(e){if(e.id===t.id)return i.push(r),!0}))})),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(e){if("interactive"===e.readyState)return interactiveScript=e})),interactiveScript}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return(r=req.createNode(n,t,i)).setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(e,i){t.push(i)})),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&((r=currentlyAddingScript||getInteractiveScript())&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(match,singlePrefix){return singlePrefix||""}function isFunction(it){return"[object Function]"===ostring.call(it)}function isArray(it){return"[object Array]"===ostring.call(it)}function each(ary,func){var i;if(ary)for(i=0;i-1&&(!ary[i]||!func(ary[i],i,ary));i-=1);}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return hasProp(obj,prop)&&obj[prop]}function eachProp(obj,func){var prop;for(prop in obj)if(hasProp(obj,prop)&&func(obj[prop],prop))break}function mixin(target,source,force,deepStringMixin){return source&&eachProp(source,(function(value,prop){!force&&hasProp(target,prop)||(!deepStringMixin||"object"!=typeof value||!value||isArray(value)||isFunction(value)||value instanceof RegExp?target[prop]=value:(target[prop]||(target[prop]={}),mixin(target[prop],value,force,deepStringMixin)))})),target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(err){throw err}function getGlobal(value){if(!value)return value;var g=global;return each(value.split("."),(function(part){g=g[part]})),g}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);return e.requireType=id,e.requireModules=requireModules,err&&(e.originalError=err),e}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;return isArray(deps)||"string"==typeof deps||(config=deps,isArray(callback)?(deps=callback,callback=errback,errback=optional):deps=[]),config&&config.context&&(contextName=config.context),(context=getOwn(contexts,contextName))||(context=contexts[contextName]=req.s.newContext(contextName)),config&&context.configure(config),context.require(deps,callback,errback)},req.config=function(config){return req(config)},req.nextTick=void 0!==setTimeout?function(fn){setTimeout(fn,4)}:function(fn){fn()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(prop){req[prop]=function(){var ctx=contexts[defContextName];return ctx.require[prop].apply(ctx,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(config,moduleName,url){var node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return node.type=config.scriptType||"text/javascript",node.charset="utf-8",node.async=!0,node},req.load=function(context,moduleName,url){var node,config=context&&context.config||{};if(isBrowser)return(node=req.createNode(config,moduleName,url)).setAttribute("data-requirecontext",context.contextName),node.setAttribute("data-requiremodule",moduleName),!node.attachEvent||node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0||isOpera?(node.addEventListener("load",context.onScriptLoad,!1),node.addEventListener("error",context.onScriptError,!1)):(useInteractive=!0,node.attachEvent("onreadystatechange",context.onScriptLoad)),node.src=url,config.onNodeCreated&&config.onNodeCreated(node,config,moduleName,url),currentlyAddingScript=node,baseElement?head.insertBefore(node,baseElement):head.appendChild(node),currentlyAddingScript=null,node;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(url),context.completeLoad(moduleName)}catch(e){context.onError(makeError("importscripts","importScripts failed for "+moduleName+" at "+url,e,[moduleName]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(script){if(head||(head=script.parentNode),dataMain=script.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(name,deps,callback){var node,context;"string"!=typeof name&&(callback=deps,deps=name,name=null),isArray(deps)||(callback=deps,deps=null),!deps&&isFunction(callback)&&(deps=[],callback.length&&(callback.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(match,dep){deps.push(dep)})),deps=(1===callback.length?["require"]:["require","exports","module"]).concat(deps))),useInteractive&&(node=currentlyAddingScript||getInteractiveScript())&&(name||(name=node.getAttribute("data-requiremodule")),context=contexts[node.getAttribute("data-requirecontext")]),context?(context.defQueue.push([name,deps,callback]),context.defQueueMap[name]=!0):globalDefQueue.push([name,deps,callback])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},registry={},enabledRegistry={},undefEvents={},defQueue=[],defined={},urlFetched={},bundlesMap={},requireCounter=1,unnormalizedCounter=1;function normalize(name,baseName,applyMap){var mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"];if(name&&(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=baseParts.slice(0,baseParts.length-1).concat(name)),function(ary){var i,part;for(i=0;i0&&(ary.splice(i-1,2),i-=2)}}(name),name=name.join("/")),applyMap&&map&&(baseParts||starMap)){outerLoop:for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=getOwn(map,baseParts.slice(0,j).join("/")))&&(mapValue=getOwn(mapValue,nameSegment))){foundMap=mapValue,foundI=i;break outerLoop}!foundStarMap&&starMap&&getOwn(starMap,nameSegment)&&(foundStarMap=getOwn(starMap,nameSegment),starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return getOwn(config.pkgs,name)||name}function removeScript(name){isBrowser&&each(scripts(),(function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName)return scriptNode.parentNode.removeChild(scriptNode),!0}))}function hasPathFallback(id){var pathConfig=getOwn(config.paths,id);if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1)return pathConfig.shift(),context.require.undef(id),context.makeRequire(null,{skipMap:!0})([id]),!0}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,nameParts,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=!0,normalizedName="";return name||(isDefine=!1,name="_@r"+(requireCounter+=1)),prefix=(nameParts=splitPrefix(name))[0],name=nameParts[1],prefix&&(prefix=normalize(prefix,parentName,applyMap),pluginModule=getOwn(defined,prefix)),name&&(prefix?normalizedName=pluginModule&&pluginModule.normalize?pluginModule.normalize(name,(function(name){return normalize(name,parentName,applyMap)})):-1===name.indexOf("!")?normalize(name,parentName,applyMap):name:(prefix=(nameParts=splitPrefix(normalizedName=normalize(name,parentName,applyMap)))[0],normalizedName=nameParts[1],isNormalized=!0,url=context.nameToUrl(normalizedName))),{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!(suffix=!prefix||pluginModule||isNormalized?"":"_unnormalized"+(unnormalizedCounter+=1)),url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=getOwn(registry,id);return mod||(mod=registry[id]=new context.Module(depMap)),mod}function on(depMap,name,fn){var id=depMap.id,mod=getOwn(registry,id);!hasProp(defined,id)||mod&&!mod.defineEmitComplete?(mod=getModule(depMap)).error&&"error"===name?fn(mod.error):mod.on(name,fn):"defined"===name&&fn(defined[id])}function onError(err,errback){var ids=err.requireModules,notified=!1;errback?errback(err):(each(ids,(function(id){var mod=getOwn(registry,id);mod&&(mod.error=err,mod.events.error&&(notified=!0,mod.emit("error",err)))})),notified||req.onError(err))}function takeGlobalQueue(){globalDefQueue.length&&(each(globalDefQueue,(function(queueItem){var id=queueItem[0];"string"==typeof id&&(context.defQueueMap[id]=!0),defQueue.push(queueItem)})),globalDefQueue=[])}function cleanRegistry(id){delete registry[id],delete enabledRegistry[id]}function breakCycle(mod,traced,processed){var id=mod.map.id;mod.error?mod.emit("error",mod.error):(traced[id]=!0,each(mod.depMaps,(function(depMap,i){var depId=depMap.id,dep=getOwn(registry,depId);!dep||mod.depMatched[i]||processed[depId]||(getOwn(traced,depId)?(mod.defineDep(i,defined[depId]),mod.check()):breakCycle(dep,traced,processed))})),processed[id]=!0)}function checkLoaded(){var err,usingPathFallback,waitInterval=1e3*config.waitSeconds,expired=waitInterval&&context.startTime+waitInterval<(new Date).getTime(),noLoads=[],reqCalls=[],stillLoading=!1,needCycleCheck=!0;if(!inCheckLoaded){if(inCheckLoaded=!0,eachProp(enabledRegistry,(function(mod){var map=mod.map,modId=map.id;if(mod.enabled&&(map.isDefine||reqCalls.push(mod),!mod.error))if(!mod.inited&&expired)hasPathFallback(modId)?(usingPathFallback=!0,stillLoading=!0):(noLoads.push(modId),removeScript(modId));else if(!mod.inited&&mod.fetched&&map.isDefine&&(stillLoading=!0,!map.prefix))return needCycleCheck=!1})),expired&&noLoads.length)return(err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads)).contextName=context.contextName,onError(err);needCycleCheck&&each(reqCalls,(function(mod){breakCycle(mod,{},{})})),expired&&!usingPathFallback||!stillLoading||!isBrowser&&!isWebWorker||checkLoadedTimeoutId||(checkLoadedTimeoutId=setTimeout((function(){checkLoadedTimeoutId=0,checkLoaded()}),50)),inCheckLoaded=!1}}function callGetModule(args){hasProp(defined,args[0])||getModule(makeModuleMap(args[0],null,!0)).init(args[1],args[2])}function removeListener(node,func,name,ieName){node.detachEvent&&!isOpera?ieName&&node.detachEvent(ieName,func):node.removeEventListener(name,func,!1)}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;return removeListener(node,context.onScriptLoad,"load","onreadystatechange"),removeListener(node,context.onScriptError,"error"),{node:node,id:node&&node.getAttribute("data-requiremodule")}}function intakeDefines(){var args;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0])return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]));callGetModule(args)}context.defQueueMap={}}return handlers={require:function(mod){return mod.require?mod.require:mod.require=context.makeRequire(mod.map)},exports:function(mod){if(mod.usingExports=!0,mod.map.isDefine)return mod.exports?defined[mod.map.id]=mod.exports:mod.exports=defined[mod.map.id]={}},module:function(mod){return mod.module?mod.module:mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return getOwn(config.config,mod.map.id)||{}},exports:mod.exports||(mod.exports={})}}},(Module=function(map){this.events=getOwn(undefEvents,map.id)||{},this.map=map,this.shim=getOwn(config.shim,map.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(depMaps,factory,errback,options){options=options||{},this.inited||(this.factory=factory,errback?this.on("error",errback):this.events.error&&(errback=bind(this,(function(err){this.emit("error",err)}))),this.depMaps=depMaps&&depMaps.slice(0),this.errback=errback,this.inited=!0,this.ignore=options.ignore,options.enabled||this.enabled?this.enable():this.check())},defineDep:function(i,depExports){this.depMatched[i]||(this.depMatched[i]=!0,this.depCount-=1,this.depExports[i]=depExports)},fetch:function(){if(!this.fetched){this.fetched=!0,context.startTime=(new Date).getTime();var map=this.map;if(!this.shim)return map.prefix?this.callPlugin():this.load();context.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return map.prefix?this.callPlugin():this.load()})))}},load:function(){var url=this.map.url;urlFetched[url]||(urlFetched[url]=!0,context.load(this.map.id,url))},check:function(){if(this.enabled&&!this.enabling){var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}else exports=context.execCb(id,factory,depExports,exports);if(this.map.isDefine&&void 0===exports&&((cjsModule=this.module)?exports=cjsModule.exports:this.usingExports&&(exports=this.exports)),err)return err.requireMap=this.map,err.requireModules=this.map.isDefine?[this.map.id]:null,err.requireType=this.map.isDefine?"define":"require",onError(this.error=err)}else exports=factory;if(this.exports=exports,this.map.isDefine&&!this.ignore&&(defined[id]=exports,req.onResourceLoad)){var resLoadMaps=[];each(this.depMaps,(function(depMap){resLoadMaps.push(depMap.normalizedMap||depMap)})),req.onResourceLoad(context,this.map,resLoadMaps)}cleanRegistry(id),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(context.defQueueMap,id)||this.fetch()}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix);this.depMaps.push(pluginMap),on(pluginMap,"defined",bind(this,(function(plugin){var load,normalizedMap,normalizedMod,bundleId=getOwn(bundlesMap,this.map.id),name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null,localRequire=context.makeRequire(map.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(plugin.normalize&&(name=plugin.normalize(name,(function(name){return normalize(name,parentName,!0)}))||""),on(normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap),"defined",bind(this,(function(value){this.map.normalizedMap=normalizedMap,this.init([],(function(){return value}),null,{enabled:!0,ignore:!0})}))),void((normalizedMod=getOwn(registry,normalizedMap.id))&&(this.depMaps.push(normalizedMap),this.events.error&&normalizedMod.on("error",bind(this,(function(err){this.emit("error",err)}))),normalizedMod.enable()))):bundleId?(this.map.url=context.nameToUrl(bundleId),void this.load()):((load=bind(this,(function(value){this.init([],(function(){return value}),null,{enabled:!0})}))).error=bind(this,(function(err){this.inited=!0,this.error=err,err.requireModules=[id],eachProp(registry,(function(mod){0===mod.map.id.indexOf(id+"_unnormalized")&&cleanRegistry(mod.map.id)})),onError(err)})),load.fromText=bind(this,(function(text,textAlt){var moduleName=map.name,moduleMap=makeModuleMap(moduleName),hasInteractive=useInteractive;textAlt&&(text=textAlt),hasInteractive&&(useInteractive=!1),getModule(moduleMap),hasProp(config.config,id)&&(config.config[moduleName]=config.config[id]);try{req.exec(text)}catch(e){return onError(makeError("fromtexteval","fromText eval for "+id+" failed: "+e,e,[id]))}hasInteractive&&(useInteractive=!0),this.depMaps.push(moduleMap),context.completeLoad(moduleName),localRequire([moduleName],load)})),void plugin.load(map.name,localRequire,load,config))}))),context.enable(pluginMap,this),this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){enabledRegistry[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(depMap,i){var id,mod,handler;if("string"==typeof depMap){if(depMap=makeModuleMap(depMap,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=depMap,handler=getOwn(handlers,depMap.id))return void(this.depExports[i]=handler(this));this.depCount+=1,on(depMap,"defined",bind(this,(function(depExports){this.undefed||(this.defineDep(i,depExports),this.check())}))),this.errback?on(depMap,"error",bind(this,this.errback)):this.events.error&&on(depMap,"error",bind(this,(function(err){this.emit("error",err)})))}id=depMap.id,mod=registry[id],hasProp(handlers,id)||!mod||mod.enabled||context.enable(depMap,this)}))),eachProp(this.pluginMaps,bind(this,(function(pluginMap){var mod=getOwn(registry,pluginMap.id);mod&&!mod.enabled&&context.enable(pluginMap,this)}))),this.enabling=!1,this.check()},on:function(name,cb){var cbs=this.events[name];cbs||(cbs=this.events[name]=[]),cbs.push(cb)},emit:function(name,evt){each(this.events[name],(function(cb){cb(evt)})),"error"===name&&delete this.events[name]}},context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,defQueue:defQueue,defQueueMap:{},Module:Module,makeModuleMap:makeModuleMap,nextTick:req.nextTick,onError:onError,configure:function(cfg){if(cfg.baseUrl&&"/"!==cfg.baseUrl.charAt(cfg.baseUrl.length-1)&&(cfg.baseUrl+="/"),"string"==typeof cfg.urlArgs){var urlArgs=cfg.urlArgs;cfg.urlArgs=function(id,url){return(-1===url.indexOf("?")?"?":"&")+urlArgs}}var shim=config.shim,objs={paths:!0,bundles:!0,config:!0,map:!0};eachProp(cfg,(function(value,prop){objs[prop]?(config[prop]||(config[prop]={}),mixin(config[prop],value,!0,!0)):config[prop]=value})),cfg.bundles&&eachProp(cfg.bundles,(function(value,prop){each(value,(function(v){v!==prop&&(bundlesMap[v]=prop)}))})),cfg.shim&&(eachProp(cfg.shim,(function(value,id){isArray(value)&&(value={deps:value}),!value.exports&&!value.init||value.exportsFn||(value.exportsFn=context.makeShimExports(value)),shim[id]=value})),config.shim=shim),cfg.packages&&each(cfg.packages,(function(pkgObj){var name;name=(pkgObj="string"==typeof pkgObj?{name:pkgObj}:pkgObj).name,pkgObj.location&&(config.paths[name]=pkgObj.location),config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(registry,(function(mod,id){mod.inited||mod.map.unnormalized||(mod.map=makeModuleMap(id,null,!0))})),(cfg.deps||cfg.callback)&&context.require(cfg.deps||[],cfg.callback)},makeShimExports:function(value){return function(){var ret;return value.init&&(ret=value.init.apply(global,arguments)),ret||value.exports&&getGlobal(value.exports)}},makeRequire:function(relMap,options){function localRequire(deps,callback,errback){var id,requireMod;return options.enableBuildCallback&&callback&&isFunction(callback)&&(callback.__requireJsBuild=!0),"string"==typeof deps?isFunction(callback)?onError(makeError("requireargs","Invalid require call"),errback):relMap&&hasProp(handlers,deps)?handlers[deps](registry[relMap.id]):req.get?req.get(context,deps,relMap,localRequire):(id=makeModuleMap(deps,relMap,!1,!0).id,hasProp(defined,id)?defined[id]:onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName+(relMap?"":". Use require([])")))):(intakeDefines(),context.nextTick((function(){intakeDefines(),(requireMod=getModule(makeModuleMap(null,relMap))).skipMap=options.skipMap,requireMod.init(deps,callback,errback,{enabled:!0}),checkLoaded()})),localRequire)}return options=options||{},mixin(localRequire,{isBrowser:isBrowser,toUrl:function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0];return-1!==index&&(!("."===segment||".."===segment)||index>1)&&(ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length),moduleNamePlusExt=moduleNamePlusExt.substring(0,index)),context.nameToUrl(normalize(moduleNamePlusExt,relMap&&relMap.id,!0),ext,!0)},defined:function(id){return hasProp(defined,makeModuleMap(id,relMap,!1,!0).id)},specified:function(id){return id=makeModuleMap(id,relMap,!1,!0).id,hasProp(defined,id)||hasProp(registry,id)}}),relMap||(localRequire.undef=function(id){takeGlobalQueue();var map=makeModuleMap(id,relMap,!0),mod=getOwn(registry,id);mod.undefed=!0,removeScript(id),delete defined[id],delete urlFetched[map.url],delete undefEvents[id],eachReverse(defQueue,(function(args,i){args[0]===id&&defQueue.splice(i,1)})),delete context.defQueueMap[id],mod&&(mod.events.defined&&(undefEvents[id]=mod.events),cleanRegistry(id))}),localRequire},enable:function(depMap){getOwn(registry,depMap.id)&&getModule(depMap).enable()},completeLoad:function(moduleName){var found,args,mod,shim=getOwn(config.shim,moduleName)||{},shExports=shim.exports;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0]){if(args[0]=moduleName,found)break;found=!0}else args[0]===moduleName&&(found=!0);callGetModule(args)}if(context.defQueueMap={},mod=getOwn(registry,moduleName),!found&&!hasProp(defined,moduleName)&&mod&&!mod.inited){if(!(!config.enforceDefine||shExports&&getGlobal(shExports)))return hasPathFallback(moduleName)?void 0:onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]));callGetModule([moduleName,shim.deps||[],shim.exportsFn])}checkLoaded()},nameToUrl:function(moduleName,ext,skipExt){var paths,syms,i,url,parentPath,bundleId,pkgMain=getOwn(config.pkgs,moduleName);if(pkgMain&&(moduleName=pkgMain),bundleId=getOwn(bundlesMap,moduleName))return context.nameToUrl(bundleId,ext,skipExt);if(req.jsExtRegExp.test(moduleName))url=moduleName+(ext||"");else{for(paths=config.paths,i=(syms=moduleName.split("/")).length;i>0;i-=1)if(parentPath=getOwn(paths,syms.slice(0,i).join("/"))){isArray(parentPath)&&(parentPath=parentPath[0]),syms.splice(0,i,parentPath);break}url=syms.join("/"),url=("/"===(url+=ext||(/^data\:|^blob\:|\?/.test(url)||skipExt?"":".js")).charAt(0)||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs&&!/^blob\:/.test(url)?url+config.urlArgs(moduleName,url):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if("load"===evt.type||readyRegExp.test((evt.currentTarget||evt.srcElement).readyState)){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){var parents=[];return eachProp(registry,(function(value,key){0!==key.indexOf("_@r")&&each(value.depMaps,(function(depMap){if(depMap.id===data.id)return parents.push(key),!0}))})),onError(makeError("scripterror",'Script error for "'+data.id+(parents.length?'", needed by: '+parents.join(", "):'"'),evt,[data.id]))}}},context.require=context.makeRequire(),context}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(script){if("interactive"===script.readyState)return interactiveScript=script})),interactiveScript}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if("function"!=typeof n)throw new TypeError("Expected a function");return setTimeout((function(){n.apply(Z,r)}),t)}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!=n&&t!=t:function(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),l=(f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,"[object Object]"==f);c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,(function(t){return t[0]==n})),s=An(o,(function(n){return n[0]==t}));if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=function(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return!1;c=-1;for(var f=!0,a=2&r?[]:Z;++ct&&(t=-t>u?0:u+t),0>(r=r>u?u:r)&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++er?jn(e+r,0):r:0)||0)-1;for(var u=t==t;++rarguments.length,mn)}function G(n,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!=n&&t!=t}function M(n){var t;return(t=null!=n)&&(t="number"==typeof(t=n.length)&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&("[object Function]"==(n=hn.call(n))||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&"object"==typeof n}function K(n){return"number"==typeof n||H(n)&&"[object Number]"==hn.call(n)}function L(n){return"string"==typeof n||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return"string"==typeof n?n:null==n?"":n+""}function W(n){return null==n?[]:function(n,t){return j(t,(function(t){return n[t]}))}(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return mn(o,(function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})})),n}var Z,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un="object"==typeof self&&self&&self.Object===Object&&self,on="object"==typeof global&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un="object"==typeof exports&&exports&&!exports.nodeType&&exports)&&"object"==typeof module&&module&&!module.nodeType&&module,fn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;var mn=function(n){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=-1,i=Object(r);++o(r=null==r?0:Fn(r))&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&renable_solitairey_ui;return function(){const active={name:"freecell",game:null},yui=YUI({base:"js/yui-unpack/yui/build/"});let Y;const games={agnes:"Agnes",klondike:"Klondike",klondike1t:"Klondike1T","flower-garden":"FlowerGarden","forty-thieves":"FortyThieves",freecell:"Freecell",golf:"Golf","grandfathers-clock":"GClock","monte-carlo":"MonteCarlo",pyramid:"Pyramid","russian-solitaire":"RussianSolitaire",scorpion:"Scorpion",spider:"Spider",spider1s:"Spider1S",spider2s:"Spider2S",spiderette:"Spiderette","tri-towers":"TriTowers","will-o-the-wisp":"WillOTheWisp",yukon:"Yukon"},extensions=["auto-turnover","statistics","solitaire-autoplay","solitaire"],Fade=function(){let body,el=null;const css={position:"absolute",display:"none",backgroundColor:"#000",opacity:.7,top:0,left:0,width:0,height:0,zIndex:1e3},element=function(){return null===el&&(el=Y.Node.create("
"),el.setStyles(css),body=Y.one(".solitairey_body").append(el)),el};return{show:function(){const el=element();css.display="block",css.width=el.get("winWidth"),css.height=el.get("winHeight"),el.setStyles(css)},hide:function(){css.display="none",element().setStyles(css)}}}();function switchToGame(name){active.name=name,active.game=Y.Solitaire[games[name]]}function playGame(name){switchToGame(name),enable_cookies()&&$.jStorage.set("FossSolitairey_options",name),newGame()}const GameChooser={selected:null,fade:!1,init:function(){this.refit()},refit:function(){const node=Y.one("#game-chooser");if(!node)return;const height=node.get("winHeight");node.setStyle("min-height",height)},show:function(fade){this.selected||this.select(active.name),fade&&(Fade.show(),this.fade=!0),Y.one("#game-chooser").addClass("show"),Y.one(".solitairey_body").addClass("scrollable")},hide:function(){this.fade&&Fade.hide(),Y.one("#game-chooser").removeClass("show"),Y.fire("gamechooser:hide",this),Y.one(".solitairey_body").removeClass("scrollable")},choose:function(){this.selected&&(this.hide(),playGame(this.selected))},select:function(game){const node=Y.one("#"+game+"> div"),previous=this.selected;previous!==game&&this.unSelect(),node&&(this.selected=game,new Y.Node(document.getElementById(game)).addClass("selected")),previous&&previous!==game&&Y.fire("gamechooser:select",this)},unSelect:function(){this.selected&&(new Y.Node(document.getElementById(this.selected)).removeClass("selected"),this.selected=null)}};const Themes={dondorf:{sizes:[61,79,95,122],61:{hiddenRankHeight:7,rankHeight:25,dimensions:[61,95]},79:{hiddenRankHeight:10,rankHeight:32,dimensions:[79,123]},95:{hiddenRankHeight:12,rankHeight:38,dimensions:[95,148]},122:{hiddenRankHeight:15,rankHeight:48,dimensions:[122,190]}},load:function(name){name in this||(name="dondorf"),Y.Solitaire.Card.base.theme!==name&&this.set(name,122)},set:function(name,size){const theme=this[name][size];Y.mix(Y.Solitaire.Card.base,{theme:name+"/"+size,hiddenRankHeight:theme.hiddenRankHeight,rankHeight:theme.rankHeight,width:theme.dimensions[0],height:theme.dimensions[1]},!0)}};function attachEvents(){if(Y.on("newAppGame",(function(){return newGame()})),enable_solitairey_ui&&(Y.on("click",restart,Y.one("#restart")),Y.on("click",(function(){GameChooser.show(!1)}),Y.one("#choose_game")),Y.on("click",newGame,Y.one("#new_deal")),Y.on("click",(function(){GameChooser.hide()}),Y.one("#close-chooser")),Y.on("click",(function(){active.game.undo()}),Y.one("#undo"))),enable_solitairey_ui){Y.on("click",(function(){const chromestore=Y.one(".chromestore");chromestore&&chromestore.addClass("hidden"),enable_cookies()&&$.jStorage.set("FossSolitairey_disable-chromestore-link",!0)}),Y.one(".chromestore")),Y.delegate("click",(function(e){GameChooser.select(e.currentTarget._node.id),GameChooser.choose()}),"#descriptions","li")}Y.one("document").on("keydown",(function(e){27===e.keyCode&&GameChooser.hide()})),Y.on("afterSetup",(function(){active.game.stationary((function(){resize()}))})),function(){let timer,attachEvent;window.addEventListener?attachEvent="addEventListener":window.attachEvent&&(attachEvent="attachEvent"),window[attachEvent](Y.Solitaire.Application.resizeEvent,(function(){clearTimeout(timer),timer=setTimeout(resize,250)}),!1)}()}const Preloader={loadingCount:0,loaded:function(callback){if(this.loadingCount)setTimeout(function(){this.loaded(callback)}.bind(this),100);else{const loading=Y.one(".loading");loading&&loading.addClass("hidden"),callback(),Fade.hide()}},load:function(path){const image=new Image;image.onload=function(){--this.loadingCount}.bind(this),image.src=path,this.loadingCount++},preload:function(){const that=this;const icons=["agnes","flower-garden","forty-thieves","freecell","gclock","golf","klondike1t","klondike","montecarlo","pyramid","scorpion","spider1s","spider2s","spiderette","spider","tritowers","will-o-the-wisp","yukon"];["s","h","c","d"].forEach((function(suit){for(let rank=1;rank<=13;++rank)that.load(Y.Solitaire.Card.base.theme+"/"+suit+rank+".png")})),this.load(Y.Solitaire.Card.base.theme+"/facedown.png"),enable_solitairey_ui&&icons.forEach((function(image){that.load("layouts/mini/"+image+".png")})),Fade.show();const loading=Y.one(".loading");loading&&loading.removeClass("hidden")}};function _my_load_func(){const save=!!enable_cookies()&&$.jStorage.get("FossSolitairey_saved-game");attachEvents(),function(){if(enable_cookies()){const options=$.jStorage.get("FossSolitairey_options");options&&(active.name=options)}Themes.load("dondorf")}(),Preloader.preload(),Preloader.loaded((function(){save?(clearDOM(),active.game=Y.Solitaire[games[active.name]],active.game.loadGame(save)):enable_solitairey_ui&&playGame(active.name)})),GameChooser.init(),schedule_cb&&schedule_cb(Y)}function resize(){const game=active.game,el=game.container(),padding=Y.Solitaire.padding,offset=Y.Solitaire.offset,width=el.get("winWidth")-padding.x,height=el.get("winHeight")-padding.y;Y.Solitaire.Application.windowHeight=height;const ratio=Math.min((width-offset.left)/game.width(),(height-offset.top)/game.height());active.game.resize(ratio),GameChooser.refit()}function clearDOM(){Y.all(".stack, .card").remove()}function restart(){if(enable_cookies()){const init=Y.Cookie.get("FossSolitairey_initial-game");if(init){clearDOM();const game=active.game;game.cleanup(),game.loadGame(init),game.save()}}}function clearGame(){const game=active.game;clearDOM(),game.cleanup()}function newGame(){clearGame(),active.game.newGame()}newGameRun=function(){playGame("freecell")},schedule=function(cb){schedule_cb=cb},yui.use.apply(yui,function(){const modules=extensions.slice();for(const m in games)games.hasOwnProperty(m)&&modules.unshift(m);return modules}().concat((function(YUI){Y=YUI,Y.on("newGameRun",newGameRun),Y.Solitaire.Application={windowHeight:0,resizeEvent:"resize",GameChooser:GameChooser,newGame:newGame,clearDOM:clearGame,switchToGame:switchToGame},Y.on("domready",_my_load_func)}))),window.setTimeout((function(){yui.use.apply(yui,["solver-freecell"])}),400)}(),{schedule:schedule,newGameRun:newGameRun,setUI:v=>{enable_solitairey_ui=v}}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-stack-clear",(function(Y){const Solitaire=Y.Solitaire;function clearComplete(stack,startIndex){const cards=stack.cards;let count=cards.length-startIndex;const foundation=Y.Array.find(Solitaire.game.foundation.stacks,(function(stack){return!stack.cards.length}));Solitaire.stationary((function(){for(;count;)_.last(cards).moveTo(foundation),count--})),stack.updateCardsPosition()}Y.namespace("Solitaire.AutoStackClear"),Solitaire.AutoStackClear.register=function(){Y.on("solitaire|tableau:afterPush",(function(stack){!function(stack,callback){const cards=stack.cards;let rank,suit,card,i;if(!cards.length)return!1;for(i=cards.length-1,rank=1,suit=cards[i].suit;i>=0&&rank<14;i--,rank++)if(card=cards[i],card.isFaceDown||card.rank!==rank||card.suit!==suit)return!1;const complete=14===rank;complete&&"function"==typeof callback&&callback(stack,i+1)}(stack,clearComplete)}))}}),"0.0.1",{requires:["solitaire"]}),{auto_stack:!0}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-turnover",(function(Y){Y.on("tableau:afterPop",(function(stack){stack.cards.forEach((function(card){card&&card.isFaceDown&&card.isFree()&&card.faceUp()}))}))}),"0.0.1",{requires:["solitaire"]}),{}})),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-autoplay",(function(Y){Y.namespace("Solitaire.Autoplay");const Solitaire=Y.Solitaire,Autoplay=Solitaire.Autoplay;let whenWon=!0,autoPlayInterval=null;const autoPlayable=["Klondike","Klondike1T","FortyThieves","GClock","Freecell","FlowerGarden","Yukon"];function autoPlay(){let played=!1;Solitaire.game.eachStack((function(stack){const field=stack.field;played||"foundation"===field||"deck"===field||(played=!stack.eachCard((function(card){return!card.autoPlay()})))}))}Y.on("endTurn",(function(){whenWon&&-1!==autoPlayable.indexOf(Solitaire.game.name())&&null===autoPlayInterval&&function(){let stop=!1;return Solitaire.game.eachStack((function(stack){const field=stack.field;let prevRank=14;stop||"tableau"!==field&&"waste"!==field||stack.eachCard((function(card){if(card.rank>prevRank||card.isFaceDown)return stop=!0,!1;prevRank=card.rank}))})),!stop}()&&Y.fire("autoPlay")})),Y.on("win",(function(){clearInterval(autoPlayInterval),autoPlayInterval=null})),Y.on("autoPlay",(function(){autoPlayInterval=setInterval(autoPlay,130)})),Y.mix(Autoplay,{enable:function(){whenWon=!0},disable:function(){whenWon=!1}})}),"0.0.1",{requires:["solitaire"]}),{}})),YUI.add("flower-garden",(function(Y){const Solitaire=Y.Solitaire,FlowerGarden=Y.Solitaire.FlowerGarden=Solitaire.instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,i,stack=0;const stacks=this.tableau.stacks;for(deck=this.deck,reserve=this.reserve.stacks[0],i=0;i<36;i++)card=deck.pop(),stacks[stack].push(card.faceUp()),stack++,6===stack&&(stack=0);for(;card=deck.pop();)card.faceUp(),reserve.push(card)},height:function(){return 5.5*this.Card.base.height},maxStackHeight:function(){return 4.4*this.Card.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 4.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:1,layout:{hspacing:1.25,top:function(){return 4.5*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:6,layout:{hspacing:1.25,top:function(){return 1.25*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{rankHeight:24,createProxyStack:function(){let stack;switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this);case"reserve":stack=Solitaire.instance(this.stack),stack.cards=[this],this.proxyStack=stack}return this.proxyStack},moveTo:function(stack){const cards=this.stack.cards,index=cards.indexOf(this);let i,len;for(Solitaire.Card.moveTo.call(this,stack),cards.splice(index,0,null),i=index+1,len=cards.length;istop&&i;i--)deck.my_Last().faceUp().moveTo(waste)},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 3*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck",init:function(){Solitaire.Deck.init.call(this),this.cards.forEach((function(c){c.faceDown()}))},createStack:function(){for(let i=this.cards.length-1;i>=0;i--)this.stacks[0].push(this.cards[i])}}),Waste:{stackConfig:{total:1,layout:{hspacing:0,top:0,left:function(){return 1.25*Solitaire.Card.width}}},field:"waste",draggable:!0},Tableau:{stackConfig:{total:10,layout:{hspacing:1.31,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.suit===this.suit&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});FortyThieves.fields.forEach((function(field){FortyThieves[field].Stack=Solitaire.instance(FortyThieves.Stack)})),Y.mix(FortyThieves.Stack,{cssClass:"freestack",validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(FortyThieves.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(FortyThieves.Deck.Stack,{createDOMElement:function(){Solitaire.Stack.createDOMElement.call(this),this.node.on("click",Solitaire.Events.clickEmptyDeck)}},!0),FortyThieves.Foundation.Stack.cssClass="freefoundation"}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){const instance=solitaire.instance;return YUI.add("freecell",(function(Y){const Solitaire=Y.Solitaire,Freecell=Y.Solitaire.Freecell=instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,stack=0;const stacks=this.tableau.stacks;for(;card=this.deck.pop();)stacks[stack].push(card.faceUp()),stack++,8===stack&&(stack=0)},openSlots:function(exclude){let total=1,freeTableaus=0;const rStacks=this.reserve.stacks,tStacks=this.tableau.stacks;for(let i=0;i<4;i++)rStacks[i].my_Last()||++total;for(let i=0;i<8;i++){const stack=tStacks[i];exclude!==stack&&!stack.my_Last()&&++freeTableaus}return total*Math.pow(2,freeTableaus)},Stack:instance(Solitaire.Stack),height:function(){return 5*this.Card.base.height},Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 6*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:0}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:instance(Solitaire.Card,{playable:function(){switch(this.stack.field){case"reserve":return!0;case"tableau":return this.createProxyStack();case"foundation":return!1}},createProxyStack:function(){const stack=Solitaire.Card.createProxyStack.call(this);return this.proxyStack=stack&&stack.cards.length<=Freecell.openSlots(stack)?stack:null,this.proxyStack},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return!target||target.color!==this.color&&target.rank===this.rank+1;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;case"reserve":return!target}}})});Freecell.fields.forEach((function(field){Freecell[field].Stack=instance(Freecell.Stack)})),Y.mix(Freecell.Stack,{validTarget:function(stack){return!("tableau"!==stack.field||!this.first().validTarget(stack))&&this.cards.length<=Freecell.openSlots(stack)}},!0),Y.mix(Freecell.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),{instance:instance}})),YUI.add("golf",(function(Y){const Solitaire=Y.Solitaire,Golf=Y.Solitaire.Golf=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],deal:function(){let card,stack,row;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(row=0;row<5;row++)for(stack=0;stack<7;stack++)card=deck.pop().faceUp(),stacks[stack].push(card);card=deck.pop().faceUp(),foundation.push(card),deck.createStack()},turnOver:function(){const deck=this.deck.stacks[0],foundation=this.foundation.stacks[0],last=deck.my_Last();last&&last.faceUp().moveTo(foundation)},isWon:function(){let won=!0;return this.eachStack((function(stack){stack.eachCard((function(card){return card&&(won=!1),won}))}),"tableau"),won},height:function(){return 4*this.Card.base.height},Deck:Solitaire.instance(Solitaire.Deck,{field:"deck",stackConfig:{total:1,layout:{hspacing:0,top:function(){return 3*Solitaire.Card.height},left:0}},createStack:function(){let i,len;for(i=0,len=this.cards.length;i=0;){for(card=cards[i],found=!1,rank=2;rank<=13;rank++)if(card.rank===rank&&card.suit===wrap(suits,rank)){found=!0,cards.splice(i,1),clock[rank-2]=card.faceUp();break}found||(stacks[stack].push(card.faceUp()),stack=(stack+1)%8),i--}for(i=0;i<12;i++)foundations[(i+2)%12].push(clock[i])},height:function(){return 6.7*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:12,layout:{hspacing:1.25,top:function(){return 3*Solitaire.Card.height},left:function(){return 3.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 7.25*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{createProxyStack:function(){switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this)}return this.proxyStack},validTarget:function(stack){const target=stack.my_Last();let rank,hour;switch(stack.field){case"tableau":return!target||target.rank===this.rank+1;case"foundation":return hour=(stack.index()+3)%12,rank=target.rank,target.suit===this.suit&&(target.rank+1)%13==this.rank%13&&(low=stack.first().rank,high=hour,value=this.rank,low<=high?low<=value&&value<=high:low<=value||value<=high);default:return!1}var low,high,value}})});function normalize(valOrFunction){const val="function"==typeof valOrFunction?valOrFunction():valOrFunction;return isNaN(val)?void 0:val}GClock.fields.forEach((function(field){GClock[field].Stack=Solitaire.instance(GClock.Stack)})),Y.mix(GClock.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(GClock.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(GClock.Foundation.Stack,{index:function(){return GClock.foundation.stacks.indexOf(this)},layout:function(layout,i){const top=Math.sin(Math.PI*i/6)*Solitaire.Card.height*2.25,left=Math.cos(Math.PI*i/6)*Solitaire.Card.width*3;this.top=top+normalize(layout.top),this.left=left+normalize(layout.left)}},!0)}),"0.0.1",{requires:["solitaire"]}),YUI.add("solitaire-background-fix",(function(Y){let _body;function resize(){const width=body().get("winWidth"),height=body().get("winHeight"),style=document.body.style;Y.UA.mobile||body().setStyles({width:width,height:height}),void 0===style.backgroundSize&&void 0===style.MozBackgroundSize&&body().setStyles({backgroundImage:"url(greentiled.jpg)",backgroundRepeat:"repeat"})}function body(){return _body||(_body=new Y.Node(document.body)),_body}Y.on("load",resize),Y.on("resize",resize)}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-ios",(function(Y){if(Y.UA.ios){var setCardPosition,Solitaire=Y.Solitaire,_scale=Solitaire.scale,BARE_LAYOUT={hspacing:0,vspacing:0,left:0,top:0},DEFAULTS={scale:1,offset:60,maxStackHeight:155},OPTIONS={Agnes:{offset:[null,5],maxStackHeight:260},FlowerGarden:{offset:[-60,5],maxStackHeight:235},Freecell:{scale:[1,.93],offset:[35,5]},Golf:{scale:[1.1,1],offset:[45,8]},GClock:{scale:.93,offset:5,maxStackHeight:130},Klondike:{offset:[null,5],maxStackHeight:[null,340]},MonteCarlo:{scale:[.88,1],offset:[80,15]},Pyramid:{offset:20},Scorpion:{offset:5,maxStackHeight:[235,380]},Spider:{scale:[1.13,.79],offset:[5,2],maxStackHeight:[160,340]},TriTowers:{scale:.9,offset:10},Yukon:{scale:[.95,1],offset:[50,5],maxStackHeight:[235,390]}},gameOverrides={Agnes:function(){var hspacing={hspacing:1.13};fieldLayout(this,"Reserve",Y.merge(hspacing,{top:60})),fieldLayout(this,"Tableau",Y.merge(hspacing,{top:145})),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:135}))},FlowerGarden:[function(){this.Card.rankHeight=15,fieldLayout(this,"Reserve",{top:0,left:70}),fieldLayout(this,"Foundation",{top:0,left:470,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{top:0,left:140}),Y.mix(this.Reserve.Stack,{setCardPosition:function(card){var last=_.last(this.cards),top=last?last.top+11:this.top,left=this.left;card.left=left,card.top=top},update:Solitaire.noop},!0)},(setCardPosition=Solitaire.FlowerGarden.Reserve.Stack.setCardPosition,function(){fieldLayout(this,"Tableau",{left:10,top:120}),fieldLayout(this,"Reserve",{left:17,top:60}),fieldLayout(this,"Foundation",{left:55,top:0,hspacing:1.5,vspacing:0}),Y.mix(this.Reserve.Stack,{setCardPosition:setCardPosition,update:Solitaire.noop},!0)})],Freecell:[originalLayout("Freecell",["Foundation","Reserve","Tableau"]),function(){var hspacing={hspacing:1.05};fieldLayout(this,"Tableau",hspacing),fieldLayout(this,"Reserve",hspacing),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:157}))}],Golf:[originalLayout("Golf",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{hspacing:1.1}),fieldLayout(this,"Foundation",{left:132})}],GClock:function(){fieldLayout(this,"Foundation",{left:143}),fieldLayout(this,"Tableau",{left:0,top:250,hspacing:1.05})},Klondike:[function(){originalLayout("Klondike","Foundation").call(this),originalLayout("Klondike","Tableau").call(this)},function(){Y.mix(this.Foundation.stackConfig.layout,{left:135,hspacing:1.13},!0),Y.mix(this.Tableau.stackConfig.layout,{hspacing:1.13},!0)}],MonteCarlo:function(){fieldLayout(this,"Tableau",{cardGap:1.1,vspacing:1.05})},Pyramid:[function(){var deck=originalLayout("Pyramid","Deck"),waste=originalLayout("Pyramid","Waste");return function(){deck.call(this),waste.call(this),Y.mix(this.Tableau.stackConfig.layout,{left:190,cardGap:1.1,hspacing:-.55},!0)}}(),function(){Y.mix(this.Deck.stackConfig.layout,{left:-10,top:300},!0),Y.mix(this.Waste.stackConfig.layout,{top:300},!0),Y.mix(this.Tableau.stackConfig.layout,{left:120,cardGap:1.1,hspacing:-.55},!0)}],Scorpion:[function(){fieldLayout(this,"Deck",{top:0,left:0}),fieldLayout(this,"Foundation",{top:0,left:420,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{left:60,top:0,hspacing:1.13})},function(){fieldLayout(this,"Deck",{left:10,top:0}),fieldLayout(this,"Foundation",{left:75,top:0,hspacing:1.5,vspacing:0}),fieldLayout(this,"Tableau",{left:0,top:60,hspacing:1.13})}],Spider:[function(){fieldLayout(this,"Foundation",{left:94,hspacing:1.05}),fieldLayout(this,"Tableau",{top:65,hspacing:1.05})},function(){fieldLayout(this,"Foundation",{left:62,hspacing:1}),fieldLayout(this,"Tableau",{hspacing:1})}],TriTowers:function(){Y.mix(this.Tableau.stackConfig.layout,{hspacing:-.5,rowGaps:[3,2,1,0],cardGap:1},!0)},RussianSolitaire:[originalLayout("RussianSolitaire",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}],Yukon:[originalLayout("Yukon",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}]};OPTIONS.FortyThieves=OPTIONS.Spider1S=OPTIONS.Spider2S=OPTIONS.Spider,gameOverrides.FortyThieves=gameOverrides.Spider1S=gameOverrides.Spider2S=gameOverrides.Spider,OPTIONS.WillOTheWisp=OPTIONS.Spiderette=OPTIONS.Klondike1T=OPTIONS.Klondike,gameOverrides.WillOTheWisp=gameOverrides.Spiderette=gameOverrides.Klondike1T=gameOverrides.Klondike,OPTIONS.RussianSolitaire=OPTIONS.Yukon,Y.mix(Y.DD.DDM,{useHash:!1,_pg_activate:Solitaire.noop,_pg_size:function(){this.activeDrag&&this._pg.setStyles({width:"100%",height:"100%"})}},!0),Y.DD.DDM.set("throttleTime",40),Y.mix(Y.DD.Drop.prototype,{_activateShim:function(){var DDM=Y.DD.DDM;return!!DDM.activeDrag&&(this.get("node")!==DDM.activeDrag.get("node")&&(!this.get("lock")&&void(this.inGroup(DDM.activeDrag.get("groups"))?(DDM._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get("node")),this.sizeShim()):DDM._removeValid(this))))},_deactivateShim:function(){this.overTarget=!1}},!0),Solitaire.Statistics.winDisplay=function(){alert("You win!")},Solitaire.scale=Solitaire.noop,Solitaire.Card.ghost=!1,Solitaire.Animation.animate=!1,Solitaire.Card.base={theme:"mobile",hiddenRankHeight:3,rankHeight:15,width:40,height:50},Y.on("beforeSetup",setLayout),Y.on("beforeResize",setLayout),Y.on("afterResize",scrollToTop),Y.on("load",scrollToTop),Y.on("touchstart",(function(e){e.target._node===document.body&&e.preventDefault()}),document),Y.on("touchmove",(function(e){e.target.test("#descriptions *")||e.preventDefault()}),document),Y.on("domready",(function(){var undo,cancel,showMenu,menu,body,nav,fb,index,closeMenu=function(){menu.removeClass("show")};(index=0,{deleteSelector:function(selector){var rules,idx,ss=document.styleSheets[index];ss&&-1!==(idx=(rules=Array.prototype.splice.call(ss.rules,0)).indexOf(rules.filter((function(rule){return rule.selectorText===selector}))[0]))&&ss.deleteRule(idx)}}).deleteSelector("#menu li:hover"),menu=Y.one("#menu"),body=Y.one("body"),undo=Y.one("#undo"),fb=Y.one("#social"),nav=Y.Node.create("
"),stack=this.proxyStack;if(stack)node.setStyles({opacity:1,top:-this.top,left:-this.left}),this.proxyCards().forEach((function(c){c.proxyStack=stack,node.append(c.node)}));else{if(!this.ghost)return null;node.setStyles({opacity:.6,top:-this.top,left:-this.left}).append(this.node.cloneNode(!0))}return node},updatePosition:function(fields){if(!this.node)return;const to={left:this.left+"px",top:this.top+"px",zIndex:this.zIndex},origin=this.origin;this.positioned||this.node.setStyles({left:normalize(origin.left),top:normalize(origin.top)}),Y.Solitaire.Animation.init(this,to,fields)},pushPosition:function(){const index=this.index>=0?this.index:this.stack.cards.indexOf(this);Solitaire.pushMove({card:this,index:index,from:this.stack})},moveTo:function(stack){const origin=this.stack;return this.pushPosition(),origin.deleteItem(this),stack.push(this),Y.fire(origin.field+":afterPop",origin),this},after:function(callback){this.callback=callback},runCallback:function(){this.callback&&(this.callback.call(this),this.callback=null)}},Y.Solitaire.Stack={cards:null,node:null,images:{tableau:"freeslot.png",deck:"freeslot.png",reserve:"freeslot.png",foundation:"freeslot.png"},serialize:function(){let i,len,card,bite;const cards=this.cards,serialized=[],suits=Game.deck.suits;for(i=0,len=cards.length;i>2&15,deck.suits[3&value]),64&value?card.faceDown(!0):card.faceUp(!0)),card})),this.update()},imageSrc:function(){const basename=this.images[this.field];return basename?Solitaire.Card.base.theme+"/"+basename:"trans.gif"},layout:function(layout){const hoffset=layout.hoffset*Y.Solitaire.Card.width,voffset=layout.voffset*Y.Solitaire.Card.height,gameOffset=Solitaire.offset,self=this;["top","left"].forEach((function(p){self[p]=normalize(layout[p])})),this.left+=hoffset+gameOffset.left,this.top+=voffset+gameOffset.top},deleteItem:function(card){_deleteItem(this.cards,card)},push:function(card,temp){const last=this.my_Last(),to=this.field,from=card.stack?card.stack.field:"deck";last?card.zIndex=last.zIndex+1:"deck"===to||"foundation"===to?card.zIndex=200:"deck"===from&&(card.zIndex=Game.Card.zIndex),temp||(card.stack=this,this.setCardPosition(card),card.truncatePosition(),card.ensureDOM()),this.cards.push(card),temp||card.updatePosition({from:from,to:to})},pushStack:function(proxy){const origin=Solitaire.activeCard.stack,stack=this;origin.eachCard((function(card,i){card.index=i})),Game.stationary((function(){proxy.eachCard((function(card){card.moveTo(stack),card.index=-1})),origin.eachCard((function(card){card.index=-1}))})),origin.updateCardsPosition(),origin.update(),Y.fire(stack.field+":afterPush",stack)},adjustRankHeight:function(){const cards=this.cards,last=this.my_Last(),max=Game.maxStackHeight();let sumRankHeights,i,len,sumHidden=0,sumVisible=0,height=0,countHidden=0,countVisible=0;const Card=Solitaire.Card;if(cards.length<=1)return;for(i=0,len=cards.length-1;i").setAttribute("src",this.imageSrc()).setData("target",this).plug(Y.Plugin.Drop,{useShim:!0});this.updateStyle(),Solitaire.container().append(node)},cleanup:function(){const n=this.node;n&&n.clearData().destroy(!0),this.eachCard((function(c){c.destroyNode()}))},updateDragGroups:function(){const active=Solitaire.activeCard,last=this.my_Last();this.eachCard((function(c){c.node.drop.removeFromGroup("open")})),active.validTarget(this)?(last&&last.node.drop.addToGroup("open"),this.node.drop.addToGroup("open")):this.node.drop.removeFromGroup("open")},validCard:function(){return!0},validProxy:function(card){return card&&card.validTarget(this)&&this.validCard(card)},update:function(){}},Y.Solitaire.Animation={animate:!0,dealing:!1,duration:.5,interval:20,queue:new Y.AsyncQueue,init:function(card,to,fields){if(!this.animate)return card.node.setStyles(to),card.positioned=!0,void setTimeout((function(){card.runCallback()}),0);const node=card.node,q=this.queue,speeds=card.animSpeeds,from=mapAppend(function(that){for(const p in that)that.hasOwnProperty(p)&&(that[p]=parseFloat(that[p]));return that}({top:node.getStyle("top"),left:node.getStyle("left")}),"px");let duration;const zIndex=to.zIndex;if(from.top===to.top&&from.left===to.left)return;duration=this.dealing?speeds.slow:fields&&fields.from!==fields.to&&"waste"!==fields.to&&"foundation"!==fields.to?"deck"===fields.from?speeds.slow:speeds.mid:speeds.fast,node.setStyle("zIndex",500+zIndex),delete to.zIndex;const anim=new Y.Anim({node:node,from:from,to:to,easing:Y.Easing.easeOut,duration:duration});anim.on("end",(function(){card.positioned=!0,node.setStyle("zIndex",zIndex),card.runCallback()})),q.add((function(){anim.run()})),q.run()},initQueue:function(){this.queue.defaults.timeout=this.interval}};const Undo={stack:null,clear:function(){this.stack=[]},push:function(moves){this.stack.push(moves)},pop:function(){return this.stack.pop()||[]},undo:function(){Y.Array.unique(my_Flatten(Y.Array.map(this.pop(),this.act))).forEach((function(stack){stack&&(stack.updateCardsPosition(),stack.update(!0))}))},act:function(move){const from=move.from,card=move.card,to=card.stack,cards=to.cards;return from&&(from===card.stack?cards[cards.indexOf(card)]=null:_deleteItem(cards,card),from.cards[move.index]=card,card.stack=from,Solitaire.container().append(card.node)),"faceDown"in move&&(move.faceDown?card.faceUp(!0):card.faceDown(!0)),[to,from]}}}),"0.0.1",{requires:["dd","dd-plugin","dd-delegate","anim","async-queue","array-extras"]}),{instance:instance,Game:Game,getGame:getGame,setUI:v=>{enable_solitairey_ui=v}}})),define(["./libfcs-wrap","./web-fc-solve","./solitaire","./flatted"],(function(Module,w,solitaire,flatted){"use strict";const FC_Solve=w.FC_Solve,FCS_STATE_SUSPEND_PROCESS=w.FCS_STATE_SUSPEND_PROCESS,FCS_STATE_WAS_SOLVED=w.FCS_STATE_WAS_SOLVED;let getGame,_module_wrapper,_startSolution_cb;let _my_non_promise_module,_my_module,WITH_UI=!1;WITH_UI=!0;let _my_mod_counter=5;const suitTable={s:0,h:1,c:2,d:3};function cardToValue(card){return card?card.rank<<2|suitTable[card.suit]:0}function withSelector(Y,selector,callback){const node=Y.one(selector);node&&callback(node)}function sortedStacks(Y,field){return Y.Array.map(field.stacks,(function(s){return s})).sort((function(s1,s2){return cardToValue(s1.first())-cardToValue(s2.first())}))}function to_int(s){return parseInt(s,10)}const _suits=["S","H","C","D"],_ranks=["A","2","3","4","5","6","7","8","9","T","J","Q","K"];function _rev(arr,delta){const ret={};for(let i=0;i>2)-1]}function _render_suit(c){return _suits[3&c]}function _render_foundation(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)}function cardRank(val){return val>>2}function cardSuit(val){return["s","h","c","d"][3&val]}function _render_freecell(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)}function _str_to_c(s){const m=s.match(/^(.)(.)$/);if(!m)throw"Should not happen";return _ranks_rev[m[1]]<<2|_suits_rev[m[2]]}function _get_stack_c(pre_s,src,card_idx){const arr=pre_s[src+2].replace(/ *$/,"").split(" "),src_c_s=arr[arr.length-card_idx];return":"==src_c_s?0:_str_to_c(src_c_s)}function _get_freecell_c(pre_s,idx){const fc_line=pre_s[1],pat=new RegExp("^Freecells:"+(0==idx?"":"(?:....){"+idx+"}")+"(....)",""),matched=fc_line.match(pat);if(matched){const c_s=matched[1].substring(2,4);return" "==c_s?0:_str_to_c(c_s)}return 0}function _calc__move_content(pre_s,str){let matched=str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)/);if(matched){const num_cards=to_int(matched[1]);return{source:["tableau",_get_stack_c(pre_s,to_int(matched[2]),num_cards)],dest:["tableau",_get_stack_c(pre_s,to_int(matched[3]),1)],num_cards:num_cards}}if(matched=str.match(/^Move a card from (stack|freecell) ([0-9]+) to the foundations/),matched){const src=to_int(matched[2]);let m_t,src_c;"stack"==matched[1]?(src_c=_get_stack_c(pre_s,src,1),m_t="tableau"):(src_c=_get_freecell_c(pre_s,src),m_t="reserve");const f_suit=3&src_c,f_rank=function(pre_s,f){const f_line=pre_s[0],pat=new RegExp(f+"-([0A2-9TJQK])",""),m=f_line.match(pat)[1];return"0"==m?0:_ranks_rev[m]}(pre_s,_suits[f_suit]);return{source:[m_t,src_c],dest:["foundation",0!=f_rank&&f_rank<<2|f_suit],num_cards:1}}if(matched=str.match(/^Move a card from stack ([0-9]+) to freecell ([0-9]+)/),matched)return{source:["tableau",_get_stack_c(pre_s,to_int(matched[1]),1)],dest:["reserve",_get_freecell_c(pre_s,to_int(matched[2]))],num_cards:1};if(matched=str.match(/^Move a card from freecell ([0-9]+) to stack ([0-9]+)/),matched)return{source:["reserve",_get_freecell_c(pre_s,to_int(matched[1]))],dest:["tableau",_get_stack_c(pre_s,to_int(matched[2]),1)],num_cards:1};throw"Must not happen - _calc__move_content() failed with <"+str+">"}function _calc_instance_from_state(state){let exceeded_iters=!1;const instance=new FC_Solve({cmd_line_preset:"video-editing",module_wrapper:_module_wrapper,set_status_callback:function(status){"exceeded"==status&&(exceeded_iters=!0)}}),state_as_string=function(obj){let ret="";const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map(_render_foundation).join("")+"\n",ret+="Freecells:"+reserve.map(_render_freecell).join("")+"\n";for(let i=0;i=this.remainingMovesArr.length)return;const move=function(game,move){const source=move.source,dest=move.dest,ret={top_card:!0};let value=source[1];const source_type=source[0];if(game.eachStack((function(stack){if(ret.card)return;const len=stack.cards.length;stack.eachCard((function(card,i){return!ret.card&&(!card||(card.rank===cardRank(value)&&card.suit===cardSuit(value)?(ret.card=card,"tableau"===source_type&&i!=len-1&&(ret.top_card=!1),!1):void 0))}))}),source_type),!ret.card)throw"Excalibur";if(value=dest[1],game.eachStack((function(stack){if(ret.stack)return;const card=stack.my_Last();card||value||(ret.stack=stack),card&&card.rank===cardRank(value)&&card.suit===cardSuit(value)&&(ret.stack=stack)}),dest[0]),!ret.stack)throw"Must not happen - could not find dest stack for <"+value+">";return ret.num_cards=move.num_cards,ret}(game,this.remainingMovesArr[this.remainingMovesIdx]),card=move.card;if(!card)return;const origin=card.stack;if(move.top_card)card.moveTo(move.stack);else{Solitaire.activeCard=card,card.createProxyStack();const proxyStack=card.proxyStack;proxyStack.cards.length!==move.num_cards&&alert("Error !!! mismatch in num_cards"),proxyStack.cards.forEach((function(card){})),move.stack.pushStack(proxyStack),move.stack.updateCardsPosition(),origin.updateCardsPosition(),Solitaire.endTurn()}return!0},_resetGameFoo:function(){},playCurrent:function(game){const that=this;that._playCurrentHelper(game)||that._resetGameFoo()},prev:function(game){const that=this;that.remainingMovesIdx>0&&(Y.fire("undo",!0),--that.remainingMovesIdx)},next:function(game){const that=this,next_idx=this.remainingMovesIdx+1;Solitaire.Statistics.disable(),that.playCurrent(game),that.remainingMovesIdx=next_idx,that.remainingMovesIdx>=that.remainingMovesArr.length&&that._resetGameFoo(),Y.fire("endTurn",!0)},play:function(game){const that=this;that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(Solitaire.Autoplay.disable(),withSelector(Y,"#solver_bar .play",(function(node){node.removeClass("play"),node.addClass("pause")})),that.next(game),that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(that.timer=window.setTimeout((function(){that.play(game)}),that.interval)))}},Status={bar:null,indicator:null,indicatorTimer:null,indicatorInterval:750,delay:400,updateIndicator:function(ticks){const that=this,indicator=that.indicator;if(!indicator)return;ticks=(ticks||0)%4;let text="Solving";for(let i=0;i'),indicator=Y.Node.create('');function _create_button(args){return Y.Node.create('')}const next=_create_button({cls:"fastforward",title:"Next move"}),prev=_create_button({cls:"rewind",title:"Previous move"}),playPause=_create_button({cls:"play",title:"Play/Pause"}),controls=Y.Node.create("
");next.on("click",(function(){Animation.pause(),Animation.next(getGame())})),prev.on("click",(function(){Animation.pause(),Animation.prev(getGame())})),playPause.on("click",(function(){const that=playPause;that.hasClass("play")?Animation.play(getGame()):that.hasClass("pause")&&Animation.pause()})),controls.append(prev),controls.append(playPause),controls.append(next),bar.append(indicator),bar.append(controls),Y.one(".solitairey_body").append(bar),this.indicator=indicator,this.bar=bar},hide:function(){0}};_startSolution_cb=function(args){return Y.Solitaire.Application.switchToGame("freecell"),Y.Solitaire.Application.clearDOM(),Y.Solitaire.Freecell.setup((()=>{function _from_card(card){return Y.Solitaire.Freecell.Card.create(card.getRank(),game.deck.suits[[2,0,1,3][card.getSuit()]]).faceUp()}const board=args.board,game=getGame(),tableau=game.tableau.stacks;board.columns.forEach(((col,ci)=>{const column=col.col;tableau[ci].setCards(column.getLen(),(function(i){return _from_card(column.getCard(i))}))}));const fc=board.freecells;game.reserve.stacks.forEach(((stack,i)=>{const card=fc?fc.freecells.getCard(i):null;stack.setCards(card?1:0,(function(_unused){return _from_card(card)}))}));const foundations=board.foundations;game.foundation.stacks.forEach((function(stack,suit){stack.setCards(foundations?1+foundations.foundations.getByIdx(0,[1,2,0,3][suit]):0,(function(rank){return Y.Solitaire.Freecell.Card.create(rank,game.deck.suits[suit]).faceUp()}))}))}),{disableDragging:!0}),_solve_cb(Y,FreecellSolver,args.instance._pre_expand_states_and_moves_seq,Animation)},Y.mix(FreecellSolver,{solver_active:!1,currentSolution:null,attached:!1,supportedGames:["Freecell"],isSupported:function(){return-1!==this.supportedGames.indexOf(getGame().name())},enable:function(){this.isSupported()&&this.createUI(),this.attachEvents()},disable:function(){Status.hide()},attachEvents:function(){const that=this;if(that.attached)return;const pause=Animation.pause.bind(Animation);Y.on("afterDealingAnimation",(function(){that.isSupported()?(that.solver_active=!1,Animation.remainingMovesIdx=null,Animation.remainingMovesArr=[],that.solve()):that.disable()})),Y.on("autoPlay",(function(){FreecellSolver.disable()})),Y.on("win",(function(){})),document.documentElement.addEventListener("mousedown",(function(e){e.target.className.match(/\bpause\b/)||pause()}),!0),that.attached=!0},createUI:function(){Status.show()},stop:function(){},solve:function(){const that=this;if(that.solver_active)return;that.solver_active=!0,that.stop(),that.currentSolution=null;const state=function(Y,game){const tableau=Y.Array.map(sortedStacks(Y,game.tableau),(function(s){const buffer=[];return s.eachCard((function(c,i){buffer[i]=cardToValue(c)})),[buffer,s.cards.length]})),reserve=[];sortedStacks(Y,game.reserve).forEach((function(s,i){reserve[i]=cardToValue(s.my_Last())}));const foundation=[];return sortedStacks(Y,game.foundation).forEach((function(s,i){foundation[i]=cardToValue(s.my_Last())})),{reserve:reserve,foundation:foundation,tableau:tableau}}(Y,getGame());function _cb(){window.setTimeout((function(){const instance=_calc_instance_from_state(state);return _solve_cb(Y,that,instance?instance._pre_expand_states_and_moves_seq:null,Animation)}),400)}var callback;_my_non_promise_module?_cb():(callback=_cb,_my_mod_counter>=5?(_my_module=Module({onRuntimeInitialized:()=>{_my_module.then((result=>{_my_non_promise_module=result;const module_wrapper=w.FC_Solve_init_wrappers_with_module(_my_non_promise_module);_module_wrapper=module_wrapper,callback()}))}}),_my_mod_counter=0):++_my_mod_counter)}}),Y.on("beforeSetup",FreecellSolver.enable.bind(FreecellSolver))}),"0.0.1",{requires:["solitaire"]}),{startSolution:function(args){return _startSolution_cb(args)}}})),importScripts("libfreecell-solver.min.js","web-fc-solve--expand-moves.js","web-fc-solve.js");let attempts=0;const maxFastAttempts=15e4;function GameState(obj){if(!obj)return;let i,stack;for(this.reserve=new Uint8Array(obj.reserve),this.foundation=new Uint8Array(obj.foundation),this.tableau=[],i=0;i200)return 200;if(state.solved())return state.becomeChild(),0;for(i=0;i<4;i++)if(val=state.reserve[i],val){if(destIndex=state.validTarget("foundation",val),destIndex>-1&&(moves.push({source:["reserve",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["reserve",i],dest:["tableau",destIndex]})}const tableau=state.tableau;for(i=0;i-1&&(moves.push({source:["tableau",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=state.validTarget("reserve",val),destIndex>-1&&moves.push({source:["tableau",i],dest:["reserve",destIndex]}),destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["tableau",i],dest:["tableau",destIndex]})}for(foundFoundation?movesSinceFoundation=0:movesSinceFoundation++,i=0;i=20&&(scale=.7),fastSearch&&++attempts>maxFastAttempts&&(scale=.001),i=0;i>2)-1]}const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map((function(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)})).join("")+"\n",ret+="Freecells:"+reserve.map((function(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)})).join("")+"\n";for(let i=0;i>2!=13)return!1;return!0},eachTableau:function(callback){const tableau=this.tableau;for(let i=0,len=tableau.length;i>2,suit=3&value;let dest,tableau,i,len;if(!value)return-1;switch(void 0===start?start=0:start++,field){case"foundation":for(i=0;i<4;i++)if(dest=this.foundation[i],!dest&&1===rank||suit===(3&dest)&&rank===1+(dest>>2))return i;break;case"reserve":for(i=0;i<4;i++)if(!this.reserve[i])return i;break;case"tableau":for(tableau=this.tableau,i=start,len=tableau.length;i>2)-1)return i}return-1},move:function(sourceField,sourceStack,destField,destStack){const val=this.pop(sourceField,sourceStack);this.push(destField,destStack,val)},pop:function(field,stack){let val;if("reserve"===field||"foundation"===field)return val=this[field][stack],this[field]=new Uint8Array(this[field]),this[field][stack]=0,val;const tableau=this.tableau,bufferLength=tableau[stack][1];return bufferLength?(val=tableau[stack][0][bufferLength-1],this.copyTableau(stack,bufferLength-1),val):0},push:function(field,stack,val){if(!val)return;if("reserve"===field||"foundation"===field)return this[field]=new Uint8Array(this[field]),void(this[field][stack]=val);const newLength=this.tableau[stack][1]+1;this.copyTableau(stack,newLength),this.tableau[stack][0][newLength-1]=val},copyTableau:function(stack,newLength){const old=this.tableau,tableau=old[stack][0],newBuffer=new Uint8Array(new ArrayBuffer(newLength));for(let i=0;i=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=15-(length-2-i)+(13-(stack[0][i]>>2)));this.validTarget("tableau",stack[0][length-2])>-1&&(rating+=10)}if("reserve"===sourceField&&(rating+=10,card=this.reserve[sourceIndex]),"tableau"===destField){for(rating+=2,stack=this.tableau[destIndex],length=stack[1],i=length-1;i>=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=-5*(length-i));if(0===stack[1]){if("tableau"===sourceField&&1===this.tableau[sourceIndex][1])return-1e3;for(i=0;i<4;i++)nextCard=this.reserve[i],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);for(i=0;i<8;i++)stack=this.tableau[i],nextCard=stack[0][stack[1]-1],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);followup||(rating+=-10)}}return"reserve"===destField&&(rating+=-1),rating},transformParentMove:function(){const move=this.parentMove,parent=this.parent;move&&parent&&(move.source[1]=parent.lastCard(move.source[0],move.source[1]),move.dest[1]=parent.lastCard(move.dest[0],move.dest[1]))},lastCard:function(field,index){switch(field){case"reserve":case"foundation":return this[field][index];case"tableau":const stack=this[field][index],length=stack[1];return stack[0][length-1]}},becomeChild:function(){const parent=this.parent;parent&&(parent.child=this,this.transformParentMove())}},onmessage=function(e){let solution;const data=e.data;"solve"===data.action&&(solution=attemptSolution(data.param,!0),solution||(solution=attemptSolution(data.param,!1)),self.postMessage({solution:solution}))},YUI.add("spider",(function(Y){const Solitaire=Y.Solitaire,Spider=Solitaire.Spider=Solitaire.instance(Solitaire,{fields:["Foundation","Deck","Tableau"],createEvents:function(){Solitaire.AutoStackClear.register(),Solitaire.createEvents.call(this)},deal:function(){const deck=this.deck,stacks=this.tableau.stacks;for(let row=0;row<5;row++)for(let stack=0;stack<10;stack++)(stack<4||row<4)&&stacks[stack].push(deck.pop());for(let stack=0;stack<10;stack++)stacks[stack].push(deck.pop().faceUp());deck.createStack()},redeal:function(){},turnOver:function(){const deck=this.deck.stacks[0],that=this;hasFreeTableaus()||this.eachStack((function(stack){const card=deck.my_Last();card&&card.faceUp().moveTo(stack).after((function(){that.stack.updateCardsPosition()}))}),"tableau")},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 2.5*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck"}),Tableau:{stackConfig:{total:10,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau"},Card:Solitaire.instance(Solitaire.Card,{playable:function(){this.stack[this.index-1];switch(this.stack.field){case"tableau":return this.createProxyStack();case"deck":return!hasFreeTableaus();case"foundation":return!1}},validTarget:function(stack){if("tableau"!==stack.field)return!1;const target=stack.my_Last();return!target||!target.isFaceDown&&target.rank===this.rank+1}})});function hasFreeTableaus(){return Y.Array.some(Solitaire.getGame().tableau.stacks,(function(stack){return!stack.cards.length}))}Spider.fields.forEach((function(field){Spider[field].Stack=Solitaire.instance(Spider.Stack)})),Y.mix(Spider.Stack,{validCard:function(card){return card.suit===_.last(this.cards).suit},validTarget:function(stack){switch(stack.field){case"tableau":return this.first().validTarget(stack);case"foundation":return 13===this.cards.length}}},!0),Y.mix(Spider.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["auto-stack-clear"]}),YUI.add("spider1s",(function(Y){const Solitaire=Y.Solitaire;(Y.Solitaire.Spider1S=Solitaire.instance(Y.Solitaire.Spider)).Deck=Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s"],count:8})}),"0.0.1",{requires:["spider"]}),YUI.add("spider2s",(function(Y){(Y.Solitaire.Spider2S=Y.Solitaire.instance(Y.Solitaire.Spider)).Deck=Y.Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s","h"],count:4})}),"0.0.1",{requires:["spider"]}),YUI.add("spiderette",(function(Y){const Solitaire=Y.Solitaire,Klondike=Solitaire.Klondike,Spider=Solitaire.Spider;Y.Solitaire.Spiderette=Solitaire.instance(Spider,{height:Klondike.height,deal:Klondike.deal,Tableau:Solitaire.instance(Spider.Tableau,{stackConfig:Klondike.Tableau.stackConfig}),Foundation:Solitaire.instance(Spider.Foundation,{stackConfig:Klondike.Foundation.stackConfig}),Deck:Solitaire.instance(Spider.Deck,{count:1})})}),"0.0.1",{requires:["klondike","spider"]}),define(["./solitaire"],(function(solitaire){const getGame=solitaire.getGame;return YUI.add("statistics",(function(Y){let loaded,won,enabled=!0;const localStorage=window.localStorage,Solitaire=Y.Solitaire,Statistics=Y.namespace("Solitaire.Statistics");function winDisplay(){const stats=function(raw){function parse(){const entries=raw.split("|");return entries.splice(entries.length-1),Y.Array.map(entries,(function(entry){return entry=entry.split("_"),{date:new Date(entry[0]),won:!!parseInt(entry[1],10)}}))}function won(entry){return entry.won}const record=parse();return{streaks:function(){const streaks=[];let streak=null;return record.forEach((function(entry){entry.won?(streak||(streak=[]),streak.push(entry)):(streak&&streaks.push(streak),streak=null)})),streak&&streaks.push(streak),streaks},wins:function(){return Y.Array.filter(record,won)},loses:function(){return Y.Array.reject(record,won)}}}(localStorage[Solitaire.game.name()+"record"]);let output="
";const streakCount=_.last(stats.streaks()).length,winCount=stats.wins().length,loseCount=stats.loses().length;return output+="

You win! You're awesome.

",output+="

"+{Agnes:"Agnes",Klondike:"Klondike",Klondike1T:"Klondike (Vegas style)",FlowerGarden:"Flower Garden",FortyThieves:"Forty Thieves",Freecell:"Freecell",Golf:"Golf",GClock:"Grandfather's Clock",MonteCarlo:"Monte Carlo",Pyramid:"Pyramid",RussianSolitaire:"Russian Solitaire",Scorpion:"Scorpion",Spider:"Spider",Spider1S:"Spider (1 Suit)",Spider2S:"Spider (2 Suit)",Spiderette:"Spiderette",WillOTheWisp:"Will O' The Wisp",TriTowers:"Tri Towers",Yukon:"Yukon"}[Solitaire.game.name()]+" stats:

",output+="
    ",output+="
  • Current win streak: "+streakCount+"
  • ",output+="
  • Total wins: "+winCount+"
  • ",output+="
  • Total loses: "+loseCount+"
  • ",output+='
    ',output+="
",output}function record(value){const key=localStorage.currentGame+"record";let record=localStorage[key]||"";record+=(new Date).getTime()+"_"+value+"|",localStorage[key]=record}function clearProgress(){localStorage.removeItem("currentGame")}function saveProgress(){localStorage.currentGame=Solitaire.game.name()}localStorage&&(Y.on("newGame",(function(){loaded&&(record(0),clearProgress()),won=!1,loaded=null})),Y.on("loadGame",(function(){loaded=Solitaire.game.name(),saveProgress(),won=!1})),Y.on("endTurn",(function(){loaded||(loaded=Solitaire.game.name(),saveProgress())})),Y.on("win",(function(){!won&&enabled&&(loaded=null,won=!0,record(1),clearProgress(),function(){const delay=500,duration=900,interval=900;getGame().eachStack((function(stack){stack.eachCard((function(card){if(!card)return;const node=card.node;card===stack.my_Last()?(node.plug(Y.Breakout,{columns:5}),function(node){setTimeout((function(){node.breakout.explode({random:.65,duration:duration})}),delay)}(node),delay+=interval):node.addClass("hidden")}))}),"foundation"),setTimeout((function(){Statistics.winDisplay()}),delay+200)}())})),Y.on("beforeSetup",(function(){const winDisplay=Y.one("#win_display");winDisplay&&winDisplay.remove(),Statistics.enable()})),Y.mix(Statistics,{winDisplay:function(){const Application=Solitaire.Application;Y.one(".solitairey_body").append(winDisplay()),Y.on("click",(function(){Application.newGame()}),Y.one("#win_display .new_deal"))},enable:function(){enabled=!0},disable:function(){enabled=!1}}))}),"0.0.1",{requires:["solitaire","array-extras","breakout"]}),{}})),YUI.add("tri-towers",(function(Y){const Solitaire=Y.Solitaire,TriTowers=Y.Solitaire.TriTowers=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],width:function(){return 15*this.Card.base.width},height:function(){return 5*this.Card.base.height},createEvents:function(){Y.on("solitaire|endTurn",(function(){const tableaus=Solitaire.game.tableau.stacks;for(let i=0;i<3;i++)Y.fire("tableau:afterPop",tableaus[i])})),Solitaire.createEvents.call(this)},deal:function(){let card,stack,i,stackLength;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(stack=0;stack<4;stack++)for(stackLength=3*(stack+1),i=0;i=0;){for(card=deck.pop().faceUp(),stacks[6-piles].push(card),stack=7-piles;stack<7;stack++)card=deck.pop(),stacks[stack].push(card);piles--}for(stack=1;deck.cards.length;)card=deck.pop().faceUp(),stacks[stack].push(card),stack=stack%6+1},height:function(){return 4.8*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{vspacing:1.25,top:0,left:function(){return 9*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:7,layout:{hspacing:1.25,top:0,left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{playable:function(){return"tableau"===this.stack.field&&!this.isFaceDown},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.color!==this.color&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});Yukon.fields.forEach((function(field){Yukon[field].Stack=Solitaire.instance(Yukon.Stack)})),Y.mix(Yukon.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validProxy:function(card){return!0}},!0),Y.mix(Yukon.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),define(["require","exports","./prange","./french-cards","./capitalize-cards"],(function(require,exports,prange_1,french_cards_1,capitalize_cards_1){"use strict";function is_int(input){const value=""+input;return parseFloat(value)===parseInt(value,10)&&!isNaN(input)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BoardParseResult=exports.ParseErrorType=exports.ErrorLocationType=exports.Foundations=exports.suits__str_to_int=exports.MAX_RANK=exports.MIN_RANK=exports.NUM_SUITS=exports.ranks__str_to_int=void 0,exports.fcs_js__card_from_string=fcs_js__card_from_string,exports.fcs_js__column_from_string=fcs_js__column_from_string,exports.fcs_js__freecells_from_string=fcs_js__freecells_from_string,exports.fcs_js__foundations_from_string=fcs_js__foundations_from_string,exports.determine_if_string_is_board_like=function(s){return lax_card_three_matches.test(s)};exports.ranks__str_to_int={},exports.NUM_SUITS=4;const _suits=(0,prange_1.perl_range)(0,exports.NUM_SUITS-1);exports.MIN_RANK=1,exports.MAX_RANK=13;const _ranks=(0,prange_1.perl_range)(exports.MIN_RANK,exports.MAX_RANK);for(const rank of _ranks)exports.ranks__str_to_int["0A23456789TJQK".substring(rank,rank+1)]=rank;exports.suits__str_to_int=new Map;for(const suit of _suits)exports.suits__str_to_int.set(french_cards_1.suits__int_to_str.substring(suit,suit+1),suit);class Card{constructor(rank,suit){if(this.rank=rank,this.suit=suit,!is_int(rank))throw"rank is not an integer.";if(!is_int(suit))throw"suit is not an integer.";if(rank<1)throw"rank is too low.";if(rank>exports.MAX_RANK)throw"rank is too high.";if(suit<0)throw"suit is negative.";if(suit>=exports.NUM_SUITS)throw"suit is too high."}getRank(){return this.rank}getSuit(){return this.suit}toString(){return"0A23456789TJQK".substring(this.rank,this.rank+1)+french_cards_1.suits__int_to_str.substring(this.suit,this.suit+1)}}class Column{constructor(cards){this.cards=cards}getLen(){return this.cards.length}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getLen())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getLen()-1).map((i=>that.getCard(i).toString()))}toString(){return Array.prototype.concat.apply([],[[":"],this.getArrOfStrs()]).join(" ")+"\n"}}const card_re="("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")";function fcs_js__card_from_string(s){const m=s.match("^"+card_re+"$");if(!m)throw'Invalid format for a card - "'+s+'"';return new Card(exports.ranks__str_to_int[m[1]],exports.suits__str_to_int.get(m[2]))}class BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error){this.is_correct=is_correct,this.start_char_idx=start_char_idx,this.num_consumed_chars=num_consumed_chars,this.error=error}getEnd(){return this.start_char_idx+this.num_consumed_chars}}class ColumnParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,cards){super(is_correct,start_char_idx,num_consumed_chars,error),this.col=new Column(cards)}getLen(){return this.col.getLen()}toString(){return this.col.toString()}}class StringParser{constructor(s){this.s=s,this.consumed=0}consume(m){const len_match=m[1].length;this.consumed+=len_match,this.s=this.s.substring(len_match)}getConsumed(){return this.consumed}isNotEmpty(){return this.s.length>0}match(re){return this.s.match(re)}consume_match(re){const that=this,m=that.match(re);return m&&that.consume(m),m}skipComments(){this.consume_match(/^((?:[ \t]*#[^\n\r]*\r?\n)*)/)}}class CardsStringParser extends StringParser{constructor(s,card_mapper){super(s),this.card_mapper=card_mapper,this.cards=[],this.is_start=!0}afterStart(){this.is_start=!1}getStartSpace(){return this.is_start?"":" +"}should_loop(){return this.isNotEmpty()&&!this.consume_match(/^(\s*(?:#[^\n]*)?\n?)$/)}add(m){this.cards.push(this.card_mapper(m[2])),this.afterStart()}loop(re,callback){const p=this;for(;p.should_loop();){const m=p.consume_match("^("+p.getStartSpace()+"("+re+"))");if(!m)return p.consume_match("^( *)"),callback();p.add(m)}return null}}function calc_1H_error_string(suit){return'Wrong rank specifier "1" (followed by "[R]"). Perhaps you meant either "A[R]" (for ace) or "T[R]" (for rank ten).'.replace(/\[R\]/g,suit)}function fcs_js__column_from_string(start_char_idx,orig_s,force_leading_colon){const p=new CardsStringParser(orig_s,fcs_js__card_from_string),match=p.consume_match("^((?:: +|:(?:$|(?=\\n)))?)");if(force_leading_colon&&!match[1].length)return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),'Columns must start with a ":" in strict mode.',[]);const ret=p.loop(card_re,(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]",[])}));return ret||new ColumnParseResult(!0,start_char_idx,p.getConsumed(),"",p.cards)}class Freecells{constructor(num_freecells,cards){if(this.num_freecells=num_freecells,this.cards=cards,!is_int(num_freecells))throw"num_freecells is not an integer.";if(cards.length!==num_freecells)throw"cards length mismatch."}getNum(){return this.num_freecells}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getNum())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getNum()-1).map((i=>{const card=that.getCard(i);return null!==card?card.toString():"-"}))}toString(){return Array.prototype.concat.apply([],[["Freecells:"],this.getArrOfStrs()]).join(" ")+"\n"}}class FreecellsParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,num_freecells,fc){super(is_correct,start_char_idx,num_consumed_chars,error),is_correct&&(this.freecells=new Freecells(num_freecells,fc))}}function fcs_js__freecells_from_string(num_freecells,start_char_idx,orig_s){const p=new CardsStringParser(orig_s,(card_str=>"-"===card_str?null:fcs_js__card_from_string(card_str)));function make_ret(verdict,err_str){return new FreecellsParseResult(verdict,start_char_idx,p.getConsumed(),err_str,num_freecells,verdict?p.cards:[])}if(!p.consume_match(new RegExp("^("+freecells_prefix_re+":(?: +|$|(?=\\n)))")))return make_ret(!1,'Wrong line prefix for freecells - should be "Freecells:"');const ret=p.loop("\\-|(?:"+card_re+")",(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return make_ret(!1,m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]")}));if(ret)return ret;for(;p.cards.length=0&&rank<=exports.MAX_RANK))throw"rank is out of range.";return!(this.ranks[suit]>=0)&&(this.ranks[suit]=rank,!0)}finalize(){const that=this;for(let i=0;i0&&arr.push(french_cards_1.suits__int_to_str[suit]+"-"+"0A23456789TJQK"[val])}return Array.prototype.concat.apply([],[["Foundations:"],arr]).join(" ")+"\n"}_validateDeckSuit(deck,suit){if(0!==deck)throw"multiple decks are not supported.";if(!is_int(suit))throw"suit is not an integer.";if(!(suit>=0&&suitnew capitalize_cards_1.BoardTextLine(l)));for(const l of lines){{const matches=l.getContent().match(/[a-z]+/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.LOWERCASE_LETTERS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}{const matches=l.getContent().match(/10/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.HAS_10_STRINGS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}}that.columns=[];const counter=_suits.map((i=>(0,prange_1.perl_range)(0,exports.MAX_RANK).map((i=>[])))),p=new StringParser(orig_s);if(p.skipComments(),p.match(foundations_prefix_re)){const start_char_idx=p.getConsumed(),fo=fcs_js__foundations_from_string(1,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.foundations=fo,!fo.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Foundations,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}if(p.skipComments(),p.match(new RegExp("^"+freecells_prefix_re+":"))){const start_char_idx=p.getConsumed(),fc=fcs_js__freecells_from_string(num_freecells,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.freecells=fc,!fc.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Freecells,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}for(let i=0;i{const col=col_res.col;for(const h of(0,prange_1.perl_range)(0,col.getLen()-1)){const card=col.getCard(h);counter[card.getSuit()][card.getRank()].push(new ParseLocation(ErrorLocationType.Column,idx,h))}}));const too_many_cards__errors=[],not_enough_cards__errors=[];for(const suit of _suits)for(const rank of _ranks){const count=counter[suit][rank];function add_error(arr,type_,locs){arr.push(new ParseError(type_,locs,new Card(rank,suit))),that.is_valid=!1}if(count.length>1){const locs=count.map((v=>new ErrorLocation(v.type_,v.row,0,0)));add_error(too_many_cards__errors,ParseErrorType.TOO_MUCH_OF_CARD,locs)}else count.length<1&&add_error(not_enough_cards__errors,ParseErrorType.NOT_ENOUGH_OF_CARD,[])}that.errors.push(...too_many_cards__errors),that.errors.push(...not_enough_cards__errors)}getBoardString(){const that=this;let ret="";that.foundations&&(ret+=that.foundations.foundations.toString()),that.freecells&&(ret+=that.freecells.freecells.toString());for(const col of that.columns)ret+=col.toString();return ret}_calc_filled(){return this.columns.filter((c=>c.getLen()>0))}checkIfFlipped(){let i=0;const my_filled_columns=this._calc_filled();for(;i<6;++i){if(i>=my_filled_columns.length)return!1;if(8!=my_filled_columns[i].getLen())return!1}for(;i<7;++i){if(i>=my_filled_columns.length)return!1;if(4!=my_filled_columns[i].getLen())return!1}for(;imy_filled_columns[c].col.getCard(i).toString())).join(" ")+"\n",!1));return new BoardParseResult(8,4,new_columns.map((col=>col.toString())).join(""))}}exports.BoardParseResult=BoardParseResult;const lax_card_rank_re="(?:(?:"+french_cards_1.rank_re+")|10|[01])",lax_card_with_spaces_re="(?:(?:\\s|^)"+("(?:(?:"+lax_card_rank_re+french_cards_1.suit_re+")|(?:"+french_cards_1.suit_re+lax_card_rank_re+"))")+"(?=(?:\\s|$)))",lax_card_three_matches=new RegExp(lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re,"ims")})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rank_re=exports.rank_str=exports.suit_re=exports.suits__int_to_str=void 0,exports.suits__int_to_str="HCDS",exports.suit_re="["+exports.suits__int_to_str+"]",exports.rank_str="A23456789TJQK",exports.rank_re="["+exports.rank_str+"]"})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.perl_range=function(start,end){const ret=[];for(let i=start;i<=end;++i)ret.push(i);return ret}})),define(["require","exports"],(function(require,exports){"use strict";function _to_int(s){return parseInt(s,10)}function _find_max_step(n){let x=1;for(;x<<1{},this.past_first_output_state_promise=expander=>expander.past_first_output_state()}init_from_string(num_stacks,num_freecells,ultimate_source,ultimate_dest,initial_src_state_str){const expander=this,col_matches=initial_src_state_str.match(/(\n:[^\n]*)/g);if(!col_matches||col_matches.length!==num_stacks)throw"Miscount of stacks.";for(let idx=0;idxfc?"s"===fc.t?fc.s:" "+fc.c:" ")).join("")+"\n"+this.modified_state.c.map((col=>":"+col.map((card=>" "+card)).join("")+"\n")).join("");this.ret_array.push({str:state_string,type:"s"})}move_using_freecells(source,dest,count){const expander=this,num_cards_thru_freecell=count-1;for(let i=0;i=0;--i)expander.add_move({t:"f2s",src:expander.empty_fc_indexes[i],dest:dest})}recursive_move(source,dest,num_cards_r,empty_cols){const expander=this;if(num_cards_r<=0)return;const running_empty_cols=empty_cols.slice(0),steps=[];for(;Math.ceil(num_cards_r/expander.step_width)>1;){const count_cards=_find_max_step(Math.ceil(num_cards_r/expander.step_width))*expander.step_width,temp_dest=running_empty_cols.shift();expander.recursive_move(source,temp_dest,count_cards,running_empty_cols),steps.push({count:count_cards,dest:temp_dest,source:source}),num_cards_r-=count_cards}expander.move_using_freecells(source,dest,num_cards_r);for(const s of steps.reverse())expander.recursive_move(s.dest,dest,s.count,running_empty_cols),running_empty_cols.push(s.dest),running_empty_cols.sort(((a,b)=>a-b))}add_move(my_move){this.output_state_promise(this),this.ret_array.push({str:_render_move(my_move),type:"m"}),this.perform_move(my_move),this.output_state_promise=this.past_first_output_state_promise}perform_move(my_move){const expander=this,src=my_move.src,dest=my_move.dest;if("s2f"===my_move.t)expander.modified_state.f[dest]={c:expander.modified_state.c[src].pop(),t:"c"};else if("s2s"===my_move.t)expander.modified_state.c[dest].push(expander.modified_state.c[src].pop());else{if("c"!==expander.modified_state.f[src].t)throw"Wrong val in "+src+"Freecell.";expander.modified_state.c[dest].push(expander.modified_state.f[src].c),expander.modified_state.f[src]=null}}}function fc_solve_expand_move(num_stacks,num_freecells,initial_src_state_str,initial_move,initial_dest_state_str){const matched=initial_move.str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)$/),raw_ret=[{str:initial_move.str,type:"m"}];if(!matched)return raw_ret;const ultimate_num_cards=_to_int(matched[1]);if(1===ultimate_num_cards)return raw_ret;const ultimate_source=_to_int(matched[2]),ultimate_dest=_to_int(matched[3]),expander=new Expander;return expander.init_from_string(num_stacks,num_freecells,ultimate_source,ultimate_dest,initial_src_state_str),expander.recursive_move(ultimate_source,ultimate_dest,ultimate_num_cards,expander.empty_stack_indexes),expander.ret_array}})),define(["require","exports","./fcs-validate","./web-fcs-api-base","./web-fc-solve--expand-moves","./french-cards"],(function(require,exports,validate,BaseApi,web_fc_solve__expand_moves_1,french_cards_1){"use strict";let myalert;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FC_Solve=exports.DisplayFilter=exports.FCS_STATE_SUSPEND_PROCESS=exports.FCS_STATE_WAS_SOLVED=exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR=exports.FCS_ES_FILLED_BY_ANY_CARD=void 0,exports.FC_Solve_init_wrappers_with_module=function(Module){const module_wrapper=BaseApi.base_calc_module_wrapper(Module);return module_wrapper.bh_create=Module._black_hole_solver_create,module_wrapper.bh_free=Module._black_hole_solver_free,module_wrapper.user_alloc=Module._freecell_solver_user_alloc,module_wrapper.user_solve_board=Module.cwrap("freecell_solver_user_solve_board","number",["number","string"]),module_wrapper.user_resume_solution=Module._freecell_solver_user_resume_solution,module_wrapper.user_cmd_line_read_cmd_line_preset=Module.cwrap("freecell_solver_user_cmd_line_read_cmd_line_preset","number",["number","string","number","number","number","string"]),module_wrapper.user_get_empty_stacks_filled_by=Module._freecell_solver_user_get_empty_stacks_filled_by,module_wrapper.user_get_next_move=Module.cwrap("freecell_solver_user_get_next_move","number",["number","number"]),module_wrapper.user_get_num_freecells=Module._freecell_solver_user_get_num_freecells,module_wrapper.user_get_num_stacks=Module._freecell_solver_user_get_num_stacks,module_wrapper.user_get_num_states_in_collection_long=Module._freecell_solver_user_get_num_states_in_collection_long,module_wrapper.user_get_num_times_long=Module._freecell_solver_user_get_num_times_long,module_wrapper.user_get_sequence_move=Module._freecell_solver_user_get_sequence_move,module_wrapper.user_get_sequences_are_built_by_type=Module._freecell_solver_user_get_sequences_are_built_by_type,module_wrapper.user_get_unrecognized_cmd_line_flag=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag","number",["number","number"]),module_wrapper.user_get_unrecognized_cmd_line_flag_status=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag_status","number",["number","number"]),module_wrapper.user_current_state_stringify=Module._freecell_solver_user_current_state_stringify,module_wrapper.user_stringify_move_ptr=Module.cwrap("freecell_solver_user_stringify_move_ptr","number",["number","number","number","number"]),module_wrapper.user_free=Module._freecell_solver_user_free,module_wrapper.user_limit_iterations_long=Module._freecell_solver_user_limit_iterations_long,module_wrapper.user_get_invalid_state_error_into_string=Module.cwrap("freecell_solver_user_get_invalid_state_error_into_string","number",["number","number","number"]),module_wrapper.user_cmd_line_parse_args_with_file_nesting_count=Module.cwrap("freecell_solver_user_cmd_line_parse_args_with_file_nesting_count","number",["number","number","number","number","number","number","number","number","number","number","number"]),module_wrapper.alloc_wrap=(my_malloc=>(size,desc,error)=>{const buffer=my_malloc(size);if(0===buffer)throw alert("Could not allocate "+desc+" (out of memory?)"),error;return buffer})(Module.cwrap("malloc","number",["number"])),module_wrapper.c_free=Module.cwrap("free","number",["number"]),module_wrapper.fc_solve_Pointer_stringify=ptr=>Module.UTF8ToString(ptr,1e4),module_wrapper.stringToAscii=(s,outPtr)=>Module.writeArrayToMemory(Module.intArrayFromString(s),outPtr),module_wrapper.stringToUTF8=(s,outPtr,maxBytes)=>Module.stringToUTF8(s,outPtr,maxBytes),module_wrapper};try{myalert=alert||(e=>{throw console.log(e+"\n"),e})}catch(x){myalert=e=>{throw console.log(e+"\n"),e}}const remove_trailing_space_re=/[ \t]+$/gm;exports.FCS_ES_FILLED_BY_ANY_CARD=0,exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR=0,exports.FCS_STATE_WAS_SOLVED=0;exports.FCS_STATE_SUSPEND_PROCESS=5;const fc_solve_2uni_suit_map={H:"♥",C:"♣",D:"♦",S:"♠"},fc_solve_2uni_suit_map_num={H:1,C:3,D:2,S:0};function fc_solve_2uni_card(match,p1,p2,offset,mystring){return p1+fc_solve_2uni_suit_map[p2]}function fc_solve_2uni_char_card(match,p1,p2,offset,mystring){const rank=validate.ranks__str_to_int[p1];return String.fromCodePoint(16*fc_solve_2uni_suit_map_num[p2]+127136+rank)}function fc_solve_2uni_found(match,p1,p2,offset,mystring){return fc_solve_2uni_suit_map[p1]+p2}const card_re=new RegExp("\\b("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")\\b","g"),found_re=new RegExp("\\b("+french_cards_1.suit_re+")(-[0A2-9TJQK])\\b","g");exports.DisplayFilter=class{constructor(args){this.is_unicode_cards=args.is_unicode_cards,this.is_unicode_cards_chars=args.is_unicode_cards_chars}unicode_preprocess(out_buffer){return this.is_unicode_cards?this._replace_found(this.is_unicode_cards_chars?this._replace_char_card(out_buffer):this._replace_card(out_buffer)):out_buffer}_replace_char_card(s){return s.replace(card_re,fc_solve_2uni_char_card)}_replace_card(s){return s.replace(card_re,fc_solve_2uni_card)}_replace_found(s){return s.replace(found_re,fc_solve_2uni_found)}};exports.FC_Solve=class{constructor(args){const that=this;that.module_wrapper=args.module_wrapper,that._do_not_alert=!1,that._cached_num_times_long=-1,that._cached_num_states_long=-1,that.dir_base=args.dir_base,that.string_params=args.string_params?[args.string_params]:null,that.set_status_callback=args.set_status_callback,that.cmd_line_preset=args.cmd_line_preset,that.current_iters_limit=0,that.obj=(()=>{const ret_obj=that.module_wrapper.user_alloc();if(0===ret_obj)throw alert("Could not allocate solver instance (out of memory?)"),"Foo";if(0!==that._initialize_obj(ret_obj))throw that._do_not_alert?that._do_not_alert=!1:alert("Failed to initialize solver (Bug!)"),that.module_wrapper.user_free(ret_obj),"Bar";return ret_obj})(),that._cached_num_times_long=-1,that._cached_num_states_long=-1,that.proto_states_and_moves_seq=null,that._pre_expand_states_and_moves_seq=null,that._post_expand_states_and_moves_seq=null}get_pre_expand_states_and_moves_seq(){return this._pre_expand_states_and_moves_seq}set_status(myclass,mylabel){return this.set_status_callback(myclass,mylabel)}handle_err_code(solve_err_code){const that=this;if(8===solve_err_code){const error_string_ptr=that._error_string_buffer;that.module_wrapper.user_get_invalid_state_error_into_string(that.obj,error_string_ptr,1);const error_string=that.module_wrapper.fc_solve_Pointer_stringify(error_string_ptr);throw alert(error_string+"\n"),"Foo"}if(solve_err_code===exports.FCS_STATE_SUSPEND_PROCESS)return that.current_iters_limit>=131072?void that.set_status("exceeded","Iterations count exceeded at "+that.current_iters_limit):void that.set_status("running","Running ("+that.current_iters_limit+" iterations)");if(solve_err_code!==exports.FCS_STATE_WAS_SOLVED){if(1!==solve_err_code)throw alert("Unknown Error code "+solve_err_code+"!"),"Foo";that.set_status("impossible","Could not solve.")}else that.set_status("solved","Solved")}resume_solution(){this._increase_iters_limit();const solve_err_code=this.module_wrapper.user_resume_solution(this.obj);return this.handle_err_code(solve_err_code),solve_err_code}do_solve(proto_board_string){const that=this;that.set_status("running","Running");try{that._increase_iters_limit();const board_string=that._process_board_string(proto_board_string),solve_err_code=that.module_wrapper.user_solve_board(that.obj,board_string);return that.handle_err_code(solve_err_code),solve_err_code}catch(e){return void that.set_status("error","Error")}}unicode_preprocess(out_buffer,display){return display.unicode_preprocess(out_buffer)}display_solution(args){const that=this,displayer=args.displayer;let ret;try{that._calc_states_and_moves_seq(),that.set_status("solved","Solved"),ret=that._display_specific_sol(that._pre_expand_states_and_moves_seq,displayer)}catch(e){return}return ret}display_expanded_moves_solution(args){return this._calc_expanded_seq(),this.set_status("solved","Solved"),this._display_specific_sol(this._post_expand_states_and_moves_seq,args.displayer)}calc_expanded_move(idx){const states_and_moves_sequence=this.proto_states_and_moves_seq;return states_and_moves_sequence[idx].exp||(states_and_moves_sequence[idx].exp=(0,web_fc_solve__expand_moves_1.fc_solve_expand_move)(8,4,states_and_moves_sequence[idx-1].str,states_and_moves_sequence[idx].m,states_and_moves_sequence[idx+1].str)),states_and_moves_sequence[idx].exp}generic_display_sol(args){return args.expand?this.display_expanded_moves_solution(args):this.display_solution(args)}get_empty_stacks_filled_by(){return this.module_wrapper.user_get_empty_stacks_filled_by(this.obj)}get_num_freecells(){return this.module_wrapper.user_get_num_freecells(this.obj)}_is_num_times_invalid(iters){return iters<0}get_num_times_long(){const that=this;if(that._is_num_times_invalid(that._cached_num_times_long)){if(!that.obj)throw"obj is null when num_times not set.";return that._calc_get_num_times_long_based_obj()}return that._cached_num_times_long}_calc_get_num_states_in_collection_long_based_obj(){return this.module_wrapper.user_get_num_states_in_collection_long(this.obj)}_calc_get_num_times_long_based_obj(){return this.module_wrapper.user_get_num_times_long(this.obj)}get_num_stacks(){return this.module_wrapper.user_get_num_stacks(this.obj)}get_num_states_in_collection_long(){const that=this;if(that._is_num_times_invalid(that._cached_num_states_long)){if(!that.obj)throw"obj is null when num_times not set.";return that._calc_get_num_states_in_collection_long_based_obj()}return that._cached_num_states_long}get_sequence_move(){return this.module_wrapper.user_get_sequence_move(this.obj)}get_sequences_are_built_by_type(){return this.module_wrapper.user_get_sequences_are_built_by_type(this.obj)}_check_if_params_match_preset({empty_stacks_filled_by:empty_stacks_filled_by,sequence_move:sequence_move,sequences_are_built_by_type:sequences_are_built_by_type,wanted_num_freecells:wanted_num_freecells,wanted_num_stacks:wanted_num_stacks}){let reasons="";this.get_empty_stacks_filled_by()!==empty_stacks_filled_by&&(reasons+="Wrong empty_stacks_filled_by!\n"),this.get_num_stacks()!==wanted_num_stacks&&(reasons+="Wrong number of stacks!\n"),this.get_num_freecells()!==wanted_num_freecells&&(reasons+="Wrong number of freecells!\n"),this.get_sequence_move()!==sequence_move&&(reasons+="Wrong sequence_move!\n"),this.get_sequences_are_built_by_type()!==sequences_are_built_by_type&&(reasons+="Wrong sequences_are_built_by_type!\n");return{reasons:reasons,verdict:0==reasons.length}}check_if_params_match_freecell(){const empty_stacks_filled_by=exports.FCS_ES_FILLED_BY_ANY_CARD,sequences_are_built_by_type=exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR;return this._check_if_params_match_preset({empty_stacks_filled_by:empty_stacks_filled_by,sequence_move:0,sequences_are_built_by_type:sequences_are_built_by_type,wanted_num_freecells:4,wanted_num_stacks:8})}_calc_states_and_moves_seq(){const that=this;if(that._pre_expand_states_and_moves_seq)return;const states_and_moves_sequence=[];function _out_state(s){states_and_moves_sequence.push({type:"s",str:s})}function get_state_str(){return that.module_wrapper.user_current_state_stringify(that.obj,that._state_string_buffer,1,0,1),that.module_wrapper.fc_solve_Pointer_stringify(that._state_string_buffer)}let move_ret_code;_out_state(get_state_str());const move_buffer=that._move_buffer;for(;0===(move_ret_code=that.module_wrapper.user_get_next_move(that.obj,move_buffer));){const state_as_string=get_state_str();that.module_wrapper.user_stringify_move_ptr(that.obj,that._move_string_buffer,move_buffer,0);const move_as_string=that.module_wrapper.fc_solve_Pointer_stringify(that._move_string_buffer);states_and_moves_sequence.push({exp:null,is_exp:!1,m:{str:move_as_string,type:"m"},type:"m"}),_out_state(state_as_string)}that.proto_states_and_moves_seq=states_and_moves_sequence,that._pre_expand_states_and_moves_seq=states_and_moves_sequence.map((item=>"m"===item.type?item.m:item)),that._post_expand_states_and_moves_seq=null,that._cached_num_times_long=that._calc_get_num_times_long_based_obj(),that._cached_num_states_long=that._calc_get_num_states_in_collection_long_based_obj(),that.module_wrapper.user_free(that.obj),that.obj=0,that.module_wrapper.c_free(that._state_string_buffer),that._state_string_buffer=0,that._move_string_buffer=0,that._move_buffer=0}_calc_expanded_seq(){const that=this;if(that._post_expand_states_and_moves_seq)return;that._calc_states_and_moves_seq();const states_and_moves_sequence=that.proto_states_and_moves_seq,new_array=[states_and_moves_sequence[0]];for(let i=1;i[]));let deck=(0,prange_1.perl_range)(0,51);randomizer.shuffle(deck),deck=deck.reverse();for(let i=0;i<52;i++)columns[i%8].push(deck[i]);function render_card(card){const suit=card%4,rank=Math.floor(card/4);return"A23456789TJQK".charAt(rank)+"CDHS".charAt(suit)}return columns.map((function(col){return": "+col.map(render_card).join(" ")+"\n"})).join("")};class MSRand{constructor(args){this.module_wrapper=args.module_wrapper,this.gamenumber=args.gamenumber,this.rander=this.module_wrapper.ms_rand__get(),this.module_wrapper.ms_rand__init(this.rander,""+this.gamenumber)}max_rand(mymax){return this.module_wrapper.ms_rand__mod_rand(this.rander,mymax)}shuffle(deck){const that=this;if(deck.length){let i=deck.length;for(;--i;){const j=that.max_rand(i+1),tmp=deck[i];deck[i]=deck[j],deck[j]=tmp}}return deck}}})); \ No newline at end of file diff --git a/docs/js/all.js b/docs/js/all.js index 1095911..4753f30 100644 --- a/docs/js/all.js +++ b/docs/js/all.js @@ -23159,11 +23159,10 @@ YUI.add( "0.0.1", { requires: ["solitaire"] }, ); -define(["require", "exports", "./prange", "./french-cards"], function (require, exports, prange_1, french_cards_1) { +define(["require", "exports", "./prange", "./french-cards", "./capitalize-cards"], function (require, exports, prange_1, french_cards_1, capitalize_cards_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BoardParseResult = exports.ParseErrorType = exports.ErrorLocationType = exports.Foundations = exports.suits__str_to_int = exports.MAX_RANK = exports.MIN_RANK = exports.NUM_SUITS = exports.ranks__str_to_int = void 0; - exports.capitalize_cards = capitalize_cards; exports.fcs_js__card_from_string = fcs_js__card_from_string; exports.fcs_js__column_from_string = fcs_js__column_from_string; exports.fcs_js__freecells_from_string = fcs_js__freecells_from_string; @@ -23227,52 +23226,6 @@ define(["require", "exports", "./prange", "./french-cards"], function (require, french_cards_1.suits__int_to_str.substring(this.suit, this.suit + 1)); } } - class BoardTextLine { - constructor(line) { - this.line = line; - const that = this; - const m1 = line.match(/^([^\n\r]*)([\n\r]*)$/); - that.newline = m1[2]; - let l = m1[1]; - if (m1[1].match(/#/)) { - const m2 = m1[1].match(/^(.*?)(#.*)/); - that.comment = m2[2]; - l = m2[1]; - } - else { - that.comment = ""; - } - if (l.match(/:/)) { - const m3 = l.match(/^([^:]*:)(.*)/); - that.prefix = m3[1]; - that.content = m3[2]; - } - else { - that.prefix = ""; - that.content = l; - } - return; - } - getContent() { - return this.content; - } - capitalize() { - const that = this; - const ret = that.prefix + - that.getContent().toUpperCase() + - that.comment + - that.newline; - return ret; - } - } - function capitalize_cards(board) { - return board - .match(/[^\n]*\n?/g) - .map((l) => { - return new BoardTextLine(l).capitalize(); - }) - .join(""); - } class Column { constructor(cards) { this.cards = cards; @@ -23651,7 +23604,7 @@ define(["require", "exports", "./prange", "./french-cards"], function (require, this.is_valid = true; const that = this; const lines = orig_s.match(/[^\n]*\n?/g).map((l) => { - return new BoardTextLine(l); + return new capitalize_cards_1.BoardTextLine(l); }); for (const l of lines) { { @@ -23882,6 +23835,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fc_solve_expand_move = fc_solve_expand_move; + exports.fc_solve_expand_moves_filter_solution_text = fc_solve_expand_moves_filter_solution_text; function _to_int(s) { return parseInt(s, 10); } @@ -23975,7 +23929,13 @@ define(["require", "exports"], function (require, exports) { "\n" + expander.modified_state.c .map((col) => { - return ": " + col.join(" ") + "\n"; + return (":" + + col + .map((card) => { + return " " + card; + }) + .join("") + + "\n"); }) .join(""); expander.ret_array.push({ @@ -24072,13 +24032,19 @@ define(["require", "exports"], function (require, exports) { } function fc_solve_expand_move(num_stacks, num_freecells, initial_src_state_str, initial_move, initial_dest_state_str) { const matched = initial_move.str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)$/); + const raw_ret = [ + { + str: initial_move.str, + type: "m", + }, + ]; if (!matched) { - return [initial_move]; + return raw_ret; } const ultimate_num_cards = _to_int(matched[1]); // TODO : Implement the case where the sequence move is unlimited. if (ultimate_num_cards === 1) { - return [initial_move]; + return raw_ret; } const ultimate_source = _to_int(matched[2]); const ultimate_dest = _to_int(matched[3]); @@ -24088,30 +24054,116 @@ define(["require", "exports"], function (require, exports) { expander.recursive_move(ultimate_source, ultimate_dest, ultimate_num_cards, expander.empty_stack_indexes); return expander.ret_array; } + function fc_solve_expand_moves_filter_solution_text(num_stacks, num_freecells, initial_str) { + const founds_pat = "^Foundations:[^\\n]*\\n"; + const freecells_pat = "^Freecells:[^\\n]*\\n"; + const move_line_pat = "^Move (?:[2-9][0-9]*|1[0-9]+) cards from stack [0-9]+ to stack [0-9]+$"; + const board_pat = founds_pat + freecells_pat + "(?:^:[^\\n]*\\n)+"; + const board2move_sep = "\n\n====================\n\n"; + const move2board_sep = "\n"; + const move2board_sep4output = "\n\n"; + const re = new RegExp("(" + + board_pat + + ")" + + board2move_sep + + "(" + + move_line_pat + + ")" + + "\\n" + + move2board_sep + + "(?=" + + "(" + + board_pat + + ")" + + ")", "gms"); + let expanded_sol = initial_str; + let changes = 0; + do { + changes = 0; + expanded_sol = expanded_sol.replace(re, function replacer(match, initial_str, move, fin) { + ++changes; + let ret = ""; + const arr = fc_solve_expand_move(num_stacks, num_freecells, initial_str, { str: move }, fin); + ret += initial_str; + ret += board2move_sep; + let i; + for (i = 0; i < arr.length - 1; i += 2) { + const m_elem = arr[i]; + if (m_elem.type != "m") { + throw "wrong KI.T ''" + m_elem.type + "''"; + } + ret += m_elem.str; + ret += move2board_sep4output; + const s_elem = arr[i + 1]; + if (s_elem.type != "s") { + throw "wrong K[I+1].T ''" + s_elem.type + "''"; + } + ret += s_elem.str; + ret += board2move_sep; + } + ret += arr[i].str; + ret += move2board_sep4output; + return ret; + }); + } while (changes != 0); + return expanded_sol; + } }); define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc-solve--expand-moves", "./french-cards"], function (require, exports, validate, BaseApi, web_fc_solve__expand_moves_1, french_cards_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.FC_Solve = exports.DisplayFilter = exports.FCS_STATE_SUSPEND_PROCESS = exports.FCS_STATE_WAS_SOLVED = void 0; + exports.FC_Solve = exports.DisplayFilter = exports.FCS_STATE_SUSPEND_PROCESS = exports.FCS_STATE_WAS_SOLVED = exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR = exports.FCS_ES_FILLED_BY_ANY_CARD = void 0; exports.FC_Solve_init_wrappers_with_module = FC_Solve_init_wrappers_with_module; + let myalert; + try { + if (!alert) { + myalert = (e) => { + console.log(e + "\n"); + throw e; + }; + } + else { + myalert = alert; + } + } + catch (x) { + myalert = (e) => { + console.log(e + "\n"); + throw e; + }; + } function FC_Solve_init_wrappers_with_module(Module) { const module_wrapper = BaseApi.base_calc_module_wrapper(Module); - module_wrapper.fc_solve_allocate_i8 = (p1) => { - return Module.allocate(p1, "i8", Module.ALLOC_STACK); - }; - module_wrapper.user_alloc = Module.cwrap("freecell_solver_user_alloc", "number", []); + module_wrapper.bh_create = Module._black_hole_solver_create; + module_wrapper.bh_free = Module._black_hole_solver_free; + module_wrapper.user_alloc = Module._freecell_solver_user_alloc; module_wrapper.user_solve_board = Module.cwrap("freecell_solver_user_solve_board", "number", ["number", "string"]); - module_wrapper.user_resume_solution = Module.cwrap("freecell_solver_user_resume_solution", "number", ["number"]); + module_wrapper.user_resume_solution = + Module._freecell_solver_user_resume_solution; module_wrapper.user_cmd_line_read_cmd_line_preset = Module.cwrap("freecell_solver_user_cmd_line_read_cmd_line_preset", "number", ["number", "string", "number", "number", "number", "string"]); + module_wrapper.user_get_empty_stacks_filled_by = + Module._freecell_solver_user_get_empty_stacks_filled_by; module_wrapper.user_get_next_move = Module.cwrap("freecell_solver_user_get_next_move", "number", ["number", "number"]); - module_wrapper.user_get_num_freecells = Module.cwrap("freecell_solver_user_get_num_freecells", "number", ["number"]); - module_wrapper.user_get_num_stacks = Module.cwrap("freecell_solver_user_get_num_stacks", "number", ["number"]); + module_wrapper.user_get_num_freecells = + Module._freecell_solver_user_get_num_freecells; + module_wrapper.user_get_num_stacks = + Module._freecell_solver_user_get_num_stacks; + module_wrapper.user_get_num_states_in_collection_long = + Module._freecell_solver_user_get_num_states_in_collection_long; + module_wrapper.user_get_num_times_long = + Module._freecell_solver_user_get_num_times_long; + module_wrapper.user_get_sequence_move = + Module._freecell_solver_user_get_sequence_move; + module_wrapper.user_get_sequences_are_built_by_type = + Module._freecell_solver_user_get_sequences_are_built_by_type; module_wrapper.user_get_unrecognized_cmd_line_flag = Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag", "number", ["number", "number"]); module_wrapper.user_get_unrecognized_cmd_line_flag_status = Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag_status", "number", ["number", "number"]); - module_wrapper.user_current_state_stringify = Module.cwrap("freecell_solver_user_current_state_stringify", "number", ["number", "number", "number", "number", "number"]); + module_wrapper.user_current_state_stringify = + Module._freecell_solver_user_current_state_stringify; module_wrapper.user_stringify_move_ptr = Module.cwrap("freecell_solver_user_stringify_move_ptr", "number", ["number", "number", "number", "number"]); - module_wrapper.user_free = Module.cwrap("freecell_solver_user_free", "number", ["number"]); - module_wrapper.user_limit_iterations_long = Module.cwrap("freecell_solver_user_limit_iterations_long", "number", ["number", "number"]); + module_wrapper.user_free = Module._freecell_solver_user_free; + module_wrapper.user_limit_iterations_long = + Module._freecell_solver_user_limit_iterations_long; module_wrapper.user_get_invalid_state_error_into_string = Module.cwrap("freecell_solver_user_get_invalid_state_error_into_string", "number", ["number", "number", "number"]); module_wrapper.user_cmd_line_parse_args_with_file_nesting_count = Module.cwrap("freecell_solver_user_cmd_line_parse_args_with_file_nesting_count", "number", [ @@ -24141,9 +24193,17 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- module_wrapper.fc_solve_Pointer_stringify = (ptr) => { return Module.UTF8ToString(ptr, 10000); }; + module_wrapper.stringToAscii = (s, outPtr) => { + return Module.writeArrayToMemory(Module.intArrayFromString(s), outPtr); + }; + module_wrapper.stringToUTF8 = (s, outPtr, maxBytes) => { + return Module.stringToUTF8(s, outPtr, maxBytes); + }; return module_wrapper; } const remove_trailing_space_re = /[ \t]+$/gm; + exports.FCS_ES_FILLED_BY_ANY_CARD = 0; + exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR = 0; exports.FCS_STATE_WAS_SOLVED = 0; const FCS_STATE_IS_NOT_SOLVEABLE = 1; const FCS_STATE_ALREADY_EXISTS = 2; @@ -24201,12 +24261,17 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- } } exports.DisplayFilter = DisplayFilter; + const _PTR_SIZE = 4; + const _read_from_file_str_ptr_size = 32; + const _arg_str_ptr_size = 128; const ptr_type = "i32"; class FC_Solve { constructor(args) { const that = this; that.module_wrapper = args.module_wrapper; that._do_not_alert = false; + that._cached_num_times_long = -1; + that._cached_num_states_long = -1; that.dir_base = args.dir_base; that.string_params = args.string_params ? [args.string_params] : null; that.set_status_callback = args.set_status_callback; @@ -24232,13 +24297,17 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- } return ret_obj; })(); + that._cached_num_times_long = -1; + that._cached_num_states_long = -1; that.proto_states_and_moves_seq = null; that._pre_expand_states_and_moves_seq = null; that._post_expand_states_and_moves_seq = null; - that._state_string_buffer = that.module_wrapper.alloc_wrap(500, "state string buffer", "Zam"); - that._move_string_buffer = that.module_wrapper.alloc_wrap(200, "move string buffer", "Plum"); return; } + get_pre_expand_states_and_moves_seq() { + const that = this; + return that._pre_expand_states_and_moves_seq; + } set_status(myclass, mylabel) { const that = this; return that.set_status_callback(myclass, mylabel); @@ -24246,10 +24315,9 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- handle_err_code(solve_err_code) { const that = this; if (solve_err_code === FCS_STATE_INVALID_STATE) { - const error_string_ptr = that.module_wrapper.alloc_wrap(300, "state error string", "Gum"); + const error_string_ptr = that._error_string_buffer; that.module_wrapper.user_get_invalid_state_error_into_string(that.obj, error_string_ptr, 1); const error_string = that.module_wrapper.fc_solve_Pointer_stringify(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr); alert(error_string + "\n"); throw "Foo"; } @@ -24339,14 +24407,95 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- ? that.display_expanded_moves_solution(args) : that.display_solution(args); } + get_empty_stacks_filled_by() { + const that = this; + return that.module_wrapper.user_get_empty_stacks_filled_by(that.obj); + } get_num_freecells() { const that = this; return that.module_wrapper.user_get_num_freecells(that.obj); } + _is_num_times_invalid(iters) { + return iters < 0; + } + get_num_times_long() { + const that = this; + if (that._is_num_times_invalid(that._cached_num_times_long)) { + if (!that.obj) { + throw "obj is null when num_times not set."; + } + return that._calc_get_num_times_long_based_obj(); + } + return that._cached_num_times_long; + } + _calc_get_num_states_in_collection_long_based_obj() { + const that = this; + return that.module_wrapper.user_get_num_states_in_collection_long(that.obj); + } + _calc_get_num_times_long_based_obj() { + const that = this; + return that.module_wrapper.user_get_num_times_long(that.obj); + } get_num_stacks() { const that = this; return that.module_wrapper.user_get_num_stacks(that.obj); } + get_num_states_in_collection_long() { + const that = this; + if (that._is_num_times_invalid(that._cached_num_states_long)) { + if (!that.obj) { + throw "obj is null when num_times not set."; + } + return that._calc_get_num_states_in_collection_long_based_obj(); + } + return that._cached_num_states_long; + } + get_sequence_move() { + const that = this; + return that.module_wrapper.user_get_sequence_move(that.obj); + } + get_sequences_are_built_by_type() { + const that = this; + return that.module_wrapper.user_get_sequences_are_built_by_type(that.obj); + } + _check_if_params_match_preset({ empty_stacks_filled_by, sequence_move, sequences_are_built_by_type, wanted_num_freecells, wanted_num_stacks, }) { + const that = this; + let reasons = ""; + if (that.get_empty_stacks_filled_by() !== empty_stacks_filled_by) { + reasons += "Wrong empty_stacks_filled_by!\n"; + } + if (that.get_num_stacks() !== wanted_num_stacks) { + reasons += "Wrong number of stacks!\n"; + } + if (that.get_num_freecells() !== wanted_num_freecells) { + reasons += "Wrong number of freecells!\n"; + } + if (that.get_sequence_move() !== sequence_move) { + reasons += "Wrong sequence_move!\n"; + } + if (that.get_sequences_are_built_by_type() !== + sequences_are_built_by_type) { + reasons += "Wrong sequences_are_built_by_type!\n"; + } + const verdict = reasons.length == 0; + return { reasons: reasons, verdict: verdict }; + } + check_if_params_match_freecell() { + const that = this; + let reasons = ""; + const wanted_num_freecells = 4; + const wanted_num_stacks = 8; + const empty_stacks_filled_by = exports.FCS_ES_FILLED_BY_ANY_CARD; + const sequence_move = 0; + const sequences_are_built_by_type = exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR; + return that._check_if_params_match_preset({ + empty_stacks_filled_by: empty_stacks_filled_by, + sequence_move: sequence_move, + sequences_are_built_by_type: sequences_are_built_by_type, + wanted_num_freecells: wanted_num_freecells, + wanted_num_stacks: wanted_num_stacks, + }); + } _calc_states_and_moves_seq() { const that = this; if (that._pre_expand_states_and_moves_seq) { @@ -24365,7 +24514,7 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- _out_state(get_state_str()); let move_ret_code; // 128 bytes are enough to hold a move. - const move_buffer = that.module_wrapper.alloc_wrap(128, "a buffer for the move", "maven"); + const move_buffer = that._move_buffer; while ((move_ret_code = that.module_wrapper.user_get_next_move(that.obj, move_buffer)) === 0) { const state_as_string = get_state_str(); that.module_wrapper.user_stringify_move_ptr(that.obj, that._move_string_buffer, move_buffer, 0); @@ -24386,14 +24535,16 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- return item.type === "m" ? item.m : item; }); that._post_expand_states_and_moves_seq = null; + that._cached_num_times_long = that._calc_get_num_times_long_based_obj(); + that._cached_num_states_long = + that._calc_get_num_states_in_collection_long_based_obj(); // Cleanup C resources - that.module_wrapper.c_free(move_buffer); that.module_wrapper.user_free(that.obj); that.obj = 0; that.module_wrapper.c_free(that._state_string_buffer); that._state_string_buffer = 0; - that.module_wrapper.c_free(that._move_string_buffer); that._move_string_buffer = 0; + that._move_buffer = 0; return; } _calc_expanded_seq() { @@ -24448,17 +24599,48 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- ? that.module_wrapper.fc_solve_Pointer_stringify(s_ptr) : ""; } + _initialize_object_buffers() { + const that = this; + const _error_string_buffer_size = 512; + const _state_string_buffer_size = 500; + const _move_string_buffer_size = 200; + const _move_buffer_size = 64; + const _args_buffer_size = _PTR_SIZE * 2; + const _last_arg_ptr_buffer_size = _PTR_SIZE; + const _total_buffer_size = _state_string_buffer_size + + _move_string_buffer_size + + _move_buffer_size + + _read_from_file_str_ptr_size + + _arg_str_ptr_size + + _args_buffer_size + + _last_arg_ptr_buffer_size + + _error_string_buffer_size; + that._state_string_buffer = that.module_wrapper.alloc_wrap(_total_buffer_size, "state+move string buffer", "Zam"); + if (!that._state_string_buffer) { + alert("that._state_string_buffer is 0"); + } + that._move_string_buffer = + that._state_string_buffer + _state_string_buffer_size; + that._move_buffer = that._move_string_buffer + _move_string_buffer_size; + that._read_from_file_str_ptr = that._move_buffer + _move_buffer_size; + that._arg_str_ptr = + that._read_from_file_str_ptr + _read_from_file_str_ptr_size; + that._args_buffer = that._arg_str_ptr + _arg_str_ptr_size; + that._last_arg_ptr_buffer = that._args_buffer + _args_buffer_size; + that._error_string_buffer = + that._last_arg_ptr_buffer + _last_arg_ptr_buffer_size; + } _initialize_obj(obj) { const that = this; const cmd_line_preset = that.cmd_line_preset; try { + that._initialize_object_buffers(); if (cmd_line_preset !== "default") { - const error_string_ptr_buf = that.module_wrapper.alloc_wrap(128, "error string buffer", "Foo"); + const error_string_ptr_buf = that._error_string_buffer; const preset_ret = that.module_wrapper.user_cmd_line_read_cmd_line_preset(obj, cmd_line_preset, 0, error_string_ptr_buf, 0, null); const error_string_ptr = that.module_wrapper.Module.getValue(error_string_ptr_buf, ptr_type); const error_string = that._stringify_possibly_null_ptr(error_string_ptr); that.module_wrapper.c_free(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr_buf); if (preset_ret !== 0) { alert("Failed to load command line preset '" + cmd_line_preset + @@ -24469,28 +24651,27 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- } } if (that.string_params) { - const error_string_ptr_buf = that.module_wrapper.alloc_wrap(128, "error string buffer", "Engo"); + const error_string_ptr_buf = that._error_string_buffer; // Create a file with the contents of string_params. // var base_path = '/' + that.dir_base; const base_path = "/"; const file_basename = "string-params.fc-solve.txt"; const string_params_file_path = base_path + file_basename; that.module_wrapper.Module.FS.writeFile(string_params_file_path, that.string_params[0], {}); - const args_buf = that.module_wrapper.alloc_wrap(4 * 2, "args buf", "Seed"); + const args_buf = that._args_buffer; // TODO : Is there a memory leak here? - const read_from_file_str_ptr = that.module_wrapper.fc_solve_allocate_i8(that.module_wrapper.Module.intArrayFromString("--read-from-file")); - const arg_str_ptr = that.module_wrapper.fc_solve_allocate_i8(that.module_wrapper.Module.intArrayFromString("0," + string_params_file_path)); + const read_from_file_str_ptr = that._read_from_file_str_ptr; + that.module_wrapper.stringToUTF8("--read-from-file", read_from_file_str_ptr, _read_from_file_str_ptr_size); + const arg_str_ptr = that._arg_str_ptr; + that.module_wrapper.stringToUTF8("0," + string_params_file_path, arg_str_ptr, _arg_str_ptr_size); that.module_wrapper.Module.setValue(args_buf, read_from_file_str_ptr, ptr_type); - that.module_wrapper.Module.setValue(args_buf + 4, arg_str_ptr, ptr_type); - const last_arg_ptr = that.module_wrapper.alloc_wrap(4, "last_arg_ptr", "cherry"); + that.module_wrapper.Module.setValue(args_buf + _PTR_SIZE, arg_str_ptr, ptr_type); + const last_arg_ptr = that._last_arg_ptr_buffer; // Input the file to the solver. const args_ret_code = that.module_wrapper.user_cmd_line_parse_args_with_file_nesting_count(obj, 2, args_buf, 0, 0, 0, 0, error_string_ptr_buf, last_arg_ptr, -1, 0); - that.module_wrapper.c_free(last_arg_ptr); - that.module_wrapper.c_free(args_buf); const error_string_ptr = that.module_wrapper.Module.getValue(error_string_ptr_buf, ptr_type); const error_string = that._stringify_possibly_null_ptr(error_string_ptr); that.module_wrapper.c_free(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr_buf); if (args_ret_code !== 0) { const unrecognized_opt_ptr = that.module_wrapper.user_get_unrecognized_cmd_line_flag_status(obj, 0) == 0 ? that.module_wrapper.user_get_unrecognized_cmd_line_flag(obj, 0) @@ -24534,6 +24715,7 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- return 0; } catch (e) { + console.log("Error = " + e + "\n"); that.set_status("error", "Error"); return -1; } @@ -24547,11 +24729,11 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) exports.base_calc_module_wrapper = base_calc_module_wrapper; exports.deal_ms_fc_board = deal_ms_fc_board; function base_calc_module_wrapper(Module) { - const ms_rand__get_singleton = Module.cwrap("fc_solve__hll_ms_rand__get_singleton", "number", []); + const ms_rand__get = Module.cwrap("fc_solve__hll_ms_rand__get_global_instance", "number", []); const ms_rand__init = Module.cwrap("fc_solve__hll_ms_rand__init", "number", ["number", "string"]); const ms_rand__mod_rand = Module.cwrap("fc_solve__hll_ms_rand__mod_rand", "number", ["number", "number"]); return { - ms_rand__get_singleton, + ms_rand__get, ms_rand__init, ms_rand__mod_rand, Module, @@ -24568,7 +24750,7 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) const that = this; that.module_wrapper = args.module_wrapper; that.gamenumber = args.gamenumber; - that.rander = that.module_wrapper.ms_rand__get_singleton(); + that.rander = that.module_wrapper.ms_rand__get(); that.module_wrapper.ms_rand__init(that.rander, "" + that.gamenumber); return; } @@ -24577,10 +24759,11 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) return that.module_wrapper.ms_rand__mod_rand(that.rander, mymax); } shuffle(deck) { + const that = this; if (deck.length) { let i = deck.length; while (--i) { - const j = this.max_rand(i + 1); + const j = that.max_rand(i + 1); const tmp = deck[i]; deck[i] = deck[j]; deck[j] = tmp; diff --git a/docs/js/combined-min.js b/docs/js/combined-min.js index 260fe0f..e4c3e21 100644 --- a/docs/js/combined-min.js +++ b/docs/js/combined-min.js @@ -21,4 +21,4 @@ this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type===f.type){a++,s=a>=n.rollup;i :{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(e){function i(e,t){return e==="ok"?!0:t}var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONParse!==!1&&!!n;if(r)try{r=n.parse('{"ok":false}',i).ok}catch(s){r=!1}return!r},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(e){var t=e.config.global.JSON,n=Object.prototype.toString.call(t)==="[object JSON]"&&t,r=e.config.useNativeJSONStringify!==!1&&!!n;if(r)try{r="0"===n.stringify(0)}catch(i){r=!1}return!r},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-pathogen-combohandler":{},"loader-pathogen-encoder":{use:["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-local":{requires:["model","json-stringify"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base","dom-style"]},"node-core":{requires:["dom-core","selector"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},paginator:{requires:["paginator-core"]},"paginator-core":{requires:["base"]},"paginator-url":{requires:["paginator"]},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires :["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swfdetect","escape","widget","base","cssbutton","node","event-custom","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain" :{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(e){return!e.UA.nodejs&&!e.UA.winjs},trigger:"yql"},requires:["yql","jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs"},requires:["yql"]},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs"},requires:["yql"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[e.version].md5="2fd2be6b12ee9f999b4367499ae61aae"},"3.18.1",{requires:["loader-base"]}),YUI.add("yui",function(e,t){},"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}); -YUI.add("breakout",(function(Y){function Breakout(config){var rows=config.rows,columns=config.columns;this._host=config.host,this._container=Y.Node.create("
"),this._nodes=[],rows||columns||(rows=8),this._rows=rows,this._columns=columns,Breakout.superclass.constructor.apply(this,arguments)}Breakout.NS="breakout",Breakout.Name="Breakout",Y.extend(Breakout,Y.Plugin.Base,{_splitNode:function(){var r,c,x,y,host,row,width=Math.round(this._blockWidth),height=Math.round(this._blockHeight),rows=this._rows,columns=this._columns,origin=this._host.getXY(),container=this._container,nodes=this._nodes=[],mask=Y.Node.create('
');for(container.setXY(origin),r=0;r-1&&(VERSION="3.5.0"),proto={applyConfig:function(o){o=o||NOOP;var attr,name,config=this.config,mods=config.modules,groups=config.groups,aliases=config.aliases,loader=this.Env._loader;for(name in o)o.hasOwnProperty(name)&&(attr=o[name],mods&&"modules"==name?clobber(mods,attr):aliases&&"aliases"==name?clobber(aliases,attr):groups&&"groups"==name?clobber(groups,attr):"win"==name?(config[name]=attr&&attr.contentWindow||attr,config.doc=config[name]?config[name].document:null):"_yuid"==name||(config[name]=attr));loader&&loader._config(o)},_config:function(o){this.applyConfig(o)},_init:function(){var filter,el,prop,Y=this,G_ENV=YUI.Env,Env=Y.Env;if(Y.version=VERSION,!Env){if(Y.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:BASE,cdn:BASE+VERSION+"/",_idx:0,_used:{},_attached:{},_exported:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(src,pattern){var path,filter,match=src.match(pattern);return match&&(path=RegExp.leftContext||src.slice(0,src.indexOf(match[0])),filter=match[3],match[1]&&(path+="?"+match[1]),path={filter:filter,path:path}),path},getBase:G_ENV&&G_ENV.getBase||function(pattern){var parsed,i,len,src,nodes=doc&&doc.getElementsByTagName("script")||[],path=Env.cdn;for(i=0,len=nodes.length;i
',YUI.Env.cssStampEl=el.firstChild,doc.body?doc.body.appendChild(YUI.Env.cssStampEl):docEl.insertBefore(YUI.Env.cssStampEl,docEl.firstChild)):doc&&doc.getElementById("yui3-css-stamp")&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=doc.getElementById("yui3-css-stamp")),Y.config.lang=Y.config.lang||"en-US",Y.config.base=YUI.config.base||YUI.config.defaultBase&&YUI.config.root&&YUI.config.defaultBase+YUI.config.root||Y.Env.getBase(Y.Env._BASE_RE),filter&&"mindebug".indexOf(filter)||(filter="min"),filter=filter?"-"+filter:filter,Y.config.loaderPath=YUI.config.loaderPath||"loader/loader"+filter+".js"},_afterConfig:function(){this.config.hasOwnProperty("global")||(this.config.global=Function("return this")())},_setup:function(){var i,Y=this,core=[],mods=YUI.Env.mods,extendedCore=Y.config.extendedCore||[],extras=Y.config.core||[].concat(YUI.Env.core).concat(extendedCore);for(i=0;i-1)for(j="YAHOO"==(d=arg.split("."))[0]?1:0;j-1?value(o,key):o[key];return void 0===val?match:val})):s},L.trim=L._isNative(STRING_PROTO.trim)&&!WHITESPACE.trim()?function(s){return s&&s.trim?s.trim():s}:function(s){try{return s.replace(TRIMREGEX,"")}catch(e){return s}},L.trimLeft=L._isNative(STRING_PROTO.trimLeft)&&!WHITESPACE.trimLeft()?function(s){return s.trimLeft()}:function(s){return s.replace(TRIM_LEFT_REGEX,"")},L.trimRight=L._isNative(STRING_PROTO.trimRight)&&!WHITESPACE.trimRight()?function(s){return s.trimRight()}:function(s){return s.replace(TRIM_RIGHT_REGEX,"")},L.type=function(o){return TYPES[typeof o]||TYPES[TOSTRING.call(o)]||(o?"object":"null")};var Lang=Y.Lang,Native=Array.prototype,hasOwn=Object.prototype.hasOwnProperty;function YArray(thing,startIndex,force){var len,result;if(startIndex||(startIndex=0),force||YArray.test(thing))try{return Native.slice.call(thing,startIndex)}catch(ex){for(result=[],len=thing.length;startIndexi&&i in values)||values[i]);return hash},YArray.indexOf=Lang._isNative(Native.indexOf)?function(array,value,from){return Native.indexOf.call(array,value,from)}:function(array,value,from){var len=array.length;for((from=((from=+from||0)>0||-1)*Math.floor(Math.abs(from)))<0&&(from+=len)<0&&(from=0);from1?Array.prototype.join.call(arguments,"__"):String(arg);return(!(key in cache)||refetch&&cache[key]==refetch)&&(cache[key]=source.apply(source,arguments)),cache[key]}},Y.getLocation=function(){var win=Y.config.win;return win&&win.location},Y.merge=function(){for(var key,obj,i=0,len=arguments.length,result={};i-1},O.each=function(obj,fn,thisObj,proto){var key;for(key in obj)(proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj);return Y},O.some=function(obj,fn,thisObj,proto){var key;for(key in obj)if((proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj))return!0;return!1},O.getValue=function(o,path){if(Lang.isObject(o)){var i,p=Y.Array(path),l=p.length;for(i=0;undefined!==o&&i=0){for(i=0;undefined!==ref&&i0),subUA||("object"==typeof process&&process.versions&&process.versions.node&&(o.os=process.platform,o.nodejs=numberify(process.versions.node)),YUI.Env.UA=o),o},Y.UA=YUI.Env.UA||YUI.Env.parseUA(),Y.UA.compareVersions=function(a,b){var aPart,aParts,bPart,bParts,i,len;if(a===b)return 0;for(aParts=(a+"").split("."),bParts=(b+"").split("."),i=0,len=Math.max(aParts.length,bParts.length);ibPart)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],"loader-pathogen-encoder":["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",(function(Y,NAME){var CUSTOM_ATTRS,Get,Transaction,Lang=Y.Lang;Y.Get=Get={cssOptions:{attributes:{rel:"stylesheet"},doc:Y.config.linkDoc||Y.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:Y.config.scriptDoc||Y.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(transaction){var i,id,item,len,pending;if(Y.log("`Y.Get.abort()` is deprecated as of 3.5.0. Use the `abort()` method on the transaction instead.","warn","get"),!transaction.abort)if(id=transaction,transaction=null,(pending=this._pending)&&pending.transaction.id===id)transaction=pending.transaction,this._pending=null;else for(i=0,len=this._queue.length;i=threshold&&(Y.log("autopurge triggered after "+this._purgeNodes.length+" nodes","info","get"),this._purge(this._purgeNodes))},_getEnv:function(){var doc=Y.config.doc,ua=Y.UA;return this._env={async:doc&&!0===doc.createElement("script").async||ua.ie>=10,cssFail:ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0,cssLoad:(!ua.gecko&&!ua.webkit||ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0)&&!(ua.chrome&&ua.chrome<=18),preservesScriptOrder:!!(ua.gecko||ua.opera||ua.ie&&ua.ie>=10)}},_getTransaction:function(urls,options){var i,len,req,url,requests=[];for(Lang.isArray(urls)||(urls=[urls]),(options=Y.merge(this.options,options)).attributes=Y.merge(this.options.attributes,options.attributes),i=0,len=urls.length;i-1&&purgeNodes.splice(index,1))}},Get.script=Get.js,Get.Transaction=Transaction=function(requests,options){this.id=Transaction._lastId+=1,this.data=options.data,this.errors=[],this.nodes=[],this.options=options,this.requests=requests,this._callbacks=[],this._queue=[],this._reqsWaiting=0,this.tId=this.id,this.win=options.win||Y.config.win},Transaction._lastId=0,Transaction.prototype={_state:"new",abort:function(msg){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:msg||"Aborted"}),this._finish()},execute:function(callback){var i,len,queue,req,self=this,requests=self.requests,state=self._state;if("done"!==state){if(callback&&self._callbacks.push(callback),"executing"!==state){for(self._state="executing",self._queue=queue=[],self.options.timeout&&(self._timeout=setTimeout((function(){self.abort("Timeout")}),self.options.timeout)),self._reqsWaiting=requests.length,i=0,len=requests.length;i=10?(node.onerror=function(){setTimeout(onError,0)},node.onload=function(){setTimeout(onLoad,0)}):(node.onerror=onError,node.onload=onLoad),env.cssFail||isScript||(cssTimeout=setTimeout(onError,req.timeout||3e3))):this._poll(req),this.nodes.push(node),insertBefore.parentNode.insertBefore(node,insertBefore)},_next:function(){this._pending||(this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish())},_poll:function(newReq){var i,j,nodeHref,req,sheets,self=this,pendingCSS=self._pendingCSS,isWebKit=Y.UA.webkit;if(!newReq||(pendingCSS||(pendingCSS=self._pendingCSS=[]),pendingCSS.push(newReq),!self._pollTimer)){for(self._pollTimer=null,i=0;i=0;)if(sheets[j].href===nodeHref){pendingCSS.splice(i,1),i-=1,self._progress(null,req);break}}else try{!!req.node.sheet.cssRules,pendingCSS.splice(i,1),i-=1,self._progress(null,req)}catch(ex){}pendingCSS.length&&(self._pollTimer=setTimeout((function(){self._poll.call(self)}),self.options.pollInterval))}},_progress:function(err,req){var options=this.options;err&&(req.error=err,this.errors.push({error:err,request:req}),Y.log(err,"error","get")),req.node._yuiget_finished=req.finished=!0,options.onProgress&&options.onProgress.call(options.context||this,this._getEventData(req)),req.autopurge&&(Get._autoPurge(this.options.purgethreshold),Get._purgeNodes.push(req.node)),this._pending===req&&(this._pending=null),this._reqsWaiting-=1,this._next()}}}),"3.18.1",{requires:["yui-base"]}),YUI.add("features",(function(Y,NAME){var feature_tests={};Y.mix(Y.namespace("Features"),{tests:feature_tests,add:function(cat,name,o){feature_tests[cat]=feature_tests[cat]||{},feature_tests[cat][name]=o},all:function(cat,args){var cat_o=feature_tests[cat],result=[];return cat_o&&Y.Object.each(cat_o,(function(v,k){result.push(k+":"+(Y.Features.test(cat,k,args)?1:0))})),result.length?result.join(";"):""},test:function(cat,name,args){args=args||[];var result,ua,test,cat_o=feature_tests[cat],feature=cat_o&&cat_o[name];return feature?(result=feature.result,Y.Lang.isUndefined(result)&&((ua=feature.ua)&&(result=Y.UA[ua]),!(test=feature.test)||ua&&!result||(result=test.apply(Y,args)),feature.result=result)):Y.log("Feature test "+cat+", "+name+" not found"),result}});var add=Y.Features.add;add("load","0",{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"}),add("load","1",{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"}),add("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),add("load","3",{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"}),add("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),add("load","5",{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"}),add("load","6",{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","7",{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","8",{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","9",{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","10",{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","11",{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","12",{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"}),add("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),add("load","14",{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"}),add("load","15",{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"}),add("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),add("load","17",{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"}),add("load","18",{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"}),add("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),add("load","20",{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"}),add("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs"}),add("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs"})}),"3.18.1",{requires:["yui-base"]}),YUI.add("intl-base",(function(Y,NAME){var SPLIT_REGEX=/[, ]/;Y.mix(Y.namespace("Intl"),{lookupBestLang:function(preferredLanguages,availableLanguages){var i,language,result,index;function scan(language){var i;for(i=0;i0;){if(result=scan(language))return result;if(!((index=language.lastIndexOf("-"))>=0))break;language=language.substring(0,index),index>=2&&"-"===language.charAt(index-2)&&(language=language.substring(0,index-2))}return""}})}),"3.18.1",{requires:["yui-base"]}),YUI.add("yui-log",(function(Y,NAME){var INSTANCE=Y,LEVELS={debug:1,info:2,warn:4,error:8};INSTANCE.log=function(msg,cat,src,silent){var bail,excl,incl,m,f,minlevel,Y=INSTANCE,c=Y.config,publisher=Y.fire?Y:YUI.Env.globalEvents;return c.debug&&(void 0!==(src=src||"")&&(excl=c.logExclude,(incl=c.logInclude)&&!(src in incl)?bail=1:incl&&src in incl?bail=!incl[src]:excl&&src in excl&&(bail=excl[src]),void 0===cat&&(cat="info"),Y.config.logLevel=Y.config.logLevel||"debug",minlevel=LEVELS[Y.config.logLevel.toLowerCase()],cat in LEVELS&&LEVELS[cat]-1,this.comboSep="&",this.maxURLLength=1024,this.ignoreRegistered=o.ignoreRegistered,this.root=Y.Env.meta.root,this.timeout=0,this.forceMap={},this.allowRollup=!1,this.filters={},this.required={},this.patterns={},this.moduleInfo={},this.groups=Y.merge(Y.Env.meta.groups),this.skin=Y.merge(Y.Env.meta.skin),this.conditions={},this.config=o,this._internal=!0,this._populateConditionsCache(),this.loaded=GLOBAL_LOADED[VERSION],this.async=!0,this._inspectPage(),this._internal=!1,this._config(o),this.forceMap=this.force?Y.Array.hash(this.force):{},this.testresults=null,Y.config.tests&&(this.testresults=Y.config.tests),this.sorted=[],this.dirty=!0,this.inserted={},this.skipped={},this.tested={},this.ignoreRegistered&&this._resetModules()},Y.Loader.prototype={getModuleInfo:function(name){var rawMetaModules,globalRenderedMods,internal,v,m=this.moduleInfo[name];return m||(rawMetaModules=META.modules,globalRenderedMods=GLOBAL_ENV._renderedMods,internal=this._internal,globalRenderedMods&&globalRenderedMods.hasOwnProperty(name)&&!this.ignoreRegistered?this.moduleInfo[name]=Y.merge(globalRenderedMods[name]):rawMetaModules.hasOwnProperty(name)&&(this._internal=!0,(v=this.addModule(rawMetaModules[name],name))&&v.type===CSS&&this.isCSSLoaded(v.name,!0)&&(Y.log("Found CSS module on page: "+v.name,"info","loader"),this.loaded[v.name]=!0),this._internal=internal),this.moduleInfo[name])},_expandAliases:function(list){var i,name,expanded=[],aliases=YUI.Env.aliases;for(list=Y.Array(list),i=0;i-1&&(skinpar=i);if(skindef&&(skindef[name]||skinpar&&skindef[skinpar]))for(skinname=name,skindef[skinpar]&&(skinname=skinpar),i=0;i-1},getModule:function(mname){if(!mname)return null;var p,found,pname,m=this.getModuleInfo(mname),patterns=this.patterns;if(!m||m&&m.ext)for(pname in patterns)if(patterns.hasOwnProperty(pname)&&((p=patterns[pname]).test||(p.test=this._patternTest),p.test(mname,pname))){found=p;break}return m?found&&m&&found.configFn&&!m.configFn&&(m.configFn=found.configFn,m.configFn(m)):found&&(p.action?p.action.call(this,mname,pname):(Y.log("Undefined module: "+mname+", matched a pattern: "+pname,"info","loader"),(m=this.addModule(Y.merge(found,{test:void 0,temp:!0}),mname))&&found.configFn&&(m.configFn=found.configFn))),m},_rollup:function(){},_reduce:function(r){r=r||this.required;var i,j,s,m,type=this.loadType,ignore=!!this.ignore&&yArray.hash(this.ignore);for(i in r)if(r.hasOwnProperty(i)&&(m=this.getModule(i),((this.loaded[i]||ON_PAGE[i])&&!this.forceMap[i]&&!this.ignoreRegistered||type&&m&&m.type!==type)&&delete r[i],ignore&&ignore[i]&&delete r[i],s=m&&m.supersedes))for(j=0;j0&&(_queue.running=!0,_queue.next()())},insert:function(o,type,skipsort){Y.log("public insert() "+(type||"")+", "+Y.Object.keys(this.required),"info","loader");var self=this,copy=Y.merge(this);delete copy.require,delete copy.dirty,_queue.add((function(){self._insert(copy,o,type,skipsort)})),this._continue()},loadNext:function(){Y.log("loadNext was called..","error","loader")},_filter:function(u,name,group){var f=this.filter,hasFilter=name&&name in this.filters,modFilter=hasFilter&&this.filters[name],groupName=group||(this.getModuleInfo(name)||{}).group||null;return groupName&&this.groups[groupName]&&this.groups[groupName].filter&&(modFilter=this.groups[groupName].filter,hasFilter=!0),u&&(hasFilter&&(f=L.isString(modFilter)?this.FILTER_DEFS[modFilter.toUpperCase()]||null:modFilter),f&&(u=u.replace(new RegExp(f.searchExp,"g"),f.replaceStr))),u},_url:function(path,name,base){return this._filter((base||this.base||"")+path,name)},resolve:function(calc,sorted){var addSingle,self=this,resolved={js:[],jsMods:[],css:[],cssMods:[]},usePathogen=Y.config.comboLoader&&Y.config.customComboBase;(self.skin.overrides||"sam"!==self.skin.defaultSkin||self.ignoreRegistered)&&self._resetModules(),calc&&self.calculate(),sorted=sorted||self.sorted,addSingle=function(mod){if(mod){var url,group=mod.group&&self.groups[mod.group]||NOT_FOUND;!1===group.async&&(mod.async=group.async),url=mod.fullpath?self._filter(mod.fullpath,mod.name):self._url(mod.path,mod.name,group.base||mod.base),(mod.attributes||!1===mod.async)&&(url={url:url,async:mod.async},mod.attributes&&(url.attributes=mod.attributes)),resolved[mod.type].push(url),resolved[mod.type+"Mods"].push(mod)}else Y.log("Undefined Module","warn","loader")};var comboSources,maxURLLength,comboMeta,comboBase,comboSep,group,mod,len,i,inserted=self.ignoreRegistered?{}:self.inserted,hasComboModule=!1;for(i=0,len=sorted.length;imaxURLLength){for(Y.log("Exceeded maxURLLength ("+maxURLLength+") for "+type+", splitting","info","loader"),fragSubset=[],i=0,len=frags.length;imaxURLLength&&(frag=fragSubset.pop(),tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)),fragSubset=[],frag&&fragSubset.push(frag));fragSubset.length&&(tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)))}else resolved[type].push(this._filter(tmpBase,null,comboMeta.group))}return resolved},load:function(cb){if(cb){var self=this,out=self.resolve(!0);self.data=out,self.onEnd=function(){cb.apply(self.context||self,arguments)},self.insert()}else Y.log("No callback supplied to load()","error","loader")}}}),"3.18.1",{requires:["get","features"]}),YUI.add("loader-rollup",(function(Y,NAME){Y.Loader.prototype._rollup=function(){var i,j,m,s,roll,rolled,c,smod,r=this.required,info=this.moduleInfo;if(this.dirty||!this.rollups)for(i in this.rollups={},info)info.hasOwnProperty(i)&&(m=this.getModule(i))&&m.rollup&&(this.rollups[i]=m);for(;;){for(i in rolled=!1,this.rollups)if(this.rollups.hasOwnProperty(i)&&!r[i]&&(!this.loaded[i]||this.forceMap[i])){if(s=(m=this.getModule(i)).supersedes||[],roll=!1,!m.rollup)continue;for(c=0,j=0;j=m.rollup))break}roll&&(r[i]=!0,rolled=!0,this.getRequires(m))}if(!rolled)break}}}),"3.18.1",{requires:["loader-base"]}),YUI.add("loader-yui3",(function(Y,NAME){YUI.Env[Y.version].modules=YUI.Env[Y.version].modules||{},Y.mix(YUI.Env[Y.version].modules,{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style","color-base"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-observable","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{use:["attribute-observable"]},"attribute-extras":{requires:["oop"]},"attribute-observable":{requires:["event-custom"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en","es","hu","it"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},axes:{use:["axis-numeric","axis-category","axis-time","axis-stacked"]},"axes-base":{use:["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"]},axis:{requires:["dom","widget","widget-position","widget-stack","graphics","axis-base"]},"axis-base":{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]},"axis-category":{requires:["axis","axis-category-base"]},"axis-category-base":{requires:["axis-base"]},"axis-numeric":{requires:["axis","axis-numeric-base"]},"axis-numeric-base":{requires:["axis-base"]},"axis-stacked":{requires:["axis-numeric","axis-stacked-base"]},"axis-stacked-base":{requires:["axis-numeric-base"]},"axis-time":{requires:["axis","axis-time-base"]},"axis-time-base":{requires:["axis-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{requires:["attribute-base","base-core","base-observable"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-observable":{requires:["attribute-observable","base-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base","escape"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","es","es-AR","fr","hu","it","ja","nb-NO","nl","pt-BR","ru","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-HANT-TW"],requires:["widget","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0},charts:{use:["charts-base"]},"charts-base":{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},color:{use:["color-base","color-hsl","color-harmony"]},"color-base":{requires:["yui-base"]},"color-harmony":{requires:["color-hsl"]},"color-hsl":{requires:["color-base"]},"color-hsv":{requires:["color-base"]},console:{lang:["en","es","hu","it","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},"content-editable":{requires:["node-base","editor-selection","stylesheet","plugin"]},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssnormalize"],type:"css"},"cssgrids-base":{optional:["cssnormalize"],type:"css"},"cssgrids-responsive":{optional:["cssnormalize"],requires:["cssgrids","cssgrids-responsive-base"],type:"css"},"cssgrids-units":{optional:["cssnormalize"],requires:["cssgrids-base"],type:"css"},cssnormalize:{type:"css"},"cssnormalize-context":{type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-foot":{requires:["datatable-core","view"]},"datatable-formatters":{requires:["datatable-body","datatype-number-format","datatype-date-format","escape"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-highlight":{requires:["datatable-base","event-hover"],skinnable:!0},"datatable-keynav":{requires:["datatable-base"]},"datatable-message":{lang:["en","fr","es","hu","it"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-paginator":{lang:["en","fr"],requires:["model","view","paginator-core","datatable-foot","datatable-paginator-templates"],skinnable:!0},"datatable-paginator-templates":{requires:["template"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-sort":{lang:["en","fr","es","hu"],requires:["datatable-base"],skinnable:!0},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","hu","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{requires:["escape"]},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base","selector-css2"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es","hu"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"},requires:["dom-style","color-base"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-inline":{requires:["editor-base","content-editable"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","plugin","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}},"graphics-group":{requires:["graphics"]},"graphics-svg":{condition:{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-pathogen-combohandler":{},"loader-pathogen-encoder":{use:["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-local":{requires:["model","json-stringify"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base","dom-style"]},"node-core":{requires:["dom-core","selector"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},paginator:{requires:["paginator-core"]},"paginator-core":{requires:["base"]},"paginator-url":{requires:["paginator"]},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swfdetect","escape","widget","base","cssbutton","node","event-custom","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"},requires:["yql","jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs"},requires:["yql"]},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs"},requires:["yql"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[Y.version].md5="2fd2be6b12ee9f999b4367499ae61aae"}),"3.18.1",{requires:["loader-base"]}),YUI.add("yui",(function(Y,NAME){}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,(function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))})),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),(function(e){t=t[e]})),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function i(e,i,r){var o,a,s,u,c,d,p,f,l,h,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(d=(e=e.split("/")).length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),function(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&v&&(g||x)){e:for(s=(a=e.split("/")).length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if((o=getOwn(v,g.slice(0,u).join("/")))&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return getOwn(y.pkgs,e)||e}function r(e){isBrowser&&each(scripts(),(function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0}))}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),d=(c=o(e))[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=s&&s.normalize?s.normalize(e,(function(e){return i(e,p,n)})):-1===e.indexOf("!")?i(e,p,n):e:(d=(c=o(h=i(e,p,n)))[0],h=c[1],r=!0,a=q.nameToUrl(h))),{prefix:d,name:h,parentMap:t,unnormalized:!!(u=!d||s||r?"":"_unnormalized"+(A+=1)),url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,(function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))})),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,(function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)})),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,(function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))})),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,(function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1})),o&&a.length)return(e=makeError("timeout","Load timeout for modules: "+a,null,a)).contextName=q.contextName,c(e);d&&each(s,(function(e){f(e,{},{})})),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout((function(){w=0,l()}),50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(null===(e=O.shift())[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,(function(e){this.emit("error",e)}))),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return e.prefix?this.callPlugin():this.load()}))):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((t=this.module)?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,(function(e){a.push(e.normalizedMap||e)})),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,(function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,(function(e){return i(e,h,!0)}))||""),u(o=a(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,(function(e){this.map.normalizedMap=o,this.init([],(function(){return e}),null,{enabled:!0,ignore:!0})}))),void((d=getOwn(S,o.id))&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,(function(e){this.emit("error",e)}))),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,(function(e){this.init([],(function(){return e}),null,{enabled:!0})})),n.error=bind(this,(function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,(function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)})),c(e)})),n.fromText=bind(this,(function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)})),void r.load(e.name,m,n,y))}))),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,(function(e){this.undefed||(this.defineDep(t,e),this.check())}))),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,(function(e){this.emit("error",e)})))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)}))),eachProp(this.pluginMaps,bind(this,(function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)}))),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],(function(e){e(t)})),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(-1===i.indexOf("?")?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,(function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e})),e.bundles&&eachProp(e.bundles,(function(e,t){each(e,(function(e){e!==t&&(R[e]=t)}))})),e.shim&&(eachProp(e.shim,(function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e})),y.shim=i),e.packages&&each(e.packages,(function(e){var i;i=(e="string"==typeof e?{name:e}:e).name,e.location&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(S,(function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))})),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,n){function o(i,r,u){var d,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(d=a(i,t,!1,!0).id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick((function(){v(),(f=s(a(null,t))).skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()})),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,(function(t,i){t[0]===e&&O.splice(i,1)})),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){getOwn(S,e.id)&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(null===(i=O.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,o=(n=e.split("/")).length;o>0;o-=1)if(u=getOwn(r,n.slice(0,o).join("/"))){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s=("/"===(s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js")).charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,(function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,(function(e){if(e.id===t.id)return i.push(r),!0}))})),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(e){if("interactive"===e.readyState)return interactiveScript=e})),interactiveScript}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return(r=req.createNode(n,t,i)).setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(e,i){t.push(i)})),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&((r=currentlyAddingScript||getInteractiveScript())&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(match,singlePrefix){return singlePrefix||""}function isFunction(it){return"[object Function]"===ostring.call(it)}function isArray(it){return"[object Array]"===ostring.call(it)}function each(ary,func){var i;if(ary)for(i=0;i-1&&(!ary[i]||!func(ary[i],i,ary));i-=1);}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return hasProp(obj,prop)&&obj[prop]}function eachProp(obj,func){var prop;for(prop in obj)if(hasProp(obj,prop)&&func(obj[prop],prop))break}function mixin(target,source,force,deepStringMixin){return source&&eachProp(source,(function(value,prop){!force&&hasProp(target,prop)||(!deepStringMixin||"object"!=typeof value||!value||isArray(value)||isFunction(value)||value instanceof RegExp?target[prop]=value:(target[prop]||(target[prop]={}),mixin(target[prop],value,force,deepStringMixin)))})),target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(err){throw err}function getGlobal(value){if(!value)return value;var g=global;return each(value.split("."),(function(part){g=g[part]})),g}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);return e.requireType=id,e.requireModules=requireModules,err&&(e.originalError=err),e}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;return isArray(deps)||"string"==typeof deps||(config=deps,isArray(callback)?(deps=callback,callback=errback,errback=optional):deps=[]),config&&config.context&&(contextName=config.context),(context=getOwn(contexts,contextName))||(context=contexts[contextName]=req.s.newContext(contextName)),config&&context.configure(config),context.require(deps,callback,errback)},req.config=function(config){return req(config)},req.nextTick=void 0!==setTimeout?function(fn){setTimeout(fn,4)}:function(fn){fn()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(prop){req[prop]=function(){var ctx=contexts[defContextName];return ctx.require[prop].apply(ctx,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(config,moduleName,url){var node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return node.type=config.scriptType||"text/javascript",node.charset="utf-8",node.async=!0,node},req.load=function(context,moduleName,url){var node,config=context&&context.config||{};if(isBrowser)return(node=req.createNode(config,moduleName,url)).setAttribute("data-requirecontext",context.contextName),node.setAttribute("data-requiremodule",moduleName),!node.attachEvent||node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0||isOpera?(node.addEventListener("load",context.onScriptLoad,!1),node.addEventListener("error",context.onScriptError,!1)):(useInteractive=!0,node.attachEvent("onreadystatechange",context.onScriptLoad)),node.src=url,config.onNodeCreated&&config.onNodeCreated(node,config,moduleName,url),currentlyAddingScript=node,baseElement?head.insertBefore(node,baseElement):head.appendChild(node),currentlyAddingScript=null,node;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(url),context.completeLoad(moduleName)}catch(e){context.onError(makeError("importscripts","importScripts failed for "+moduleName+" at "+url,e,[moduleName]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(script){if(head||(head=script.parentNode),dataMain=script.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(name,deps,callback){var node,context;"string"!=typeof name&&(callback=deps,deps=name,name=null),isArray(deps)||(callback=deps,deps=null),!deps&&isFunction(callback)&&(deps=[],callback.length&&(callback.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(match,dep){deps.push(dep)})),deps=(1===callback.length?["require"]:["require","exports","module"]).concat(deps))),useInteractive&&(node=currentlyAddingScript||getInteractiveScript())&&(name||(name=node.getAttribute("data-requiremodule")),context=contexts[node.getAttribute("data-requirecontext")]),context?(context.defQueue.push([name,deps,callback]),context.defQueueMap[name]=!0):globalDefQueue.push([name,deps,callback])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},registry={},enabledRegistry={},undefEvents={},defQueue=[],defined={},urlFetched={},bundlesMap={},requireCounter=1,unnormalizedCounter=1;function normalize(name,baseName,applyMap){var mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"];if(name&&(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=baseParts.slice(0,baseParts.length-1).concat(name)),function(ary){var i,part;for(i=0;i0&&(ary.splice(i-1,2),i-=2)}}(name),name=name.join("/")),applyMap&&map&&(baseParts||starMap)){outerLoop:for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=getOwn(map,baseParts.slice(0,j).join("/")))&&(mapValue=getOwn(mapValue,nameSegment))){foundMap=mapValue,foundI=i;break outerLoop}!foundStarMap&&starMap&&getOwn(starMap,nameSegment)&&(foundStarMap=getOwn(starMap,nameSegment),starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return getOwn(config.pkgs,name)||name}function removeScript(name){isBrowser&&each(scripts(),(function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName)return scriptNode.parentNode.removeChild(scriptNode),!0}))}function hasPathFallback(id){var pathConfig=getOwn(config.paths,id);if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1)return pathConfig.shift(),context.require.undef(id),context.makeRequire(null,{skipMap:!0})([id]),!0}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,nameParts,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=!0,normalizedName="";return name||(isDefine=!1,name="_@r"+(requireCounter+=1)),prefix=(nameParts=splitPrefix(name))[0],name=nameParts[1],prefix&&(prefix=normalize(prefix,parentName,applyMap),pluginModule=getOwn(defined,prefix)),name&&(prefix?normalizedName=pluginModule&&pluginModule.normalize?pluginModule.normalize(name,(function(name){return normalize(name,parentName,applyMap)})):-1===name.indexOf("!")?normalize(name,parentName,applyMap):name:(prefix=(nameParts=splitPrefix(normalizedName=normalize(name,parentName,applyMap)))[0],normalizedName=nameParts[1],isNormalized=!0,url=context.nameToUrl(normalizedName))),{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!(suffix=!prefix||pluginModule||isNormalized?"":"_unnormalized"+(unnormalizedCounter+=1)),url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=getOwn(registry,id);return mod||(mod=registry[id]=new context.Module(depMap)),mod}function on(depMap,name,fn){var id=depMap.id,mod=getOwn(registry,id);!hasProp(defined,id)||mod&&!mod.defineEmitComplete?(mod=getModule(depMap)).error&&"error"===name?fn(mod.error):mod.on(name,fn):"defined"===name&&fn(defined[id])}function onError(err,errback){var ids=err.requireModules,notified=!1;errback?errback(err):(each(ids,(function(id){var mod=getOwn(registry,id);mod&&(mod.error=err,mod.events.error&&(notified=!0,mod.emit("error",err)))})),notified||req.onError(err))}function takeGlobalQueue(){globalDefQueue.length&&(each(globalDefQueue,(function(queueItem){var id=queueItem[0];"string"==typeof id&&(context.defQueueMap[id]=!0),defQueue.push(queueItem)})),globalDefQueue=[])}function cleanRegistry(id){delete registry[id],delete enabledRegistry[id]}function breakCycle(mod,traced,processed){var id=mod.map.id;mod.error?mod.emit("error",mod.error):(traced[id]=!0,each(mod.depMaps,(function(depMap,i){var depId=depMap.id,dep=getOwn(registry,depId);!dep||mod.depMatched[i]||processed[depId]||(getOwn(traced,depId)?(mod.defineDep(i,defined[depId]),mod.check()):breakCycle(dep,traced,processed))})),processed[id]=!0)}function checkLoaded(){var err,usingPathFallback,waitInterval=1e3*config.waitSeconds,expired=waitInterval&&context.startTime+waitInterval<(new Date).getTime(),noLoads=[],reqCalls=[],stillLoading=!1,needCycleCheck=!0;if(!inCheckLoaded){if(inCheckLoaded=!0,eachProp(enabledRegistry,(function(mod){var map=mod.map,modId=map.id;if(mod.enabled&&(map.isDefine||reqCalls.push(mod),!mod.error))if(!mod.inited&&expired)hasPathFallback(modId)?(usingPathFallback=!0,stillLoading=!0):(noLoads.push(modId),removeScript(modId));else if(!mod.inited&&mod.fetched&&map.isDefine&&(stillLoading=!0,!map.prefix))return needCycleCheck=!1})),expired&&noLoads.length)return(err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads)).contextName=context.contextName,onError(err);needCycleCheck&&each(reqCalls,(function(mod){breakCycle(mod,{},{})})),expired&&!usingPathFallback||!stillLoading||!isBrowser&&!isWebWorker||checkLoadedTimeoutId||(checkLoadedTimeoutId=setTimeout((function(){checkLoadedTimeoutId=0,checkLoaded()}),50)),inCheckLoaded=!1}}function callGetModule(args){hasProp(defined,args[0])||getModule(makeModuleMap(args[0],null,!0)).init(args[1],args[2])}function removeListener(node,func,name,ieName){node.detachEvent&&!isOpera?ieName&&node.detachEvent(ieName,func):node.removeEventListener(name,func,!1)}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;return removeListener(node,context.onScriptLoad,"load","onreadystatechange"),removeListener(node,context.onScriptError,"error"),{node:node,id:node&&node.getAttribute("data-requiremodule")}}function intakeDefines(){var args;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0])return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]));callGetModule(args)}context.defQueueMap={}}return handlers={require:function(mod){return mod.require?mod.require:mod.require=context.makeRequire(mod.map)},exports:function(mod){if(mod.usingExports=!0,mod.map.isDefine)return mod.exports?defined[mod.map.id]=mod.exports:mod.exports=defined[mod.map.id]={}},module:function(mod){return mod.module?mod.module:mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return getOwn(config.config,mod.map.id)||{}},exports:mod.exports||(mod.exports={})}}},(Module=function(map){this.events=getOwn(undefEvents,map.id)||{},this.map=map,this.shim=getOwn(config.shim,map.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(depMaps,factory,errback,options){options=options||{},this.inited||(this.factory=factory,errback?this.on("error",errback):this.events.error&&(errback=bind(this,(function(err){this.emit("error",err)}))),this.depMaps=depMaps&&depMaps.slice(0),this.errback=errback,this.inited=!0,this.ignore=options.ignore,options.enabled||this.enabled?this.enable():this.check())},defineDep:function(i,depExports){this.depMatched[i]||(this.depMatched[i]=!0,this.depCount-=1,this.depExports[i]=depExports)},fetch:function(){if(!this.fetched){this.fetched=!0,context.startTime=(new Date).getTime();var map=this.map;if(!this.shim)return map.prefix?this.callPlugin():this.load();context.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return map.prefix?this.callPlugin():this.load()})))}},load:function(){var url=this.map.url;urlFetched[url]||(urlFetched[url]=!0,context.load(this.map.id,url))},check:function(){if(this.enabled&&!this.enabling){var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}else exports=context.execCb(id,factory,depExports,exports);if(this.map.isDefine&&void 0===exports&&((cjsModule=this.module)?exports=cjsModule.exports:this.usingExports&&(exports=this.exports)),err)return err.requireMap=this.map,err.requireModules=this.map.isDefine?[this.map.id]:null,err.requireType=this.map.isDefine?"define":"require",onError(this.error=err)}else exports=factory;if(this.exports=exports,this.map.isDefine&&!this.ignore&&(defined[id]=exports,req.onResourceLoad)){var resLoadMaps=[];each(this.depMaps,(function(depMap){resLoadMaps.push(depMap.normalizedMap||depMap)})),req.onResourceLoad(context,this.map,resLoadMaps)}cleanRegistry(id),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(context.defQueueMap,id)||this.fetch()}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix);this.depMaps.push(pluginMap),on(pluginMap,"defined",bind(this,(function(plugin){var load,normalizedMap,normalizedMod,bundleId=getOwn(bundlesMap,this.map.id),name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null,localRequire=context.makeRequire(map.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(plugin.normalize&&(name=plugin.normalize(name,(function(name){return normalize(name,parentName,!0)}))||""),on(normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap),"defined",bind(this,(function(value){this.map.normalizedMap=normalizedMap,this.init([],(function(){return value}),null,{enabled:!0,ignore:!0})}))),void((normalizedMod=getOwn(registry,normalizedMap.id))&&(this.depMaps.push(normalizedMap),this.events.error&&normalizedMod.on("error",bind(this,(function(err){this.emit("error",err)}))),normalizedMod.enable()))):bundleId?(this.map.url=context.nameToUrl(bundleId),void this.load()):((load=bind(this,(function(value){this.init([],(function(){return value}),null,{enabled:!0})}))).error=bind(this,(function(err){this.inited=!0,this.error=err,err.requireModules=[id],eachProp(registry,(function(mod){0===mod.map.id.indexOf(id+"_unnormalized")&&cleanRegistry(mod.map.id)})),onError(err)})),load.fromText=bind(this,(function(text,textAlt){var moduleName=map.name,moduleMap=makeModuleMap(moduleName),hasInteractive=useInteractive;textAlt&&(text=textAlt),hasInteractive&&(useInteractive=!1),getModule(moduleMap),hasProp(config.config,id)&&(config.config[moduleName]=config.config[id]);try{req.exec(text)}catch(e){return onError(makeError("fromtexteval","fromText eval for "+id+" failed: "+e,e,[id]))}hasInteractive&&(useInteractive=!0),this.depMaps.push(moduleMap),context.completeLoad(moduleName),localRequire([moduleName],load)})),void plugin.load(map.name,localRequire,load,config))}))),context.enable(pluginMap,this),this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){enabledRegistry[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(depMap,i){var id,mod,handler;if("string"==typeof depMap){if(depMap=makeModuleMap(depMap,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=depMap,handler=getOwn(handlers,depMap.id))return void(this.depExports[i]=handler(this));this.depCount+=1,on(depMap,"defined",bind(this,(function(depExports){this.undefed||(this.defineDep(i,depExports),this.check())}))),this.errback?on(depMap,"error",bind(this,this.errback)):this.events.error&&on(depMap,"error",bind(this,(function(err){this.emit("error",err)})))}id=depMap.id,mod=registry[id],hasProp(handlers,id)||!mod||mod.enabled||context.enable(depMap,this)}))),eachProp(this.pluginMaps,bind(this,(function(pluginMap){var mod=getOwn(registry,pluginMap.id);mod&&!mod.enabled&&context.enable(pluginMap,this)}))),this.enabling=!1,this.check()},on:function(name,cb){var cbs=this.events[name];cbs||(cbs=this.events[name]=[]),cbs.push(cb)},emit:function(name,evt){each(this.events[name],(function(cb){cb(evt)})),"error"===name&&delete this.events[name]}},context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,defQueue:defQueue,defQueueMap:{},Module:Module,makeModuleMap:makeModuleMap,nextTick:req.nextTick,onError:onError,configure:function(cfg){if(cfg.baseUrl&&"/"!==cfg.baseUrl.charAt(cfg.baseUrl.length-1)&&(cfg.baseUrl+="/"),"string"==typeof cfg.urlArgs){var urlArgs=cfg.urlArgs;cfg.urlArgs=function(id,url){return(-1===url.indexOf("?")?"?":"&")+urlArgs}}var shim=config.shim,objs={paths:!0,bundles:!0,config:!0,map:!0};eachProp(cfg,(function(value,prop){objs[prop]?(config[prop]||(config[prop]={}),mixin(config[prop],value,!0,!0)):config[prop]=value})),cfg.bundles&&eachProp(cfg.bundles,(function(value,prop){each(value,(function(v){v!==prop&&(bundlesMap[v]=prop)}))})),cfg.shim&&(eachProp(cfg.shim,(function(value,id){isArray(value)&&(value={deps:value}),!value.exports&&!value.init||value.exportsFn||(value.exportsFn=context.makeShimExports(value)),shim[id]=value})),config.shim=shim),cfg.packages&&each(cfg.packages,(function(pkgObj){var name;name=(pkgObj="string"==typeof pkgObj?{name:pkgObj}:pkgObj).name,pkgObj.location&&(config.paths[name]=pkgObj.location),config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(registry,(function(mod,id){mod.inited||mod.map.unnormalized||(mod.map=makeModuleMap(id,null,!0))})),(cfg.deps||cfg.callback)&&context.require(cfg.deps||[],cfg.callback)},makeShimExports:function(value){return function(){var ret;return value.init&&(ret=value.init.apply(global,arguments)),ret||value.exports&&getGlobal(value.exports)}},makeRequire:function(relMap,options){function localRequire(deps,callback,errback){var id,requireMod;return options.enableBuildCallback&&callback&&isFunction(callback)&&(callback.__requireJsBuild=!0),"string"==typeof deps?isFunction(callback)?onError(makeError("requireargs","Invalid require call"),errback):relMap&&hasProp(handlers,deps)?handlers[deps](registry[relMap.id]):req.get?req.get(context,deps,relMap,localRequire):(id=makeModuleMap(deps,relMap,!1,!0).id,hasProp(defined,id)?defined[id]:onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName+(relMap?"":". Use require([])")))):(intakeDefines(),context.nextTick((function(){intakeDefines(),(requireMod=getModule(makeModuleMap(null,relMap))).skipMap=options.skipMap,requireMod.init(deps,callback,errback,{enabled:!0}),checkLoaded()})),localRequire)}return options=options||{},mixin(localRequire,{isBrowser:isBrowser,toUrl:function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0];return-1!==index&&(!("."===segment||".."===segment)||index>1)&&(ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length),moduleNamePlusExt=moduleNamePlusExt.substring(0,index)),context.nameToUrl(normalize(moduleNamePlusExt,relMap&&relMap.id,!0),ext,!0)},defined:function(id){return hasProp(defined,makeModuleMap(id,relMap,!1,!0).id)},specified:function(id){return id=makeModuleMap(id,relMap,!1,!0).id,hasProp(defined,id)||hasProp(registry,id)}}),relMap||(localRequire.undef=function(id){takeGlobalQueue();var map=makeModuleMap(id,relMap,!0),mod=getOwn(registry,id);mod.undefed=!0,removeScript(id),delete defined[id],delete urlFetched[map.url],delete undefEvents[id],eachReverse(defQueue,(function(args,i){args[0]===id&&defQueue.splice(i,1)})),delete context.defQueueMap[id],mod&&(mod.events.defined&&(undefEvents[id]=mod.events),cleanRegistry(id))}),localRequire},enable:function(depMap){getOwn(registry,depMap.id)&&getModule(depMap).enable()},completeLoad:function(moduleName){var found,args,mod,shim=getOwn(config.shim,moduleName)||{},shExports=shim.exports;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0]){if(args[0]=moduleName,found)break;found=!0}else args[0]===moduleName&&(found=!0);callGetModule(args)}if(context.defQueueMap={},mod=getOwn(registry,moduleName),!found&&!hasProp(defined,moduleName)&&mod&&!mod.inited){if(!(!config.enforceDefine||shExports&&getGlobal(shExports)))return hasPathFallback(moduleName)?void 0:onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]));callGetModule([moduleName,shim.deps||[],shim.exportsFn])}checkLoaded()},nameToUrl:function(moduleName,ext,skipExt){var paths,syms,i,url,parentPath,bundleId,pkgMain=getOwn(config.pkgs,moduleName);if(pkgMain&&(moduleName=pkgMain),bundleId=getOwn(bundlesMap,moduleName))return context.nameToUrl(bundleId,ext,skipExt);if(req.jsExtRegExp.test(moduleName))url=moduleName+(ext||"");else{for(paths=config.paths,i=(syms=moduleName.split("/")).length;i>0;i-=1)if(parentPath=getOwn(paths,syms.slice(0,i).join("/"))){isArray(parentPath)&&(parentPath=parentPath[0]),syms.splice(0,i,parentPath);break}url=syms.join("/"),url=("/"===(url+=ext||(/^data\:|^blob\:|\?/.test(url)||skipExt?"":".js")).charAt(0)||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs&&!/^blob\:/.test(url)?url+config.urlArgs(moduleName,url):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if("load"===evt.type||readyRegExp.test((evt.currentTarget||evt.srcElement).readyState)){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){var parents=[];return eachProp(registry,(function(value,key){0!==key.indexOf("_@r")&&each(value.depMaps,(function(depMap){if(depMap.id===data.id)return parents.push(key),!0}))})),onError(makeError("scripterror",'Script error for "'+data.id+(parents.length?'", needed by: '+parents.join(", "):'"'),evt,[data.id]))}}},context.require=context.makeRequire(),context}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(script){if("interactive"===script.readyState)return interactiveScript=script})),interactiveScript}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if("function"!=typeof n)throw new TypeError("Expected a function");return setTimeout((function(){n.apply(Z,r)}),t)}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!=n&&t!=t:function(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),l=(f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,"[object Object]"==f);c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,(function(t){return t[0]==n})),s=An(o,(function(n){return n[0]==t}));if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=function(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return!1;c=-1;for(var f=!0,a=2&r?[]:Z;++ct&&(t=-t>u?0:u+t),0>(r=r>u?u:r)&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++er?jn(e+r,0):r:0)||0)-1;for(var u=t==t;++rarguments.length,mn)}function G(n,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!=n&&t!=t}function M(n){var t;return(t=null!=n)&&(t="number"==typeof(t=n.length)&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&("[object Function]"==(n=hn.call(n))||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&"object"==typeof n}function K(n){return"number"==typeof n||H(n)&&"[object Number]"==hn.call(n)}function L(n){return"string"==typeof n||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return"string"==typeof n?n:null==n?"":n+""}function W(n){return null==n?[]:function(n,t){return j(t,(function(t){return n[t]}))}(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return mn(o,(function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})})),n}var Z,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un="object"==typeof self&&self&&self.Object===Object&&self,on="object"==typeof global&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un="object"==typeof exports&&exports&&!exports.nodeType&&exports)&&"object"==typeof module&&module&&!module.nodeType&&module,fn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;var mn=function(n){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=-1,i=Object(r);++o(r=null==r?0:Fn(r))&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&renable_solitairey_ui;return function(){const active={name:"freecell",game:null},yui=YUI({base:"js/yui-unpack/yui/build/"});let Y;const games={agnes:"Agnes",klondike:"Klondike",klondike1t:"Klondike1T","flower-garden":"FlowerGarden","forty-thieves":"FortyThieves",freecell:"Freecell",golf:"Golf","grandfathers-clock":"GClock","monte-carlo":"MonteCarlo",pyramid:"Pyramid","russian-solitaire":"RussianSolitaire",scorpion:"Scorpion",spider:"Spider",spider1s:"Spider1S",spider2s:"Spider2S",spiderette:"Spiderette","tri-towers":"TriTowers","will-o-the-wisp":"WillOTheWisp",yukon:"Yukon"},extensions=["auto-turnover","statistics","solitaire-autoplay","solitaire"],Fade=function(){let body,el=null;const css={position:"absolute",display:"none",backgroundColor:"#000",opacity:.7,top:0,left:0,width:0,height:0,zIndex:1e3},element=function(){return null===el&&(el=Y.Node.create("
"),el.setStyles(css),body=Y.one(".solitairey_body").append(el)),el};return{show:function(){const el=element();css.display="block",css.width=el.get("winWidth"),css.height=el.get("winHeight"),el.setStyles(css)},hide:function(){css.display="none",element().setStyles(css)}}}();function switchToGame(name){active.name=name,active.game=Y.Solitaire[games[name]]}function playGame(name){switchToGame(name),enable_cookies()&&$.jStorage.set("FossSolitairey_options",name),newGame()}const GameChooser={selected:null,fade:!1,init:function(){this.refit()},refit:function(){const node=Y.one("#game-chooser");if(!node)return;const height=node.get("winHeight");node.setStyle("min-height",height)},show:function(fade){this.selected||this.select(active.name),fade&&(Fade.show(),this.fade=!0),Y.one("#game-chooser").addClass("show"),Y.one(".solitairey_body").addClass("scrollable")},hide:function(){this.fade&&Fade.hide(),Y.one("#game-chooser").removeClass("show"),Y.fire("gamechooser:hide",this),Y.one(".solitairey_body").removeClass("scrollable")},choose:function(){this.selected&&(this.hide(),playGame(this.selected))},select:function(game){const node=Y.one("#"+game+"> div"),previous=this.selected;previous!==game&&this.unSelect(),node&&(this.selected=game,new Y.Node(document.getElementById(game)).addClass("selected")),previous&&previous!==game&&Y.fire("gamechooser:select",this)},unSelect:function(){this.selected&&(new Y.Node(document.getElementById(this.selected)).removeClass("selected"),this.selected=null)}};const Themes={dondorf:{sizes:[61,79,95,122],61:{hiddenRankHeight:7,rankHeight:25,dimensions:[61,95]},79:{hiddenRankHeight:10,rankHeight:32,dimensions:[79,123]},95:{hiddenRankHeight:12,rankHeight:38,dimensions:[95,148]},122:{hiddenRankHeight:15,rankHeight:48,dimensions:[122,190]}},load:function(name){name in this||(name="dondorf"),Y.Solitaire.Card.base.theme!==name&&this.set(name,122)},set:function(name,size){const theme=this[name][size];Y.mix(Y.Solitaire.Card.base,{theme:name+"/"+size,hiddenRankHeight:theme.hiddenRankHeight,rankHeight:theme.rankHeight,width:theme.dimensions[0],height:theme.dimensions[1]},!0)}};function attachEvents(){if(Y.on("newAppGame",(function(){return newGame()})),enable_solitairey_ui&&(Y.on("click",restart,Y.one("#restart")),Y.on("click",(function(){GameChooser.show(!1)}),Y.one("#choose_game")),Y.on("click",newGame,Y.one("#new_deal")),Y.on("click",(function(){GameChooser.hide()}),Y.one("#close-chooser")),Y.on("click",(function(){active.game.undo()}),Y.one("#undo"))),enable_solitairey_ui){Y.on("click",(function(){const chromestore=Y.one(".chromestore");chromestore&&chromestore.addClass("hidden"),enable_cookies()&&$.jStorage.set("FossSolitairey_disable-chromestore-link",!0)}),Y.one(".chromestore")),Y.delegate("click",(function(e){GameChooser.select(e.currentTarget._node.id),GameChooser.choose()}),"#descriptions","li")}Y.one("document").on("keydown",(function(e){27===e.keyCode&&GameChooser.hide()})),Y.on("afterSetup",(function(){active.game.stationary((function(){resize()}))})),function(){let timer,attachEvent;window.addEventListener?attachEvent="addEventListener":window.attachEvent&&(attachEvent="attachEvent"),window[attachEvent](Y.Solitaire.Application.resizeEvent,(function(){clearTimeout(timer),timer=setTimeout(resize,250)}),!1)}()}const Preloader={loadingCount:0,loaded:function(callback){if(this.loadingCount)setTimeout(function(){this.loaded(callback)}.bind(this),100);else{const loading=Y.one(".loading");loading&&loading.addClass("hidden"),callback(),Fade.hide()}},load:function(path){const image=new Image;image.onload=function(){--this.loadingCount}.bind(this),image.src=path,this.loadingCount++},preload:function(){const that=this;const icons=["agnes","flower-garden","forty-thieves","freecell","gclock","golf","klondike1t","klondike","montecarlo","pyramid","scorpion","spider1s","spider2s","spiderette","spider","tritowers","will-o-the-wisp","yukon"];["s","h","c","d"].forEach((function(suit){for(let rank=1;rank<=13;++rank)that.load(Y.Solitaire.Card.base.theme+"/"+suit+rank+".png")})),this.load(Y.Solitaire.Card.base.theme+"/facedown.png"),enable_solitairey_ui&&icons.forEach((function(image){that.load("layouts/mini/"+image+".png")})),Fade.show();const loading=Y.one(".loading");loading&&loading.removeClass("hidden")}};function _my_load_func(){const save=!!enable_cookies()&&$.jStorage.get("FossSolitairey_saved-game");attachEvents(),function(){if(enable_cookies()){const options=$.jStorage.get("FossSolitairey_options");options&&(active.name=options)}Themes.load("dondorf")}(),Preloader.preload(),Preloader.loaded((function(){save?(clearDOM(),active.game=Y.Solitaire[games[active.name]],active.game.loadGame(save)):enable_solitairey_ui&&playGame(active.name)})),GameChooser.init(),schedule_cb&&schedule_cb(Y)}function resize(){const game=active.game,el=game.container(),padding=Y.Solitaire.padding,offset=Y.Solitaire.offset,width=el.get("winWidth")-padding.x,height=el.get("winHeight")-padding.y;Y.Solitaire.Application.windowHeight=height;const ratio=Math.min((width-offset.left)/game.width(),(height-offset.top)/game.height());active.game.resize(ratio),GameChooser.refit()}function clearDOM(){Y.all(".stack, .card").remove()}function restart(){if(enable_cookies()){const init=Y.Cookie.get("FossSolitairey_initial-game");if(init){clearDOM();const game=active.game;game.cleanup(),game.loadGame(init),game.save()}}}function clearGame(){const game=active.game;clearDOM(),game.cleanup()}function newGame(){clearGame(),active.game.newGame()}newGameRun=function(){playGame("freecell")},schedule=function(cb){schedule_cb=cb},yui.use.apply(yui,function(){const modules=extensions.slice();for(const m in games)games.hasOwnProperty(m)&&modules.unshift(m);return modules}().concat((function(YUI){Y=YUI,Y.on("newGameRun",newGameRun),Y.Solitaire.Application={windowHeight:0,resizeEvent:"resize",GameChooser:GameChooser,newGame:newGame,clearDOM:clearGame,switchToGame:switchToGame},Y.on("domready",_my_load_func)}))),window.setTimeout((function(){yui.use.apply(yui,["solver-freecell"])}),400)}(),{schedule:schedule,newGameRun:newGameRun,setUI:v=>{enable_solitairey_ui=v}}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-stack-clear",(function(Y){const Solitaire=Y.Solitaire;function clearComplete(stack,startIndex){const cards=stack.cards;let count=cards.length-startIndex;const foundation=Y.Array.find(Solitaire.game.foundation.stacks,(function(stack){return!stack.cards.length}));Solitaire.stationary((function(){for(;count;)_.last(cards).moveTo(foundation),count--})),stack.updateCardsPosition()}Y.namespace("Solitaire.AutoStackClear"),Solitaire.AutoStackClear.register=function(){Y.on("solitaire|tableau:afterPush",(function(stack){!function(stack,callback){const cards=stack.cards;let rank,suit,card,i;if(!cards.length)return!1;for(i=cards.length-1,rank=1,suit=cards[i].suit;i>=0&&rank<14;i--,rank++)if(card=cards[i],card.isFaceDown||card.rank!==rank||card.suit!==suit)return!1;const complete=14===rank;complete&&"function"==typeof callback&&callback(stack,i+1)}(stack,clearComplete)}))}}),"0.0.1",{requires:["solitaire"]}),{auto_stack:!0}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-turnover",(function(Y){Y.on("tableau:afterPop",(function(stack){stack.cards.forEach((function(card){card&&card.isFaceDown&&card.isFree()&&card.faceUp()}))}))}),"0.0.1",{requires:["solitaire"]}),{}})),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-autoplay",(function(Y){Y.namespace("Solitaire.Autoplay");const Solitaire=Y.Solitaire,Autoplay=Solitaire.Autoplay;let whenWon=!0,autoPlayInterval=null;const autoPlayable=["Klondike","Klondike1T","FortyThieves","GClock","Freecell","FlowerGarden","Yukon"];function autoPlay(){let played=!1;Solitaire.game.eachStack((function(stack){const field=stack.field;played||"foundation"===field||"deck"===field||(played=!stack.eachCard((function(card){return!card.autoPlay()})))}))}Y.on("endTurn",(function(){whenWon&&-1!==autoPlayable.indexOf(Solitaire.game.name())&&null===autoPlayInterval&&function(){let stop=!1;return Solitaire.game.eachStack((function(stack){const field=stack.field;let prevRank=14;stop||"tableau"!==field&&"waste"!==field||stack.eachCard((function(card){if(card.rank>prevRank||card.isFaceDown)return stop=!0,!1;prevRank=card.rank}))})),!stop}()&&Y.fire("autoPlay")})),Y.on("win",(function(){clearInterval(autoPlayInterval),autoPlayInterval=null})),Y.on("autoPlay",(function(){autoPlayInterval=setInterval(autoPlay,130)})),Y.mix(Autoplay,{enable:function(){whenWon=!0},disable:function(){whenWon=!1}})}),"0.0.1",{requires:["solitaire"]}),{}})),YUI.add("flower-garden",(function(Y){const Solitaire=Y.Solitaire,FlowerGarden=Y.Solitaire.FlowerGarden=Solitaire.instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,i,stack=0;const stacks=this.tableau.stacks;for(deck=this.deck,reserve=this.reserve.stacks[0],i=0;i<36;i++)card=deck.pop(),stacks[stack].push(card.faceUp()),stack++,6===stack&&(stack=0);for(;card=deck.pop();)card.faceUp(),reserve.push(card)},height:function(){return 5.5*this.Card.base.height},maxStackHeight:function(){return 4.4*this.Card.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 4.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:1,layout:{hspacing:1.25,top:function(){return 4.5*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:6,layout:{hspacing:1.25,top:function(){return 1.25*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{rankHeight:24,createProxyStack:function(){let stack;switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this);case"reserve":stack=Solitaire.instance(this.stack),stack.cards=[this],this.proxyStack=stack}return this.proxyStack},moveTo:function(stack){const cards=this.stack.cards,index=cards.indexOf(this);let i,len;for(Solitaire.Card.moveTo.call(this,stack),cards.splice(index,0,null),i=index+1,len=cards.length;istop&&i;i--)deck.my_Last().faceUp().moveTo(waste)},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 3*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck",init:function(){Solitaire.Deck.init.call(this),this.cards.forEach((function(c){c.faceDown()}))},createStack:function(){for(let i=this.cards.length-1;i>=0;i--)this.stacks[0].push(this.cards[i])}}),Waste:{stackConfig:{total:1,layout:{hspacing:0,top:0,left:function(){return 1.25*Solitaire.Card.width}}},field:"waste",draggable:!0},Tableau:{stackConfig:{total:10,layout:{hspacing:1.31,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.suit===this.suit&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});FortyThieves.fields.forEach((function(field){FortyThieves[field].Stack=Solitaire.instance(FortyThieves.Stack)})),Y.mix(FortyThieves.Stack,{cssClass:"freestack",validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(FortyThieves.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(FortyThieves.Deck.Stack,{createDOMElement:function(){Solitaire.Stack.createDOMElement.call(this),this.node.on("click",Solitaire.Events.clickEmptyDeck)}},!0),FortyThieves.Foundation.Stack.cssClass="freefoundation"}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){const instance=solitaire.instance;return YUI.add("freecell",(function(Y){const Solitaire=Y.Solitaire,Freecell=Y.Solitaire.Freecell=instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,stack=0;const stacks=this.tableau.stacks;for(;card=this.deck.pop();)stacks[stack].push(card.faceUp()),stack++,8===stack&&(stack=0)},openSlots:function(exclude){let total=1,freeTableaus=0;const rStacks=this.reserve.stacks,tStacks=this.tableau.stacks;for(let i=0;i<4;i++)rStacks[i].my_Last()||++total;for(let i=0;i<8;i++){const stack=tStacks[i];exclude!==stack&&!stack.my_Last()&&++freeTableaus}return total*Math.pow(2,freeTableaus)},Stack:instance(Solitaire.Stack),height:function(){return 5*this.Card.base.height},Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 6*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:0}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:instance(Solitaire.Card,{playable:function(){switch(this.stack.field){case"reserve":return!0;case"tableau":return this.createProxyStack();case"foundation":return!1}},createProxyStack:function(){const stack=Solitaire.Card.createProxyStack.call(this);return this.proxyStack=stack&&stack.cards.length<=Freecell.openSlots(stack)?stack:null,this.proxyStack},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return!target||target.color!==this.color&&target.rank===this.rank+1;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;case"reserve":return!target}}})});Freecell.fields.forEach((function(field){Freecell[field].Stack=instance(Freecell.Stack)})),Y.mix(Freecell.Stack,{validTarget:function(stack){return!("tableau"!==stack.field||!this.first().validTarget(stack))&&this.cards.length<=Freecell.openSlots(stack)}},!0),Y.mix(Freecell.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),{instance:instance}})),YUI.add("golf",(function(Y){const Solitaire=Y.Solitaire,Golf=Y.Solitaire.Golf=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],deal:function(){let card,stack,row;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(row=0;row<5;row++)for(stack=0;stack<7;stack++)card=deck.pop().faceUp(),stacks[stack].push(card);card=deck.pop().faceUp(),foundation.push(card),deck.createStack()},turnOver:function(){const deck=this.deck.stacks[0],foundation=this.foundation.stacks[0],last=deck.my_Last();last&&last.faceUp().moveTo(foundation)},isWon:function(){let won=!0;return this.eachStack((function(stack){stack.eachCard((function(card){return card&&(won=!1),won}))}),"tableau"),won},height:function(){return 4*this.Card.base.height},Deck:Solitaire.instance(Solitaire.Deck,{field:"deck",stackConfig:{total:1,layout:{hspacing:0,top:function(){return 3*Solitaire.Card.height},left:0}},createStack:function(){let i,len;for(i=0,len=this.cards.length;i=0;){for(card=cards[i],found=!1,rank=2;rank<=13;rank++)if(card.rank===rank&&card.suit===wrap(suits,rank)){found=!0,cards.splice(i,1),clock[rank-2]=card.faceUp();break}found||(stacks[stack].push(card.faceUp()),stack=(stack+1)%8),i--}for(i=0;i<12;i++)foundations[(i+2)%12].push(clock[i])},height:function(){return 6.7*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:12,layout:{hspacing:1.25,top:function(){return 3*Solitaire.Card.height},left:function(){return 3.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 7.25*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{createProxyStack:function(){switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this)}return this.proxyStack},validTarget:function(stack){const target=stack.my_Last();let rank,hour;switch(stack.field){case"tableau":return!target||target.rank===this.rank+1;case"foundation":return hour=(stack.index()+3)%12,rank=target.rank,target.suit===this.suit&&(target.rank+1)%13==this.rank%13&&(low=stack.first().rank,high=hour,value=this.rank,low<=high?low<=value&&value<=high:low<=value||value<=high);default:return!1}var low,high,value}})});function normalize(valOrFunction){const val="function"==typeof valOrFunction?valOrFunction():valOrFunction;return isNaN(val)?void 0:val}GClock.fields.forEach((function(field){GClock[field].Stack=Solitaire.instance(GClock.Stack)})),Y.mix(GClock.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(GClock.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(GClock.Foundation.Stack,{index:function(){return GClock.foundation.stacks.indexOf(this)},layout:function(layout,i){const top=Math.sin(Math.PI*i/6)*Solitaire.Card.height*2.25,left=Math.cos(Math.PI*i/6)*Solitaire.Card.width*3;this.top=top+normalize(layout.top),this.left=left+normalize(layout.left)}},!0)}),"0.0.1",{requires:["solitaire"]}),YUI.add("solitaire-background-fix",(function(Y){let _body;function resize(){const width=body().get("winWidth"),height=body().get("winHeight"),style=document.body.style;Y.UA.mobile||body().setStyles({width:width,height:height}),void 0===style.backgroundSize&&void 0===style.MozBackgroundSize&&body().setStyles({backgroundImage:"url(greentiled.jpg)",backgroundRepeat:"repeat"})}function body(){return _body||(_body=new Y.Node(document.body)),_body}Y.on("load",resize),Y.on("resize",resize)}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-ios",(function(Y){if(Y.UA.ios){var setCardPosition,Solitaire=Y.Solitaire,_scale=Solitaire.scale,BARE_LAYOUT={hspacing:0,vspacing:0,left:0,top:0},DEFAULTS={scale:1,offset:60,maxStackHeight:155},OPTIONS={Agnes:{offset:[null,5],maxStackHeight:260},FlowerGarden:{offset:[-60,5],maxStackHeight:235},Freecell:{scale:[1,.93],offset:[35,5]},Golf:{scale:[1.1,1],offset:[45,8]},GClock:{scale:.93,offset:5,maxStackHeight:130},Klondike:{offset:[null,5],maxStackHeight:[null,340]},MonteCarlo:{scale:[.88,1],offset:[80,15]},Pyramid:{offset:20},Scorpion:{offset:5,maxStackHeight:[235,380]},Spider:{scale:[1.13,.79],offset:[5,2],maxStackHeight:[160,340]},TriTowers:{scale:.9,offset:10},Yukon:{scale:[.95,1],offset:[50,5],maxStackHeight:[235,390]}},gameOverrides={Agnes:function(){var hspacing={hspacing:1.13};fieldLayout(this,"Reserve",Y.merge(hspacing,{top:60})),fieldLayout(this,"Tableau",Y.merge(hspacing,{top:145})),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:135}))},FlowerGarden:[function(){this.Card.rankHeight=15,fieldLayout(this,"Reserve",{top:0,left:70}),fieldLayout(this,"Foundation",{top:0,left:470,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{top:0,left:140}),Y.mix(this.Reserve.Stack,{setCardPosition:function(card){var last=_.last(this.cards),top=last?last.top+11:this.top,left=this.left;card.left=left,card.top=top},update:Solitaire.noop},!0)},(setCardPosition=Solitaire.FlowerGarden.Reserve.Stack.setCardPosition,function(){fieldLayout(this,"Tableau",{left:10,top:120}),fieldLayout(this,"Reserve",{left:17,top:60}),fieldLayout(this,"Foundation",{left:55,top:0,hspacing:1.5,vspacing:0}),Y.mix(this.Reserve.Stack,{setCardPosition:setCardPosition,update:Solitaire.noop},!0)})],Freecell:[originalLayout("Freecell",["Foundation","Reserve","Tableau"]),function(){var hspacing={hspacing:1.05};fieldLayout(this,"Tableau",hspacing),fieldLayout(this,"Reserve",hspacing),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:157}))}],Golf:[originalLayout("Golf",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{hspacing:1.1}),fieldLayout(this,"Foundation",{left:132})}],GClock:function(){fieldLayout(this,"Foundation",{left:143}),fieldLayout(this,"Tableau",{left:0,top:250,hspacing:1.05})},Klondike:[function(){originalLayout("Klondike","Foundation").call(this),originalLayout("Klondike","Tableau").call(this)},function(){Y.mix(this.Foundation.stackConfig.layout,{left:135,hspacing:1.13},!0),Y.mix(this.Tableau.stackConfig.layout,{hspacing:1.13},!0)}],MonteCarlo:function(){fieldLayout(this,"Tableau",{cardGap:1.1,vspacing:1.05})},Pyramid:[function(){var deck=originalLayout("Pyramid","Deck"),waste=originalLayout("Pyramid","Waste");return function(){deck.call(this),waste.call(this),Y.mix(this.Tableau.stackConfig.layout,{left:190,cardGap:1.1,hspacing:-.55},!0)}}(),function(){Y.mix(this.Deck.stackConfig.layout,{left:-10,top:300},!0),Y.mix(this.Waste.stackConfig.layout,{top:300},!0),Y.mix(this.Tableau.stackConfig.layout,{left:120,cardGap:1.1,hspacing:-.55},!0)}],Scorpion:[function(){fieldLayout(this,"Deck",{top:0,left:0}),fieldLayout(this,"Foundation",{top:0,left:420,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{left:60,top:0,hspacing:1.13})},function(){fieldLayout(this,"Deck",{left:10,top:0}),fieldLayout(this,"Foundation",{left:75,top:0,hspacing:1.5,vspacing:0}),fieldLayout(this,"Tableau",{left:0,top:60,hspacing:1.13})}],Spider:[function(){fieldLayout(this,"Foundation",{left:94,hspacing:1.05}),fieldLayout(this,"Tableau",{top:65,hspacing:1.05})},function(){fieldLayout(this,"Foundation",{left:62,hspacing:1}),fieldLayout(this,"Tableau",{hspacing:1})}],TriTowers:function(){Y.mix(this.Tableau.stackConfig.layout,{hspacing:-.5,rowGaps:[3,2,1,0],cardGap:1},!0)},RussianSolitaire:[originalLayout("RussianSolitaire",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}],Yukon:[originalLayout("Yukon",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}]};OPTIONS.FortyThieves=OPTIONS.Spider1S=OPTIONS.Spider2S=OPTIONS.Spider,gameOverrides.FortyThieves=gameOverrides.Spider1S=gameOverrides.Spider2S=gameOverrides.Spider,OPTIONS.WillOTheWisp=OPTIONS.Spiderette=OPTIONS.Klondike1T=OPTIONS.Klondike,gameOverrides.WillOTheWisp=gameOverrides.Spiderette=gameOverrides.Klondike1T=gameOverrides.Klondike,OPTIONS.RussianSolitaire=OPTIONS.Yukon,Y.mix(Y.DD.DDM,{useHash:!1,_pg_activate:Solitaire.noop,_pg_size:function(){this.activeDrag&&this._pg.setStyles({width:"100%",height:"100%"})}},!0),Y.DD.DDM.set("throttleTime",40),Y.mix(Y.DD.Drop.prototype,{_activateShim:function(){var DDM=Y.DD.DDM;return!!DDM.activeDrag&&(this.get("node")!==DDM.activeDrag.get("node")&&(!this.get("lock")&&void(this.inGroup(DDM.activeDrag.get("groups"))?(DDM._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get("node")),this.sizeShim()):DDM._removeValid(this))))},_deactivateShim:function(){this.overTarget=!1}},!0),Solitaire.Statistics.winDisplay=function(){alert("You win!")},Solitaire.scale=Solitaire.noop,Solitaire.Card.ghost=!1,Solitaire.Animation.animate=!1,Solitaire.Card.base={theme:"mobile",hiddenRankHeight:3,rankHeight:15,width:40,height:50},Y.on("beforeSetup",setLayout),Y.on("beforeResize",setLayout),Y.on("afterResize",scrollToTop),Y.on("load",scrollToTop),Y.on("touchstart",(function(e){e.target._node===document.body&&e.preventDefault()}),document),Y.on("touchmove",(function(e){e.target.test("#descriptions *")||e.preventDefault()}),document),Y.on("domready",(function(){var undo,cancel,showMenu,menu,body,nav,fb,index,closeMenu=function(){menu.removeClass("show")};(index=0,{deleteSelector:function(selector){var rules,idx,ss=document.styleSheets[index];ss&&-1!==(idx=(rules=Array.prototype.splice.call(ss.rules,0)).indexOf(rules.filter((function(rule){return rule.selectorText===selector}))[0]))&&ss.deleteRule(idx)}}).deleteSelector("#menu li:hover"),menu=Y.one("#menu"),body=Y.one("body"),undo=Y.one("#undo"),fb=Y.one("#social"),nav=Y.Node.create("
"),stack=this.proxyStack;if(stack)node.setStyles({opacity:1,top:-this.top,left:-this.left}),this.proxyCards().forEach((function(c){c.proxyStack=stack,node.append(c.node)}));else{if(!this.ghost)return null;node.setStyles({opacity:.6,top:-this.top,left:-this.left}).append(this.node.cloneNode(!0))}return node},updatePosition:function(fields){if(!this.node)return;const to={left:this.left+"px",top:this.top+"px",zIndex:this.zIndex},origin=this.origin;this.positioned||this.node.setStyles({left:normalize(origin.left),top:normalize(origin.top)}),Y.Solitaire.Animation.init(this,to,fields)},pushPosition:function(){const index=this.index>=0?this.index:this.stack.cards.indexOf(this);Solitaire.pushMove({card:this,index:index,from:this.stack})},moveTo:function(stack){const origin=this.stack;return this.pushPosition(),origin.deleteItem(this),stack.push(this),Y.fire(origin.field+":afterPop",origin),this},after:function(callback){this.callback=callback},runCallback:function(){this.callback&&(this.callback.call(this),this.callback=null)}},Y.Solitaire.Stack={cards:null,node:null,images:{tableau:"freeslot.png",deck:"freeslot.png",reserve:"freeslot.png",foundation:"freeslot.png"},serialize:function(){let i,len,card,bite;const cards=this.cards,serialized=[],suits=Game.deck.suits;for(i=0,len=cards.length;i>2&15,deck.suits[3&value]),64&value?card.faceDown(!0):card.faceUp(!0)),card})),this.update()},imageSrc:function(){const basename=this.images[this.field];return basename?Solitaire.Card.base.theme+"/"+basename:"trans.gif"},layout:function(layout){const hoffset=layout.hoffset*Y.Solitaire.Card.width,voffset=layout.voffset*Y.Solitaire.Card.height,gameOffset=Solitaire.offset,self=this;["top","left"].forEach((function(p){self[p]=normalize(layout[p])})),this.left+=hoffset+gameOffset.left,this.top+=voffset+gameOffset.top},deleteItem:function(card){_deleteItem(this.cards,card)},push:function(card,temp){const last=this.my_Last(),to=this.field,from=card.stack?card.stack.field:"deck";last?card.zIndex=last.zIndex+1:"deck"===to||"foundation"===to?card.zIndex=200:"deck"===from&&(card.zIndex=Game.Card.zIndex),temp||(card.stack=this,this.setCardPosition(card),card.truncatePosition(),card.ensureDOM()),this.cards.push(card),temp||card.updatePosition({from:from,to:to})},pushStack:function(proxy){const origin=Solitaire.activeCard.stack,stack=this;origin.eachCard((function(card,i){card.index=i})),Game.stationary((function(){proxy.eachCard((function(card){card.moveTo(stack),card.index=-1})),origin.eachCard((function(card){card.index=-1}))})),origin.updateCardsPosition(),origin.update(),Y.fire(stack.field+":afterPush",stack)},adjustRankHeight:function(){const cards=this.cards,last=this.my_Last(),max=Game.maxStackHeight();let sumRankHeights,i,len,sumHidden=0,sumVisible=0,height=0,countHidden=0,countVisible=0;const Card=Solitaire.Card;if(cards.length<=1)return;for(i=0,len=cards.length-1;i").setAttribute("src",this.imageSrc()).setData("target",this).plug(Y.Plugin.Drop,{useShim:!0});this.updateStyle(),Solitaire.container().append(node)},cleanup:function(){const n=this.node;n&&n.clearData().destroy(!0),this.eachCard((function(c){c.destroyNode()}))},updateDragGroups:function(){const active=Solitaire.activeCard,last=this.my_Last();this.eachCard((function(c){c.node.drop.removeFromGroup("open")})),active.validTarget(this)?(last&&last.node.drop.addToGroup("open"),this.node.drop.addToGroup("open")):this.node.drop.removeFromGroup("open")},validCard:function(){return!0},validProxy:function(card){return card&&card.validTarget(this)&&this.validCard(card)},update:function(){}},Y.Solitaire.Animation={animate:!0,dealing:!1,duration:.5,interval:20,queue:new Y.AsyncQueue,init:function(card,to,fields){if(!this.animate)return card.node.setStyles(to),card.positioned=!0,void setTimeout((function(){card.runCallback()}),0);const node=card.node,q=this.queue,speeds=card.animSpeeds,from=mapAppend(function(that){for(const p in that)that.hasOwnProperty(p)&&(that[p]=parseFloat(that[p]));return that}({top:node.getStyle("top"),left:node.getStyle("left")}),"px");let duration;const zIndex=to.zIndex;if(from.top===to.top&&from.left===to.left)return;duration=this.dealing?speeds.slow:fields&&fields.from!==fields.to&&"waste"!==fields.to&&"foundation"!==fields.to?"deck"===fields.from?speeds.slow:speeds.mid:speeds.fast,node.setStyle("zIndex",500+zIndex),delete to.zIndex;const anim=new Y.Anim({node:node,from:from,to:to,easing:Y.Easing.easeOut,duration:duration});anim.on("end",(function(){card.positioned=!0,node.setStyle("zIndex",zIndex),card.runCallback()})),q.add((function(){anim.run()})),q.run()},initQueue:function(){this.queue.defaults.timeout=this.interval}};const Undo={stack:null,clear:function(){this.stack=[]},push:function(moves){this.stack.push(moves)},pop:function(){return this.stack.pop()||[]},undo:function(){Y.Array.unique(my_Flatten(Y.Array.map(this.pop(),this.act))).forEach((function(stack){stack&&(stack.updateCardsPosition(),stack.update(!0))}))},act:function(move){const from=move.from,card=move.card,to=card.stack,cards=to.cards;return from&&(from===card.stack?cards[cards.indexOf(card)]=null:_deleteItem(cards,card),from.cards[move.index]=card,card.stack=from,Solitaire.container().append(card.node)),"faceDown"in move&&(move.faceDown?card.faceUp(!0):card.faceDown(!0)),[to,from]}}}),"0.0.1",{requires:["dd","dd-plugin","dd-delegate","anim","async-queue","array-extras"]}),{instance:instance,Game:Game,getGame:getGame,setUI:v=>{enable_solitairey_ui=v}}})),define(["./libfcs-wrap","./web-fc-solve","./solitaire","./flatted"],(function(Module,w,solitaire,flatted){"use strict";const FC_Solve=w.FC_Solve,FCS_STATE_SUSPEND_PROCESS=w.FCS_STATE_SUSPEND_PROCESS,FCS_STATE_WAS_SOLVED=w.FCS_STATE_WAS_SOLVED;let getGame,_module_wrapper,_startSolution_cb;let _my_non_promise_module,_my_module,WITH_UI=!1;WITH_UI=!0;let _my_mod_counter=5;const suitTable={s:0,h:1,c:2,d:3};function cardToValue(card){return card?card.rank<<2|suitTable[card.suit]:0}function withSelector(Y,selector,callback){const node=Y.one(selector);node&&callback(node)}function sortedStacks(Y,field){return Y.Array.map(field.stacks,(function(s){return s})).sort((function(s1,s2){return cardToValue(s1.first())-cardToValue(s2.first())}))}function to_int(s){return parseInt(s,10)}const _suits=["S","H","C","D"],_ranks=["A","2","3","4","5","6","7","8","9","T","J","Q","K"];function _rev(arr,delta){const ret={};for(let i=0;i>2)-1]}function _render_suit(c){return _suits[3&c]}function _render_foundation(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)}function cardRank(val){return val>>2}function cardSuit(val){return["s","h","c","d"][3&val]}function _render_freecell(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)}function _str_to_c(s){const m=s.match(/^(.)(.)$/);if(!m)throw"Should not happen";return _ranks_rev[m[1]]<<2|_suits_rev[m[2]]}function _get_stack_c(pre_s,src,card_idx){const arr=pre_s[src+2].replace(/ *$/,"").split(" "),src_c_s=arr[arr.length-card_idx];return":"==src_c_s?0:_str_to_c(src_c_s)}function _get_freecell_c(pre_s,idx){const fc_line=pre_s[1],pat=new RegExp("^Freecells:"+(0==idx?"":"(?:....){"+idx+"}")+"(....)",""),matched=fc_line.match(pat);if(matched){const c_s=matched[1].substring(2,4);return" "==c_s?0:_str_to_c(c_s)}return 0}function _calc__move_content(pre_s,str){let matched=str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)/);if(matched){const num_cards=to_int(matched[1]);return{source:["tableau",_get_stack_c(pre_s,to_int(matched[2]),num_cards)],dest:["tableau",_get_stack_c(pre_s,to_int(matched[3]),1)],num_cards:num_cards}}if(matched=str.match(/^Move a card from (stack|freecell) ([0-9]+) to the foundations/),matched){const src=to_int(matched[2]);let m_t,src_c;"stack"==matched[1]?(src_c=_get_stack_c(pre_s,src,1),m_t="tableau"):(src_c=_get_freecell_c(pre_s,src),m_t="reserve");const f_suit=3&src_c,f_rank=function(pre_s,f){const f_line=pre_s[0],pat=new RegExp(f+"-([0A2-9TJQK])",""),m=f_line.match(pat)[1];return"0"==m?0:_ranks_rev[m]}(pre_s,_suits[f_suit]);return{source:[m_t,src_c],dest:["foundation",0!=f_rank&&f_rank<<2|f_suit],num_cards:1}}if(matched=str.match(/^Move a card from stack ([0-9]+) to freecell ([0-9]+)/),matched)return{source:["tableau",_get_stack_c(pre_s,to_int(matched[1]),1)],dest:["reserve",_get_freecell_c(pre_s,to_int(matched[2]))],num_cards:1};if(matched=str.match(/^Move a card from freecell ([0-9]+) to stack ([0-9]+)/),matched)return{source:["reserve",_get_freecell_c(pre_s,to_int(matched[1]))],dest:["tableau",_get_stack_c(pre_s,to_int(matched[2]),1)],num_cards:1};throw"Must not happen - _calc__move_content() failed with <"+str+">"}function _calc_instance_from_state(state){let exceeded_iters=!1;const instance=new FC_Solve({cmd_line_preset:"video-editing",module_wrapper:_module_wrapper,set_status_callback:function(status){"exceeded"==status&&(exceeded_iters=!0)}}),state_as_string=function(obj){let ret="";const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map(_render_foundation).join("")+"\n",ret+="Freecells:"+reserve.map(_render_freecell).join("")+"\n";for(let i=0;i=this.remainingMovesArr.length)return;const move=function(game,move){const source=move.source,dest=move.dest,ret={top_card:!0};let value=source[1];const source_type=source[0];if(game.eachStack((function(stack){if(ret.card)return;const len=stack.cards.length;stack.eachCard((function(card,i){return!ret.card&&(!card||(card.rank===cardRank(value)&&card.suit===cardSuit(value)?(ret.card=card,"tableau"===source_type&&i!=len-1&&(ret.top_card=!1),!1):void 0))}))}),source_type),!ret.card)throw"Excalibur";if(value=dest[1],game.eachStack((function(stack){if(ret.stack)return;const card=stack.my_Last();card||value||(ret.stack=stack),card&&card.rank===cardRank(value)&&card.suit===cardSuit(value)&&(ret.stack=stack)}),dest[0]),!ret.stack)throw"Must not happen - could not find dest stack for <"+value+">";return ret.num_cards=move.num_cards,ret}(game,this.remainingMovesArr[this.remainingMovesIdx]),card=move.card;if(!card)return;const origin=card.stack;if(move.top_card)card.moveTo(move.stack);else{Solitaire.activeCard=card,card.createProxyStack();const proxyStack=card.proxyStack;proxyStack.cards.length!==move.num_cards&&alert("Error !!! mismatch in num_cards"),proxyStack.cards.forEach((function(card){})),move.stack.pushStack(proxyStack),move.stack.updateCardsPosition(),origin.updateCardsPosition(),Solitaire.endTurn()}return!0},_resetGameFoo:function(){},playCurrent:function(game){const that=this;that._playCurrentHelper(game)||that._resetGameFoo()},prev:function(game){const that=this;that.remainingMovesIdx>0&&(Y.fire("undo",!0),--that.remainingMovesIdx)},next:function(game){const that=this,next_idx=this.remainingMovesIdx+1;Solitaire.Statistics.disable(),that.playCurrent(game),that.remainingMovesIdx=next_idx,that.remainingMovesIdx>=that.remainingMovesArr.length&&that._resetGameFoo(),Y.fire("endTurn",!0)},play:function(game){const that=this;that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(Solitaire.Autoplay.disable(),withSelector(Y,"#solver_bar .play",(function(node){node.removeClass("play"),node.addClass("pause")})),that.next(game),that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(that.timer=window.setTimeout((function(){that.play(game)}),that.interval)))}},Status={bar:null,indicator:null,indicatorTimer:null,indicatorInterval:750,delay:400,updateIndicator:function(ticks){const that=this,indicator=that.indicator;if(!indicator)return;ticks=(ticks||0)%4;let text="Solving";for(let i=0;i'),indicator=Y.Node.create('');function _create_button(args){return Y.Node.create('')}const next=_create_button({cls:"fastforward",title:"Next move"}),prev=_create_button({cls:"rewind",title:"Previous move"}),playPause=_create_button({cls:"play",title:"Play/Pause"}),controls=Y.Node.create("
");next.on("click",(function(){Animation.pause(),Animation.next(getGame())})),prev.on("click",(function(){Animation.pause(),Animation.prev(getGame())})),playPause.on("click",(function(){const that=playPause;that.hasClass("play")?Animation.play(getGame()):that.hasClass("pause")&&Animation.pause()})),controls.append(prev),controls.append(playPause),controls.append(next),bar.append(indicator),bar.append(controls),Y.one(".solitairey_body").append(bar),this.indicator=indicator,this.bar=bar},hide:function(){0}};_startSolution_cb=function(args){return Y.Solitaire.Application.switchToGame("freecell"),Y.Solitaire.Application.clearDOM(),Y.Solitaire.Freecell.setup((()=>{function _from_card(card){return Y.Solitaire.Freecell.Card.create(card.getRank(),game.deck.suits[[2,0,1,3][card.getSuit()]]).faceUp()}const board=args.board,game=getGame(),tableau=game.tableau.stacks;board.columns.forEach(((col,ci)=>{const column=col.col;tableau[ci].setCards(column.getLen(),(function(i){return _from_card(column.getCard(i))}))}));const fc=board.freecells;game.reserve.stacks.forEach(((stack,i)=>{const card=fc?fc.freecells.getCard(i):null;stack.setCards(card?1:0,(function(_unused){return _from_card(card)}))}));const foundations=board.foundations;game.foundation.stacks.forEach((function(stack,suit){stack.setCards(foundations?1+foundations.foundations.getByIdx(0,[1,2,0,3][suit]):0,(function(rank){return Y.Solitaire.Freecell.Card.create(rank,game.deck.suits[suit]).faceUp()}))}))}),{disableDragging:!0}),_solve_cb(Y,FreecellSolver,args.instance._pre_expand_states_and_moves_seq,Animation)},Y.mix(FreecellSolver,{solver_active:!1,currentSolution:null,attached:!1,supportedGames:["Freecell"],isSupported:function(){return-1!==this.supportedGames.indexOf(getGame().name())},enable:function(){this.isSupported()&&this.createUI(),this.attachEvents()},disable:function(){Status.hide()},attachEvents:function(){const that=this;if(that.attached)return;const pause=Animation.pause.bind(Animation);Y.on("afterDealingAnimation",(function(){that.isSupported()?(that.solver_active=!1,Animation.remainingMovesIdx=null,Animation.remainingMovesArr=[],that.solve()):that.disable()})),Y.on("autoPlay",(function(){FreecellSolver.disable()})),Y.on("win",(function(){})),document.documentElement.addEventListener("mousedown",(function(e){e.target.className.match(/\bpause\b/)||pause()}),!0),that.attached=!0},createUI:function(){Status.show()},stop:function(){},solve:function(){const that=this;if(that.solver_active)return;that.solver_active=!0,that.stop(),that.currentSolution=null;const state=function(Y,game){const tableau=Y.Array.map(sortedStacks(Y,game.tableau),(function(s){const buffer=[];return s.eachCard((function(c,i){buffer[i]=cardToValue(c)})),[buffer,s.cards.length]})),reserve=[];sortedStacks(Y,game.reserve).forEach((function(s,i){reserve[i]=cardToValue(s.my_Last())}));const foundation=[];return sortedStacks(Y,game.foundation).forEach((function(s,i){foundation[i]=cardToValue(s.my_Last())})),{reserve:reserve,foundation:foundation,tableau:tableau}}(Y,getGame());function _cb(){window.setTimeout((function(){const instance=_calc_instance_from_state(state);return _solve_cb(Y,that,instance?instance._pre_expand_states_and_moves_seq:null,Animation)}),400)}var callback;_my_non_promise_module?_cb():(callback=_cb,_my_mod_counter>=5?(_my_module=Module({onRuntimeInitialized:()=>{_my_module.then((result=>{_my_non_promise_module=result;const module_wrapper=w.FC_Solve_init_wrappers_with_module(_my_non_promise_module);_module_wrapper=module_wrapper,callback()}))}}),_my_mod_counter=0):++_my_mod_counter)}}),Y.on("beforeSetup",FreecellSolver.enable.bind(FreecellSolver))}),"0.0.1",{requires:["solitaire"]}),{startSolution:function(args){return _startSolution_cb(args)}}})),importScripts("libfreecell-solver.min.js","web-fc-solve--expand-moves.js","web-fc-solve.js");let attempts=0;const maxFastAttempts=15e4;function GameState(obj){if(!obj)return;let i,stack;for(this.reserve=new Uint8Array(obj.reserve),this.foundation=new Uint8Array(obj.foundation),this.tableau=[],i=0;i200)return 200;if(state.solved())return state.becomeChild(),0;for(i=0;i<4;i++)if(val=state.reserve[i],val){if(destIndex=state.validTarget("foundation",val),destIndex>-1&&(moves.push({source:["reserve",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["reserve",i],dest:["tableau",destIndex]})}const tableau=state.tableau;for(i=0;i-1&&(moves.push({source:["tableau",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=state.validTarget("reserve",val),destIndex>-1&&moves.push({source:["tableau",i],dest:["reserve",destIndex]}),destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["tableau",i],dest:["tableau",destIndex]})}for(foundFoundation?movesSinceFoundation=0:movesSinceFoundation++,i=0;i=20&&(scale=.7),fastSearch&&++attempts>maxFastAttempts&&(scale=.001),i=0;i>2)-1]}const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map((function(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)})).join("")+"\n",ret+="Freecells:"+reserve.map((function(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)})).join("")+"\n";for(let i=0;i>2!=13)return!1;return!0},eachTableau:function(callback){const tableau=this.tableau;for(let i=0,len=tableau.length;i>2,suit=3&value;let dest,tableau,i,len;if(!value)return-1;switch(void 0===start?start=0:start++,field){case"foundation":for(i=0;i<4;i++)if(dest=this.foundation[i],!dest&&1===rank||suit===(3&dest)&&rank===1+(dest>>2))return i;break;case"reserve":for(i=0;i<4;i++)if(!this.reserve[i])return i;break;case"tableau":for(tableau=this.tableau,i=start,len=tableau.length;i>2)-1)return i}return-1},move:function(sourceField,sourceStack,destField,destStack){const val=this.pop(sourceField,sourceStack);this.push(destField,destStack,val)},pop:function(field,stack){let val;if("reserve"===field||"foundation"===field)return val=this[field][stack],this[field]=new Uint8Array(this[field]),this[field][stack]=0,val;const tableau=this.tableau,bufferLength=tableau[stack][1];return bufferLength?(val=tableau[stack][0][bufferLength-1],this.copyTableau(stack,bufferLength-1),val):0},push:function(field,stack,val){if(!val)return;if("reserve"===field||"foundation"===field)return this[field]=new Uint8Array(this[field]),void(this[field][stack]=val);const newLength=this.tableau[stack][1]+1;this.copyTableau(stack,newLength),this.tableau[stack][0][newLength-1]=val},copyTableau:function(stack,newLength){const old=this.tableau,tableau=old[stack][0],newBuffer=new Uint8Array(new ArrayBuffer(newLength));for(let i=0;i=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=15-(length-2-i)+(13-(stack[0][i]>>2)));this.validTarget("tableau",stack[0][length-2])>-1&&(rating+=10)}if("reserve"===sourceField&&(rating+=10,card=this.reserve[sourceIndex]),"tableau"===destField){for(rating+=2,stack=this.tableau[destIndex],length=stack[1],i=length-1;i>=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=-5*(length-i));if(0===stack[1]){if("tableau"===sourceField&&1===this.tableau[sourceIndex][1])return-1e3;for(i=0;i<4;i++)nextCard=this.reserve[i],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);for(i=0;i<8;i++)stack=this.tableau[i],nextCard=stack[0][stack[1]-1],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);followup||(rating+=-10)}}return"reserve"===destField&&(rating+=-1),rating},transformParentMove:function(){const move=this.parentMove,parent=this.parent;move&&parent&&(move.source[1]=parent.lastCard(move.source[0],move.source[1]),move.dest[1]=parent.lastCard(move.dest[0],move.dest[1]))},lastCard:function(field,index){switch(field){case"reserve":case"foundation":return this[field][index];case"tableau":const stack=this[field][index],length=stack[1];return stack[0][length-1]}},becomeChild:function(){const parent=this.parent;parent&&(parent.child=this,this.transformParentMove())}},onmessage=function(e){let solution;const data=e.data;"solve"===data.action&&(solution=attemptSolution(data.param,!0),solution||(solution=attemptSolution(data.param,!1)),self.postMessage({solution:solution}))},YUI.add("spider",(function(Y){const Solitaire=Y.Solitaire,Spider=Solitaire.Spider=Solitaire.instance(Solitaire,{fields:["Foundation","Deck","Tableau"],createEvents:function(){Solitaire.AutoStackClear.register(),Solitaire.createEvents.call(this)},deal:function(){const deck=this.deck,stacks=this.tableau.stacks;for(let row=0;row<5;row++)for(let stack=0;stack<10;stack++)(stack<4||row<4)&&stacks[stack].push(deck.pop());for(let stack=0;stack<10;stack++)stacks[stack].push(deck.pop().faceUp());deck.createStack()},redeal:function(){},turnOver:function(){const deck=this.deck.stacks[0],that=this;hasFreeTableaus()||this.eachStack((function(stack){const card=deck.my_Last();card&&card.faceUp().moveTo(stack).after((function(){that.stack.updateCardsPosition()}))}),"tableau")},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 2.5*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck"}),Tableau:{stackConfig:{total:10,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau"},Card:Solitaire.instance(Solitaire.Card,{playable:function(){this.stack[this.index-1];switch(this.stack.field){case"tableau":return this.createProxyStack();case"deck":return!hasFreeTableaus();case"foundation":return!1}},validTarget:function(stack){if("tableau"!==stack.field)return!1;const target=stack.my_Last();return!target||!target.isFaceDown&&target.rank===this.rank+1}})});function hasFreeTableaus(){return Y.Array.some(Solitaire.getGame().tableau.stacks,(function(stack){return!stack.cards.length}))}Spider.fields.forEach((function(field){Spider[field].Stack=Solitaire.instance(Spider.Stack)})),Y.mix(Spider.Stack,{validCard:function(card){return card.suit===_.last(this.cards).suit},validTarget:function(stack){switch(stack.field){case"tableau":return this.first().validTarget(stack);case"foundation":return 13===this.cards.length}}},!0),Y.mix(Spider.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["auto-stack-clear"]}),YUI.add("spider1s",(function(Y){const Solitaire=Y.Solitaire;(Y.Solitaire.Spider1S=Solitaire.instance(Y.Solitaire.Spider)).Deck=Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s"],count:8})}),"0.0.1",{requires:["spider"]}),YUI.add("spider2s",(function(Y){(Y.Solitaire.Spider2S=Y.Solitaire.instance(Y.Solitaire.Spider)).Deck=Y.Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s","h"],count:4})}),"0.0.1",{requires:["spider"]}),YUI.add("spiderette",(function(Y){const Solitaire=Y.Solitaire,Klondike=Solitaire.Klondike,Spider=Solitaire.Spider;Y.Solitaire.Spiderette=Solitaire.instance(Spider,{height:Klondike.height,deal:Klondike.deal,Tableau:Solitaire.instance(Spider.Tableau,{stackConfig:Klondike.Tableau.stackConfig}),Foundation:Solitaire.instance(Spider.Foundation,{stackConfig:Klondike.Foundation.stackConfig}),Deck:Solitaire.instance(Spider.Deck,{count:1})})}),"0.0.1",{requires:["klondike","spider"]}),define(["./solitaire"],(function(solitaire){const getGame=solitaire.getGame;return YUI.add("statistics",(function(Y){let loaded,won,enabled=!0;const localStorage=window.localStorage,Solitaire=Y.Solitaire,Statistics=Y.namespace("Solitaire.Statistics");function winDisplay(){const stats=function(raw){function parse(){const entries=raw.split("|");return entries.splice(entries.length-1),Y.Array.map(entries,(function(entry){return entry=entry.split("_"),{date:new Date(entry[0]),won:!!parseInt(entry[1],10)}}))}function won(entry){return entry.won}const record=parse();return{streaks:function(){const streaks=[];let streak=null;return record.forEach((function(entry){entry.won?(streak||(streak=[]),streak.push(entry)):(streak&&streaks.push(streak),streak=null)})),streak&&streaks.push(streak),streaks},wins:function(){return Y.Array.filter(record,won)},loses:function(){return Y.Array.reject(record,won)}}}(localStorage[Solitaire.game.name()+"record"]);let output="
";const streakCount=_.last(stats.streaks()).length,winCount=stats.wins().length,loseCount=stats.loses().length;return output+="

You win! You're awesome.

",output+="

"+{Agnes:"Agnes",Klondike:"Klondike",Klondike1T:"Klondike (Vegas style)",FlowerGarden:"Flower Garden",FortyThieves:"Forty Thieves",Freecell:"Freecell",Golf:"Golf",GClock:"Grandfather's Clock",MonteCarlo:"Monte Carlo",Pyramid:"Pyramid",RussianSolitaire:"Russian Solitaire",Scorpion:"Scorpion",Spider:"Spider",Spider1S:"Spider (1 Suit)",Spider2S:"Spider (2 Suit)",Spiderette:"Spiderette",WillOTheWisp:"Will O' The Wisp",TriTowers:"Tri Towers",Yukon:"Yukon"}[Solitaire.game.name()]+" stats:

",output+="
    ",output+="
  • Current win streak: "+streakCount+"
  • ",output+="
  • Total wins: "+winCount+"
  • ",output+="
  • Total loses: "+loseCount+"
  • ",output+='
    ',output+="
",output}function record(value){const key=localStorage.currentGame+"record";let record=localStorage[key]||"";record+=(new Date).getTime()+"_"+value+"|",localStorage[key]=record}function clearProgress(){localStorage.removeItem("currentGame")}function saveProgress(){localStorage.currentGame=Solitaire.game.name()}localStorage&&(Y.on("newGame",(function(){loaded&&(record(0),clearProgress()),won=!1,loaded=null})),Y.on("loadGame",(function(){loaded=Solitaire.game.name(),saveProgress(),won=!1})),Y.on("endTurn",(function(){loaded||(loaded=Solitaire.game.name(),saveProgress())})),Y.on("win",(function(){!won&&enabled&&(loaded=null,won=!0,record(1),clearProgress(),function(){const delay=500,duration=900,interval=900;getGame().eachStack((function(stack){stack.eachCard((function(card){if(!card)return;const node=card.node;card===stack.my_Last()?(node.plug(Y.Breakout,{columns:5}),function(node){setTimeout((function(){node.breakout.explode({random:.65,duration:duration})}),delay)}(node),delay+=interval):node.addClass("hidden")}))}),"foundation"),setTimeout((function(){Statistics.winDisplay()}),delay+200)}())})),Y.on("beforeSetup",(function(){const winDisplay=Y.one("#win_display");winDisplay&&winDisplay.remove(),Statistics.enable()})),Y.mix(Statistics,{winDisplay:function(){const Application=Solitaire.Application;Y.one(".solitairey_body").append(winDisplay()),Y.on("click",(function(){Application.newGame()}),Y.one("#win_display .new_deal"))},enable:function(){enabled=!0},disable:function(){enabled=!1}}))}),"0.0.1",{requires:["solitaire","array-extras","breakout"]}),{}})),YUI.add("tri-towers",(function(Y){const Solitaire=Y.Solitaire,TriTowers=Y.Solitaire.TriTowers=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],width:function(){return 15*this.Card.base.width},height:function(){return 5*this.Card.base.height},createEvents:function(){Y.on("solitaire|endTurn",(function(){const tableaus=Solitaire.game.tableau.stacks;for(let i=0;i<3;i++)Y.fire("tableau:afterPop",tableaus[i])})),Solitaire.createEvents.call(this)},deal:function(){let card,stack,i,stackLength;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(stack=0;stack<4;stack++)for(stackLength=3*(stack+1),i=0;i=0;){for(card=deck.pop().faceUp(),stacks[6-piles].push(card),stack=7-piles;stack<7;stack++)card=deck.pop(),stacks[stack].push(card);piles--}for(stack=1;deck.cards.length;)card=deck.pop().faceUp(),stacks[stack].push(card),stack=stack%6+1},height:function(){return 4.8*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{vspacing:1.25,top:0,left:function(){return 9*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:7,layout:{hspacing:1.25,top:0,left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{playable:function(){return"tableau"===this.stack.field&&!this.isFaceDown},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.color!==this.color&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});Yukon.fields.forEach((function(field){Yukon[field].Stack=Solitaire.instance(Yukon.Stack)})),Y.mix(Yukon.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validProxy:function(card){return!0}},!0),Y.mix(Yukon.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),define(["require","exports","./prange","./french-cards"],(function(require,exports,prange_1,french_cards_1){"use strict";function is_int(input){const value=""+input;return parseFloat(value)===parseInt(value,10)&&!isNaN(input)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BoardParseResult=exports.ParseErrorType=exports.ErrorLocationType=exports.Foundations=exports.suits__str_to_int=exports.MAX_RANK=exports.MIN_RANK=exports.NUM_SUITS=exports.ranks__str_to_int=void 0,exports.capitalize_cards=function(board){return board.match(/[^\n]*\n?/g).map((l=>new BoardTextLine(l).capitalize())).join("")},exports.fcs_js__card_from_string=fcs_js__card_from_string,exports.fcs_js__column_from_string=fcs_js__column_from_string,exports.fcs_js__freecells_from_string=fcs_js__freecells_from_string,exports.fcs_js__foundations_from_string=fcs_js__foundations_from_string,exports.determine_if_string_is_board_like=function(s){return lax_card_three_matches.test(s)};exports.ranks__str_to_int={},exports.NUM_SUITS=4;const _suits=(0,prange_1.perl_range)(0,exports.NUM_SUITS-1);exports.MIN_RANK=1,exports.MAX_RANK=13;const _ranks=(0,prange_1.perl_range)(exports.MIN_RANK,exports.MAX_RANK);for(const rank of _ranks)exports.ranks__str_to_int["0A23456789TJQK".substring(rank,rank+1)]=rank;exports.suits__str_to_int=new Map;for(const suit of _suits)exports.suits__str_to_int.set(french_cards_1.suits__int_to_str.substring(suit,suit+1),suit);class Card{constructor(rank,suit){if(this.rank=rank,this.suit=suit,!is_int(rank))throw"rank is not an integer.";if(!is_int(suit))throw"suit is not an integer.";if(rank<1)throw"rank is too low.";if(rank>exports.MAX_RANK)throw"rank is too high.";if(suit<0)throw"suit is negative.";if(suit>=exports.NUM_SUITS)throw"suit is too high."}getRank(){return this.rank}getSuit(){return this.suit}toString(){return"0A23456789TJQK".substring(this.rank,this.rank+1)+french_cards_1.suits__int_to_str.substring(this.suit,this.suit+1)}}class BoardTextLine{constructor(line){this.line=line;const that=this,m1=line.match(/^([^\n\r]*)([\n\r]*)$/);that.newline=m1[2];let l=m1[1];if(m1[1].match(/#/)){const m2=m1[1].match(/^(.*?)(#.*)/);that.comment=m2[2],l=m2[1]}else that.comment="";if(l.match(/:/)){const m3=l.match(/^([^:]*:)(.*)/);that.prefix=m3[1],that.content=m3[2]}else that.prefix="",that.content=l}getContent(){return this.content}capitalize(){return this.prefix+this.getContent().toUpperCase()+this.comment+this.newline}}class Column{constructor(cards){this.cards=cards}getLen(){return this.cards.length}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getLen())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getLen()-1).map((i=>that.getCard(i).toString()))}toString(){return Array.prototype.concat.apply([],[[":"],this.getArrOfStrs()]).join(" ")+"\n"}}const card_re="("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")";function fcs_js__card_from_string(s){const m=s.match("^"+card_re+"$");if(!m)throw'Invalid format for a card - "'+s+'"';return new Card(exports.ranks__str_to_int[m[1]],exports.suits__str_to_int.get(m[2]))}class BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error){this.is_correct=is_correct,this.start_char_idx=start_char_idx,this.num_consumed_chars=num_consumed_chars,this.error=error}getEnd(){return this.start_char_idx+this.num_consumed_chars}}class ColumnParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,cards){super(is_correct,start_char_idx,num_consumed_chars,error),this.col=new Column(cards)}getLen(){return this.col.getLen()}toString(){return this.col.toString()}}class StringParser{constructor(s){this.s=s,this.consumed=0}consume(m){const len_match=m[1].length;this.consumed+=len_match,this.s=this.s.substring(len_match)}getConsumed(){return this.consumed}isNotEmpty(){return this.s.length>0}match(re){return this.s.match(re)}consume_match(re){const that=this,m=that.match(re);return m&&that.consume(m),m}skipComments(){this.consume_match(/^((?:[ \t]*#[^\n\r]*\r?\n)*)/)}}class CardsStringParser extends StringParser{constructor(s,card_mapper){super(s),this.card_mapper=card_mapper,this.cards=[],this.is_start=!0}afterStart(){this.is_start=!1}getStartSpace(){return this.is_start?"":" +"}should_loop(){return this.isNotEmpty()&&!this.consume_match(/^(\s*(?:#[^\n]*)?\n?)$/)}add(m){this.cards.push(this.card_mapper(m[2])),this.afterStart()}loop(re,callback){const p=this;for(;p.should_loop();){const m=p.consume_match("^("+p.getStartSpace()+"("+re+"))");if(!m)return p.consume_match("^( *)"),callback();p.add(m)}return null}}function calc_1H_error_string(suit){return'Wrong rank specifier "1" (followed by "[R]"). Perhaps you meant either "A[R]" (for ace) or "T[R]" (for rank ten).'.replace(/\[R\]/g,suit)}function fcs_js__column_from_string(start_char_idx,orig_s,force_leading_colon){const p=new CardsStringParser(orig_s,fcs_js__card_from_string),match=p.consume_match("^((?:: +|:(?:$|(?=\\n)))?)");if(force_leading_colon&&!match[1].length)return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),'Columns must start with a ":" in strict mode.',[]);const ret=p.loop(card_re,(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]",[])}));return ret||new ColumnParseResult(!0,start_char_idx,p.getConsumed(),"",p.cards)}class Freecells{constructor(num_freecells,cards){if(this.num_freecells=num_freecells,this.cards=cards,!is_int(num_freecells))throw"num_freecells is not an integer.";if(cards.length!==num_freecells)throw"cards length mismatch."}getNum(){return this.num_freecells}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getNum())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getNum()-1).map((i=>{const card=that.getCard(i);return null!==card?card.toString():"-"}))}toString(){return Array.prototype.concat.apply([],[["Freecells:"],this.getArrOfStrs()]).join(" ")+"\n"}}class FreecellsParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,num_freecells,fc){super(is_correct,start_char_idx,num_consumed_chars,error),is_correct&&(this.freecells=new Freecells(num_freecells,fc))}}function fcs_js__freecells_from_string(num_freecells,start_char_idx,orig_s){const p=new CardsStringParser(orig_s,(card_str=>"-"===card_str?null:fcs_js__card_from_string(card_str)));function make_ret(verdict,err_str){return new FreecellsParseResult(verdict,start_char_idx,p.getConsumed(),err_str,num_freecells,verdict?p.cards:[])}if(!p.consume_match(new RegExp("^("+freecells_prefix_re+":(?: +|$|(?=\\n)))")))return make_ret(!1,'Wrong line prefix for freecells - should be "Freecells:"');const ret=p.loop("\\-|(?:"+card_re+")",(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return make_ret(!1,m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]")}));if(ret)return ret;for(;p.cards.length=0&&rank<=exports.MAX_RANK))throw"rank is out of range.";return!(this.ranks[suit]>=0)&&(this.ranks[suit]=rank,!0)}finalize(){const that=this;for(let i=0;i0&&arr.push(french_cards_1.suits__int_to_str[suit]+"-"+"0A23456789TJQK"[val])}return Array.prototype.concat.apply([],[["Foundations:"],arr]).join(" ")+"\n"}_validateDeckSuit(deck,suit){if(0!==deck)throw"multiple decks are not supported.";if(!is_int(suit))throw"suit is not an integer.";if(!(suit>=0&&suitnew BoardTextLine(l)));for(const l of lines){{const matches=l.getContent().match(/[a-z]+/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.LOWERCASE_LETTERS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}{const matches=l.getContent().match(/10/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.HAS_10_STRINGS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}}that.columns=[];const counter=_suits.map((i=>(0,prange_1.perl_range)(0,exports.MAX_RANK).map((i=>[])))),p=new StringParser(orig_s);if(p.skipComments(),p.match(foundations_prefix_re)){const start_char_idx=p.getConsumed(),fo=fcs_js__foundations_from_string(1,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.foundations=fo,!fo.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Foundations,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}if(p.skipComments(),p.match(new RegExp("^"+freecells_prefix_re+":"))){const start_char_idx=p.getConsumed(),fc=fcs_js__freecells_from_string(num_freecells,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.freecells=fc,!fc.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Freecells,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}for(let i=0;i{const col=col_res.col;for(const h of(0,prange_1.perl_range)(0,col.getLen()-1)){const card=col.getCard(h);counter[card.getSuit()][card.getRank()].push(new ParseLocation(ErrorLocationType.Column,idx,h))}}));const too_many_cards__errors=[],not_enough_cards__errors=[];for(const suit of _suits)for(const rank of _ranks){const count=counter[suit][rank];function add_error(arr,type_,locs){arr.push(new ParseError(type_,locs,new Card(rank,suit))),that.is_valid=!1}if(count.length>1){const locs=count.map((v=>new ErrorLocation(v.type_,v.row,0,0)));add_error(too_many_cards__errors,ParseErrorType.TOO_MUCH_OF_CARD,locs)}else count.length<1&&add_error(not_enough_cards__errors,ParseErrorType.NOT_ENOUGH_OF_CARD,[])}that.errors.push(...too_many_cards__errors),that.errors.push(...not_enough_cards__errors)}getBoardString(){const that=this;let ret="";that.foundations&&(ret+=that.foundations.foundations.toString()),that.freecells&&(ret+=that.freecells.freecells.toString());for(const col of that.columns)ret+=col.toString();return ret}_calc_filled(){return this.columns.filter((c=>c.getLen()>0))}checkIfFlipped(){let i=0;const my_filled_columns=this._calc_filled();for(;i<6;++i){if(i>=my_filled_columns.length)return!1;if(8!=my_filled_columns[i].getLen())return!1}for(;i<7;++i){if(i>=my_filled_columns.length)return!1;if(4!=my_filled_columns[i].getLen())return!1}for(;imy_filled_columns[c].col.getCard(i).toString())).join(" ")+"\n",!1));return new BoardParseResult(8,4,new_columns.map((col=>col.toString())).join(""))}}exports.BoardParseResult=BoardParseResult;const lax_card_rank_re="(?:(?:"+french_cards_1.rank_re+")|10|[01])",lax_card_with_spaces_re="(?:(?:\\s|^)"+("(?:(?:"+lax_card_rank_re+french_cards_1.suit_re+")|(?:"+french_cards_1.suit_re+lax_card_rank_re+"))")+"(?=(?:\\s|$)))",lax_card_three_matches=new RegExp(lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re,"ims")})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rank_re=exports.rank_str=exports.suit_re=exports.suits__int_to_str=void 0,exports.suits__int_to_str="HCDS",exports.suit_re="["+exports.suits__int_to_str+"]",exports.rank_str="A23456789TJQK",exports.rank_re="["+exports.rank_str+"]"})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.perl_range=function(start,end){const ret=[];for(let i=start;i<=end;++i)ret.push(i);return ret}})),define(["require","exports"],(function(require,exports){"use strict";function _to_int(s){return parseInt(s,10)}function _find_max_step(n){let x=1;for(;x<<1{},this.past_first_output_state_promise=expander=>expander.past_first_output_state()}init_from_string(num_stacks,num_freecells,ultimate_source,ultimate_dest,initial_src_state_str){const expander=this,col_matches=initial_src_state_str.match(/(\n:[^\n]*)/g);if(!col_matches||col_matches.length!==num_stacks)throw"Miscount of stacks.";for(let idx=0;idxfc?"s"===fc.t?fc.s:" "+fc.c:" ")).join("")+"\n"+this.modified_state.c.map((col=>": "+col.join(" ")+"\n")).join("");this.ret_array.push({str:state_string,type:"s"})}move_using_freecells(source,dest,count){const expander=this,num_cards_thru_freecell=count-1;for(let i=0;i=0;--i)expander.add_move({t:"f2s",src:expander.empty_fc_indexes[i],dest:dest})}recursive_move(source,dest,num_cards_r,empty_cols){const expander=this;if(num_cards_r<=0)return;const running_empty_cols=empty_cols.slice(0),steps=[];for(;Math.ceil(num_cards_r/expander.step_width)>1;){const count_cards=_find_max_step(Math.ceil(num_cards_r/expander.step_width))*expander.step_width,temp_dest=running_empty_cols.shift();expander.recursive_move(source,temp_dest,count_cards,running_empty_cols),steps.push({count:count_cards,dest:temp_dest,source:source}),num_cards_r-=count_cards}expander.move_using_freecells(source,dest,num_cards_r);for(const s of steps.reverse())expander.recursive_move(s.dest,dest,s.count,running_empty_cols),running_empty_cols.push(s.dest),running_empty_cols.sort(((a,b)=>a-b))}add_move(my_move){this.output_state_promise(this),this.ret_array.push({str:_render_move(my_move),type:"m"}),this.perform_move(my_move),this.output_state_promise=this.past_first_output_state_promise}perform_move(my_move){const expander=this,src=my_move.src,dest=my_move.dest;if("s2f"===my_move.t)expander.modified_state.f[dest]={c:expander.modified_state.c[src].pop(),t:"c"};else if("s2s"===my_move.t)expander.modified_state.c[dest].push(expander.modified_state.c[src].pop());else{if("c"!==expander.modified_state.f[src].t)throw"Wrong val in "+src+"Freecell.";expander.modified_state.c[dest].push(expander.modified_state.f[src].c),expander.modified_state.f[src]=null}}}})),define(["require","exports","./fcs-validate","./web-fcs-api-base","./web-fc-solve--expand-moves","./french-cards"],(function(require,exports,validate,BaseApi,web_fc_solve__expand_moves_1,french_cards_1){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FC_Solve=exports.DisplayFilter=exports.FCS_STATE_SUSPEND_PROCESS=exports.FCS_STATE_WAS_SOLVED=void 0,exports.FC_Solve_init_wrappers_with_module=function(Module){const module_wrapper=BaseApi.base_calc_module_wrapper(Module);return module_wrapper.fc_solve_allocate_i8=p1=>Module.allocate(p1,"i8",Module.ALLOC_STACK),module_wrapper.user_alloc=Module.cwrap("freecell_solver_user_alloc","number",[]),module_wrapper.user_solve_board=Module.cwrap("freecell_solver_user_solve_board","number",["number","string"]),module_wrapper.user_resume_solution=Module.cwrap("freecell_solver_user_resume_solution","number",["number"]),module_wrapper.user_cmd_line_read_cmd_line_preset=Module.cwrap("freecell_solver_user_cmd_line_read_cmd_line_preset","number",["number","string","number","number","number","string"]),module_wrapper.user_get_next_move=Module.cwrap("freecell_solver_user_get_next_move","number",["number","number"]),module_wrapper.user_get_num_freecells=Module.cwrap("freecell_solver_user_get_num_freecells","number",["number"]),module_wrapper.user_get_num_stacks=Module.cwrap("freecell_solver_user_get_num_stacks","number",["number"]),module_wrapper.user_get_unrecognized_cmd_line_flag=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag","number",["number","number"]),module_wrapper.user_get_unrecognized_cmd_line_flag_status=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag_status","number",["number","number"]),module_wrapper.user_current_state_stringify=Module.cwrap("freecell_solver_user_current_state_stringify","number",["number","number","number","number","number"]),module_wrapper.user_stringify_move_ptr=Module.cwrap("freecell_solver_user_stringify_move_ptr","number",["number","number","number","number"]),module_wrapper.user_free=Module.cwrap("freecell_solver_user_free","number",["number"]),module_wrapper.user_limit_iterations_long=Module.cwrap("freecell_solver_user_limit_iterations_long","number",["number","number"]),module_wrapper.user_get_invalid_state_error_into_string=Module.cwrap("freecell_solver_user_get_invalid_state_error_into_string","number",["number","number","number"]),module_wrapper.user_cmd_line_parse_args_with_file_nesting_count=Module.cwrap("freecell_solver_user_cmd_line_parse_args_with_file_nesting_count","number",["number","number","number","number","number","number","number","number","number","number","number"]),module_wrapper.alloc_wrap=(my_malloc=>(size,desc,error)=>{const buffer=my_malloc(size);if(0===buffer)throw alert("Could not allocate "+desc+" (out of memory?)"),error;return buffer})(Module.cwrap("malloc","number",["number"])),module_wrapper.c_free=Module.cwrap("free","number",["number"]),module_wrapper.fc_solve_Pointer_stringify=ptr=>Module.UTF8ToString(ptr,1e4),module_wrapper};const remove_trailing_space_re=/[ \t]+$/gm;exports.FCS_STATE_WAS_SOLVED=0;exports.FCS_STATE_SUSPEND_PROCESS=5;const fc_solve_2uni_suit_map={H:"♥",C:"♣",D:"♦",S:"♠"},fc_solve_2uni_suit_map_num={H:1,C:3,D:2,S:0};function fc_solve_2uni_card(match,p1,p2,offset,mystring){return p1+fc_solve_2uni_suit_map[p2]}function fc_solve_2uni_char_card(match,p1,p2,offset,mystring){const rank=validate.ranks__str_to_int[p1];return String.fromCodePoint(16*fc_solve_2uni_suit_map_num[p2]+127136+rank)}function fc_solve_2uni_found(match,p1,p2,offset,mystring){return fc_solve_2uni_suit_map[p1]+p2}const card_re=new RegExp("\\b("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")\\b","g"),found_re=new RegExp("\\b("+french_cards_1.suit_re+")(-[0A2-9TJQK])\\b","g");exports.DisplayFilter=class{constructor(args){this.is_unicode_cards=args.is_unicode_cards,this.is_unicode_cards_chars=args.is_unicode_cards_chars}unicode_preprocess(out_buffer){return this.is_unicode_cards?this._replace_found(this.is_unicode_cards_chars?this._replace_char_card(out_buffer):this._replace_card(out_buffer)):out_buffer}_replace_char_card(s){return s.replace(card_re,fc_solve_2uni_char_card)}_replace_card(s){return s.replace(card_re,fc_solve_2uni_card)}_replace_found(s){return s.replace(found_re,fc_solve_2uni_found)}};exports.FC_Solve=class{constructor(args){const that=this;that.module_wrapper=args.module_wrapper,that._do_not_alert=!1,that.dir_base=args.dir_base,that.string_params=args.string_params?[args.string_params]:null,that.set_status_callback=args.set_status_callback,that.cmd_line_preset=args.cmd_line_preset,that.current_iters_limit=0,that.obj=(()=>{const ret_obj=that.module_wrapper.user_alloc();if(0===ret_obj)throw alert("Could not allocate solver instance (out of memory?)"),"Foo";if(0!==that._initialize_obj(ret_obj))throw that._do_not_alert?that._do_not_alert=!1:alert("Failed to initialize solver (Bug!)"),that.module_wrapper.user_free(ret_obj),"Bar";return ret_obj})(),that.proto_states_and_moves_seq=null,that._pre_expand_states_and_moves_seq=null,that._post_expand_states_and_moves_seq=null,that._state_string_buffer=that.module_wrapper.alloc_wrap(500,"state string buffer","Zam"),that._move_string_buffer=that.module_wrapper.alloc_wrap(200,"move string buffer","Plum")}set_status(myclass,mylabel){return this.set_status_callback(myclass,mylabel)}handle_err_code(solve_err_code){const that=this;if(8===solve_err_code){const error_string_ptr=that.module_wrapper.alloc_wrap(300,"state error string","Gum");that.module_wrapper.user_get_invalid_state_error_into_string(that.obj,error_string_ptr,1);const error_string=that.module_wrapper.fc_solve_Pointer_stringify(error_string_ptr);throw that.module_wrapper.c_free(error_string_ptr),alert(error_string+"\n"),"Foo"}if(solve_err_code===exports.FCS_STATE_SUSPEND_PROCESS)return that.current_iters_limit>=131072?void that.set_status("exceeded","Iterations count exceeded at "+that.current_iters_limit):void that.set_status("running","Running ("+that.current_iters_limit+" iterations)");if(solve_err_code!==exports.FCS_STATE_WAS_SOLVED){if(1!==solve_err_code)throw alert("Unknown Error code "+solve_err_code+"!"),"Foo";that.set_status("impossible","Could not solve.")}else that.set_status("solved","Solved")}resume_solution(){this._increase_iters_limit();const solve_err_code=this.module_wrapper.user_resume_solution(this.obj);return this.handle_err_code(solve_err_code),solve_err_code}do_solve(proto_board_string){const that=this;that.set_status("running","Running");try{that._increase_iters_limit();const board_string=that._process_board_string(proto_board_string),solve_err_code=that.module_wrapper.user_solve_board(that.obj,board_string);return that.handle_err_code(solve_err_code),solve_err_code}catch(e){return void that.set_status("error","Error")}}unicode_preprocess(out_buffer,display){return display.unicode_preprocess(out_buffer)}display_solution(args){const that=this,displayer=args.displayer;let ret;try{that._calc_states_and_moves_seq(),that.set_status("solved","Solved"),ret=that._display_specific_sol(that._pre_expand_states_and_moves_seq,displayer)}catch(e){return}return ret}display_expanded_moves_solution(args){return this._calc_expanded_seq(),this.set_status("solved","Solved"),this._display_specific_sol(this._post_expand_states_and_moves_seq,args.displayer)}calc_expanded_move(idx){const states_and_moves_sequence=this.proto_states_and_moves_seq;return states_and_moves_sequence[idx].exp||(states_and_moves_sequence[idx].exp=(0,web_fc_solve__expand_moves_1.fc_solve_expand_move)(8,4,states_and_moves_sequence[idx-1].str,states_and_moves_sequence[idx].m,states_and_moves_sequence[idx+1].str)),states_and_moves_sequence[idx].exp}generic_display_sol(args){return args.expand?this.display_expanded_moves_solution(args):this.display_solution(args)}get_num_freecells(){return this.module_wrapper.user_get_num_freecells(this.obj)}get_num_stacks(){return this.module_wrapper.user_get_num_stacks(this.obj)}_calc_states_and_moves_seq(){const that=this;if(that._pre_expand_states_and_moves_seq)return;const states_and_moves_sequence=[];function _out_state(s){states_and_moves_sequence.push({type:"s",str:s})}function get_state_str(){return that.module_wrapper.user_current_state_stringify(that.obj,that._state_string_buffer,1,0,1),that.module_wrapper.fc_solve_Pointer_stringify(that._state_string_buffer)}let move_ret_code;_out_state(get_state_str());const move_buffer=that.module_wrapper.alloc_wrap(128,"a buffer for the move","maven");for(;0===(move_ret_code=that.module_wrapper.user_get_next_move(that.obj,move_buffer));){const state_as_string=get_state_str();that.module_wrapper.user_stringify_move_ptr(that.obj,that._move_string_buffer,move_buffer,0);const move_as_string=that.module_wrapper.fc_solve_Pointer_stringify(that._move_string_buffer);states_and_moves_sequence.push({exp:null,is_exp:!1,m:{str:move_as_string,type:"m"},type:"m"}),_out_state(state_as_string)}that.proto_states_and_moves_seq=states_and_moves_sequence,that._pre_expand_states_and_moves_seq=states_and_moves_sequence.map((item=>"m"===item.type?item.m:item)),that._post_expand_states_and_moves_seq=null,that.module_wrapper.c_free(move_buffer),that.module_wrapper.user_free(that.obj),that.obj=0,that.module_wrapper.c_free(that._state_string_buffer),that._state_string_buffer=0,that.module_wrapper.c_free(that._move_string_buffer),that._move_string_buffer=0}_calc_expanded_seq(){const that=this;if(that._post_expand_states_and_moves_seq)return;that._calc_states_and_moves_seq();const states_and_moves_sequence=that.proto_states_and_moves_seq,new_array=[states_and_moves_sequence[0]];for(let i=1;i[]));let deck=(0,prange_1.perl_range)(0,51);randomizer.shuffle(deck),deck=deck.reverse();for(let i=0;i<52;i++)columns[i%8].push(deck[i]);function render_card(card){const suit=card%4,rank=Math.floor(card/4);return"A23456789TJQK".charAt(rank)+"CDHS".charAt(suit)}return columns.map((function(col){return": "+col.map(render_card).join(" ")+"\n"})).join("")};class MSRand{constructor(args){this.module_wrapper=args.module_wrapper,this.gamenumber=args.gamenumber,this.rander=this.module_wrapper.ms_rand__get_singleton(),this.module_wrapper.ms_rand__init(this.rander,""+this.gamenumber)}max_rand(mymax){return this.module_wrapper.ms_rand__mod_rand(this.rander,mymax)}shuffle(deck){if(deck.length){let i=deck.length;for(;--i;){const j=this.max_rand(i+1),tmp=deck[i];deck[i]=deck[j],deck[j]=tmp}}return deck}}})); \ No newline at end of file +YUI.add("breakout",(function(Y){function Breakout(config){var rows=config.rows,columns=config.columns;this._host=config.host,this._container=Y.Node.create("
"),this._nodes=[],rows||columns||(rows=8),this._rows=rows,this._columns=columns,Breakout.superclass.constructor.apply(this,arguments)}Breakout.NS="breakout",Breakout.Name="Breakout",Y.extend(Breakout,Y.Plugin.Base,{_splitNode:function(){var r,c,x,y,host,row,width=Math.round(this._blockWidth),height=Math.round(this._blockHeight),rows=this._rows,columns=this._columns,origin=this._host.getXY(),container=this._container,nodes=this._nodes=[],mask=Y.Node.create('
');for(container.setXY(origin),r=0;r-1&&(VERSION="3.5.0"),proto={applyConfig:function(o){o=o||NOOP;var attr,name,config=this.config,mods=config.modules,groups=config.groups,aliases=config.aliases,loader=this.Env._loader;for(name in o)o.hasOwnProperty(name)&&(attr=o[name],mods&&"modules"==name?clobber(mods,attr):aliases&&"aliases"==name?clobber(aliases,attr):groups&&"groups"==name?clobber(groups,attr):"win"==name?(config[name]=attr&&attr.contentWindow||attr,config.doc=config[name]?config[name].document:null):"_yuid"==name||(config[name]=attr));loader&&loader._config(o)},_config:function(o){this.applyConfig(o)},_init:function(){var filter,el,prop,Y=this,G_ENV=YUI.Env,Env=Y.Env;if(Y.version=VERSION,!Env){if(Y.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:BASE,cdn:BASE+VERSION+"/",_idx:0,_used:{},_attached:{},_exported:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(src,pattern){var path,filter,match=src.match(pattern);return match&&(path=RegExp.leftContext||src.slice(0,src.indexOf(match[0])),filter=match[3],match[1]&&(path+="?"+match[1]),path={filter:filter,path:path}),path},getBase:G_ENV&&G_ENV.getBase||function(pattern){var parsed,i,len,src,nodes=doc&&doc.getElementsByTagName("script")||[],path=Env.cdn;for(i=0,len=nodes.length;i
',YUI.Env.cssStampEl=el.firstChild,doc.body?doc.body.appendChild(YUI.Env.cssStampEl):docEl.insertBefore(YUI.Env.cssStampEl,docEl.firstChild)):doc&&doc.getElementById("yui3-css-stamp")&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=doc.getElementById("yui3-css-stamp")),Y.config.lang=Y.config.lang||"en-US",Y.config.base=YUI.config.base||YUI.config.defaultBase&&YUI.config.root&&YUI.config.defaultBase+YUI.config.root||Y.Env.getBase(Y.Env._BASE_RE),filter&&"mindebug".indexOf(filter)||(filter="min"),filter=filter?"-"+filter:filter,Y.config.loaderPath=YUI.config.loaderPath||"loader/loader"+filter+".js"},_afterConfig:function(){this.config.hasOwnProperty("global")||(this.config.global=Function("return this")())},_setup:function(){var i,Y=this,core=[],mods=YUI.Env.mods,extendedCore=Y.config.extendedCore||[],extras=Y.config.core||[].concat(YUI.Env.core).concat(extendedCore);for(i=0;i-1)for(j="YAHOO"==(d=arg.split("."))[0]?1:0;j-1?value(o,key):o[key];return void 0===val?match:val})):s},L.trim=L._isNative(STRING_PROTO.trim)&&!WHITESPACE.trim()?function(s){return s&&s.trim?s.trim():s}:function(s){try{return s.replace(TRIMREGEX,"")}catch(e){return s}},L.trimLeft=L._isNative(STRING_PROTO.trimLeft)&&!WHITESPACE.trimLeft()?function(s){return s.trimLeft()}:function(s){return s.replace(TRIM_LEFT_REGEX,"")},L.trimRight=L._isNative(STRING_PROTO.trimRight)&&!WHITESPACE.trimRight()?function(s){return s.trimRight()}:function(s){return s.replace(TRIM_RIGHT_REGEX,"")},L.type=function(o){return TYPES[typeof o]||TYPES[TOSTRING.call(o)]||(o?"object":"null")};var Lang=Y.Lang,Native=Array.prototype,hasOwn=Object.prototype.hasOwnProperty;function YArray(thing,startIndex,force){var len,result;if(startIndex||(startIndex=0),force||YArray.test(thing))try{return Native.slice.call(thing,startIndex)}catch(ex){for(result=[],len=thing.length;startIndexi&&i in values)||values[i]);return hash},YArray.indexOf=Lang._isNative(Native.indexOf)?function(array,value,from){return Native.indexOf.call(array,value,from)}:function(array,value,from){var len=array.length;for((from=((from=+from||0)>0||-1)*Math.floor(Math.abs(from)))<0&&(from+=len)<0&&(from=0);from1?Array.prototype.join.call(arguments,"__"):String(arg);return(!(key in cache)||refetch&&cache[key]==refetch)&&(cache[key]=source.apply(source,arguments)),cache[key]}},Y.getLocation=function(){var win=Y.config.win;return win&&win.location},Y.merge=function(){for(var key,obj,i=0,len=arguments.length,result={};i-1},O.each=function(obj,fn,thisObj,proto){var key;for(key in obj)(proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj);return Y},O.some=function(obj,fn,thisObj,proto){var key;for(key in obj)if((proto||owns(obj,key))&&fn.call(thisObj||Y,obj[key],key,obj))return!0;return!1},O.getValue=function(o,path){if(Lang.isObject(o)){var i,p=Y.Array(path),l=p.length;for(i=0;undefined!==o&&i=0){for(i=0;undefined!==ref&&i0),subUA||("object"==typeof process&&process.versions&&process.versions.node&&(o.os=process.platform,o.nodejs=numberify(process.versions.node)),YUI.Env.UA=o),o},Y.UA=YUI.Env.UA||YUI.Env.parseUA(),Y.UA.compareVersions=function(a,b){var aPart,aParts,bPart,bParts,i,len;if(a===b)return 0;for(aParts=(a+"").split("."),bParts=(b+"").split("."),i=0,len=Math.max(aParts.length,bParts.length);ibPart)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],"loader-pathogen-encoder":["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",(function(Y,NAME){var CUSTOM_ATTRS,Get,Transaction,Lang=Y.Lang;Y.Get=Get={cssOptions:{attributes:{rel:"stylesheet"},doc:Y.config.linkDoc||Y.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:Y.config.scriptDoc||Y.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(transaction){var i,id,item,len,pending;if(Y.log("`Y.Get.abort()` is deprecated as of 3.5.0. Use the `abort()` method on the transaction instead.","warn","get"),!transaction.abort)if(id=transaction,transaction=null,(pending=this._pending)&&pending.transaction.id===id)transaction=pending.transaction,this._pending=null;else for(i=0,len=this._queue.length;i=threshold&&(Y.log("autopurge triggered after "+this._purgeNodes.length+" nodes","info","get"),this._purge(this._purgeNodes))},_getEnv:function(){var doc=Y.config.doc,ua=Y.UA;return this._env={async:doc&&!0===doc.createElement("script").async||ua.ie>=10,cssFail:ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0,cssLoad:(!ua.gecko&&!ua.webkit||ua.gecko>=9||ua.compareVersions(ua.webkit,535.24)>=0)&&!(ua.chrome&&ua.chrome<=18),preservesScriptOrder:!!(ua.gecko||ua.opera||ua.ie&&ua.ie>=10)}},_getTransaction:function(urls,options){var i,len,req,url,requests=[];for(Lang.isArray(urls)||(urls=[urls]),(options=Y.merge(this.options,options)).attributes=Y.merge(this.options.attributes,options.attributes),i=0,len=urls.length;i-1&&purgeNodes.splice(index,1))}},Get.script=Get.js,Get.Transaction=Transaction=function(requests,options){this.id=Transaction._lastId+=1,this.data=options.data,this.errors=[],this.nodes=[],this.options=options,this.requests=requests,this._callbacks=[],this._queue=[],this._reqsWaiting=0,this.tId=this.id,this.win=options.win||Y.config.win},Transaction._lastId=0,Transaction.prototype={_state:"new",abort:function(msg){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:msg||"Aborted"}),this._finish()},execute:function(callback){var i,len,queue,req,self=this,requests=self.requests,state=self._state;if("done"!==state){if(callback&&self._callbacks.push(callback),"executing"!==state){for(self._state="executing",self._queue=queue=[],self.options.timeout&&(self._timeout=setTimeout((function(){self.abort("Timeout")}),self.options.timeout)),self._reqsWaiting=requests.length,i=0,len=requests.length;i=10?(node.onerror=function(){setTimeout(onError,0)},node.onload=function(){setTimeout(onLoad,0)}):(node.onerror=onError,node.onload=onLoad),env.cssFail||isScript||(cssTimeout=setTimeout(onError,req.timeout||3e3))):this._poll(req),this.nodes.push(node),insertBefore.parentNode.insertBefore(node,insertBefore)},_next:function(){this._pending||(this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish())},_poll:function(newReq){var i,j,nodeHref,req,sheets,self=this,pendingCSS=self._pendingCSS,isWebKit=Y.UA.webkit;if(!newReq||(pendingCSS||(pendingCSS=self._pendingCSS=[]),pendingCSS.push(newReq),!self._pollTimer)){for(self._pollTimer=null,i=0;i=0;)if(sheets[j].href===nodeHref){pendingCSS.splice(i,1),i-=1,self._progress(null,req);break}}else try{!!req.node.sheet.cssRules,pendingCSS.splice(i,1),i-=1,self._progress(null,req)}catch(ex){}pendingCSS.length&&(self._pollTimer=setTimeout((function(){self._poll.call(self)}),self.options.pollInterval))}},_progress:function(err,req){var options=this.options;err&&(req.error=err,this.errors.push({error:err,request:req}),Y.log(err,"error","get")),req.node._yuiget_finished=req.finished=!0,options.onProgress&&options.onProgress.call(options.context||this,this._getEventData(req)),req.autopurge&&(Get._autoPurge(this.options.purgethreshold),Get._purgeNodes.push(req.node)),this._pending===req&&(this._pending=null),this._reqsWaiting-=1,this._next()}}}),"3.18.1",{requires:["yui-base"]}),YUI.add("features",(function(Y,NAME){var feature_tests={};Y.mix(Y.namespace("Features"),{tests:feature_tests,add:function(cat,name,o){feature_tests[cat]=feature_tests[cat]||{},feature_tests[cat][name]=o},all:function(cat,args){var cat_o=feature_tests[cat],result=[];return cat_o&&Y.Object.each(cat_o,(function(v,k){result.push(k+":"+(Y.Features.test(cat,k,args)?1:0))})),result.length?result.join(";"):""},test:function(cat,name,args){args=args||[];var result,ua,test,cat_o=feature_tests[cat],feature=cat_o&&cat_o[name];return feature?(result=feature.result,Y.Lang.isUndefined(result)&&((ua=feature.ua)&&(result=Y.UA[ua]),!(test=feature.test)||ua&&!result||(result=test.apply(Y,args)),feature.result=result)):Y.log("Feature test "+cat+", "+name+" not found"),result}});var add=Y.Features.add;add("load","0",{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"}),add("load","1",{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"}),add("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),add("load","3",{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"}),add("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),add("load","5",{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"}),add("load","6",{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","7",{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}),add("load","8",{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","9",{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}),add("load","10",{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","11",{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}),add("load","12",{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"}),add("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),add("load","14",{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"}),add("load","15",{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"}),add("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),add("load","17",{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"}),add("load","18",{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"}),add("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),add("load","20",{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"}),add("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs"}),add("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs"})}),"3.18.1",{requires:["yui-base"]}),YUI.add("intl-base",(function(Y,NAME){var SPLIT_REGEX=/[, ]/;Y.mix(Y.namespace("Intl"),{lookupBestLang:function(preferredLanguages,availableLanguages){var i,language,result,index;function scan(language){var i;for(i=0;i0;){if(result=scan(language))return result;if(!((index=language.lastIndexOf("-"))>=0))break;language=language.substring(0,index),index>=2&&"-"===language.charAt(index-2)&&(language=language.substring(0,index-2))}return""}})}),"3.18.1",{requires:["yui-base"]}),YUI.add("yui-log",(function(Y,NAME){var INSTANCE=Y,LEVELS={debug:1,info:2,warn:4,error:8};INSTANCE.log=function(msg,cat,src,silent){var bail,excl,incl,m,f,minlevel,Y=INSTANCE,c=Y.config,publisher=Y.fire?Y:YUI.Env.globalEvents;return c.debug&&(void 0!==(src=src||"")&&(excl=c.logExclude,(incl=c.logInclude)&&!(src in incl)?bail=1:incl&&src in incl?bail=!incl[src]:excl&&src in excl&&(bail=excl[src]),void 0===cat&&(cat="info"),Y.config.logLevel=Y.config.logLevel||"debug",minlevel=LEVELS[Y.config.logLevel.toLowerCase()],cat in LEVELS&&LEVELS[cat]-1,this.comboSep="&",this.maxURLLength=1024,this.ignoreRegistered=o.ignoreRegistered,this.root=Y.Env.meta.root,this.timeout=0,this.forceMap={},this.allowRollup=!1,this.filters={},this.required={},this.patterns={},this.moduleInfo={},this.groups=Y.merge(Y.Env.meta.groups),this.skin=Y.merge(Y.Env.meta.skin),this.conditions={},this.config=o,this._internal=!0,this._populateConditionsCache(),this.loaded=GLOBAL_LOADED[VERSION],this.async=!0,this._inspectPage(),this._internal=!1,this._config(o),this.forceMap=this.force?Y.Array.hash(this.force):{},this.testresults=null,Y.config.tests&&(this.testresults=Y.config.tests),this.sorted=[],this.dirty=!0,this.inserted={},this.skipped={},this.tested={},this.ignoreRegistered&&this._resetModules()},Y.Loader.prototype={getModuleInfo:function(name){var rawMetaModules,globalRenderedMods,internal,v,m=this.moduleInfo[name];return m||(rawMetaModules=META.modules,globalRenderedMods=GLOBAL_ENV._renderedMods,internal=this._internal,globalRenderedMods&&globalRenderedMods.hasOwnProperty(name)&&!this.ignoreRegistered?this.moduleInfo[name]=Y.merge(globalRenderedMods[name]):rawMetaModules.hasOwnProperty(name)&&(this._internal=!0,(v=this.addModule(rawMetaModules[name],name))&&v.type===CSS&&this.isCSSLoaded(v.name,!0)&&(Y.log("Found CSS module on page: "+v.name,"info","loader"),this.loaded[v.name]=!0),this._internal=internal),this.moduleInfo[name])},_expandAliases:function(list){var i,name,expanded=[],aliases=YUI.Env.aliases;for(list=Y.Array(list),i=0;i-1&&(skinpar=i);if(skindef&&(skindef[name]||skinpar&&skindef[skinpar]))for(skinname=name,skindef[skinpar]&&(skinname=skinpar),i=0;i-1},getModule:function(mname){if(!mname)return null;var p,found,pname,m=this.getModuleInfo(mname),patterns=this.patterns;if(!m||m&&m.ext)for(pname in patterns)if(patterns.hasOwnProperty(pname)&&((p=patterns[pname]).test||(p.test=this._patternTest),p.test(mname,pname))){found=p;break}return m?found&&m&&found.configFn&&!m.configFn&&(m.configFn=found.configFn,m.configFn(m)):found&&(p.action?p.action.call(this,mname,pname):(Y.log("Undefined module: "+mname+", matched a pattern: "+pname,"info","loader"),(m=this.addModule(Y.merge(found,{test:void 0,temp:!0}),mname))&&found.configFn&&(m.configFn=found.configFn))),m},_rollup:function(){},_reduce:function(r){r=r||this.required;var i,j,s,m,type=this.loadType,ignore=!!this.ignore&&yArray.hash(this.ignore);for(i in r)if(r.hasOwnProperty(i)&&(m=this.getModule(i),((this.loaded[i]||ON_PAGE[i])&&!this.forceMap[i]&&!this.ignoreRegistered||type&&m&&m.type!==type)&&delete r[i],ignore&&ignore[i]&&delete r[i],s=m&&m.supersedes))for(j=0;j0&&(_queue.running=!0,_queue.next()())},insert:function(o,type,skipsort){Y.log("public insert() "+(type||"")+", "+Y.Object.keys(this.required),"info","loader");var self=this,copy=Y.merge(this);delete copy.require,delete copy.dirty,_queue.add((function(){self._insert(copy,o,type,skipsort)})),this._continue()},loadNext:function(){Y.log("loadNext was called..","error","loader")},_filter:function(u,name,group){var f=this.filter,hasFilter=name&&name in this.filters,modFilter=hasFilter&&this.filters[name],groupName=group||(this.getModuleInfo(name)||{}).group||null;return groupName&&this.groups[groupName]&&this.groups[groupName].filter&&(modFilter=this.groups[groupName].filter,hasFilter=!0),u&&(hasFilter&&(f=L.isString(modFilter)?this.FILTER_DEFS[modFilter.toUpperCase()]||null:modFilter),f&&(u=u.replace(new RegExp(f.searchExp,"g"),f.replaceStr))),u},_url:function(path,name,base){return this._filter((base||this.base||"")+path,name)},resolve:function(calc,sorted){var addSingle,self=this,resolved={js:[],jsMods:[],css:[],cssMods:[]},usePathogen=Y.config.comboLoader&&Y.config.customComboBase;(self.skin.overrides||"sam"!==self.skin.defaultSkin||self.ignoreRegistered)&&self._resetModules(),calc&&self.calculate(),sorted=sorted||self.sorted,addSingle=function(mod){if(mod){var url,group=mod.group&&self.groups[mod.group]||NOT_FOUND;!1===group.async&&(mod.async=group.async),url=mod.fullpath?self._filter(mod.fullpath,mod.name):self._url(mod.path,mod.name,group.base||mod.base),(mod.attributes||!1===mod.async)&&(url={url:url,async:mod.async},mod.attributes&&(url.attributes=mod.attributes)),resolved[mod.type].push(url),resolved[mod.type+"Mods"].push(mod)}else Y.log("Undefined Module","warn","loader")};var comboSources,maxURLLength,comboMeta,comboBase,comboSep,group,mod,len,i,inserted=self.ignoreRegistered?{}:self.inserted,hasComboModule=!1;for(i=0,len=sorted.length;imaxURLLength){for(Y.log("Exceeded maxURLLength ("+maxURLLength+") for "+type+", splitting","info","loader"),fragSubset=[],i=0,len=frags.length;imaxURLLength&&(frag=fragSubset.pop(),tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)),fragSubset=[],frag&&fragSubset.push(frag));fragSubset.length&&(tmpBase=comboBase+fragSubset.join(comboSep),resolved[type].push(this._filter(tmpBase,null,comboMeta.group)))}else resolved[type].push(this._filter(tmpBase,null,comboMeta.group))}return resolved},load:function(cb){if(cb){var self=this,out=self.resolve(!0);self.data=out,self.onEnd=function(){cb.apply(self.context||self,arguments)},self.insert()}else Y.log("No callback supplied to load()","error","loader")}}}),"3.18.1",{requires:["get","features"]}),YUI.add("loader-rollup",(function(Y,NAME){Y.Loader.prototype._rollup=function(){var i,j,m,s,roll,rolled,c,smod,r=this.required,info=this.moduleInfo;if(this.dirty||!this.rollups)for(i in this.rollups={},info)info.hasOwnProperty(i)&&(m=this.getModule(i))&&m.rollup&&(this.rollups[i]=m);for(;;){for(i in rolled=!1,this.rollups)if(this.rollups.hasOwnProperty(i)&&!r[i]&&(!this.loaded[i]||this.forceMap[i])){if(s=(m=this.getModule(i)).supersedes||[],roll=!1,!m.rollup)continue;for(c=0,j=0;j=m.rollup))break}roll&&(r[i]=!0,rolled=!0,this.getRequires(m))}if(!rolled)break}}}),"3.18.1",{requires:["loader-base"]}),YUI.add("loader-yui3",(function(Y,NAME){YUI.Env[Y.version].modules=YUI.Env[Y.version].modules||{},Y.mix(YUI.Env[Y.version].modules,{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style","color-base"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","model-sync-local","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(Y){var doc=Y.config.doc,node=doc?doc.documentElement:null;return!(!node||!node.style)&&("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-observable","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{use:["attribute-observable"]},"attribute-extras":{requires:["oop"]},"attribute-observable":{requires:["event-custom"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en","es","hu","it"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(Y){return!(Y.UA.ios||Y.UA.android)},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},axes:{use:["axis-numeric","axis-category","axis-time","axis-stacked"]},"axes-base":{use:["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"]},axis:{requires:["dom","widget","widget-position","widget-stack","graphics","axis-base"]},"axis-base":{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]},"axis-category":{requires:["axis","axis-category-base"]},"axis-category-base":{requires:["axis-base"]},"axis-numeric":{requires:["axis","axis-numeric-base"]},"axis-numeric-base":{requires:["axis-base"]},"axis-stacked":{requires:["axis-numeric","axis-stacked-base"]},"axis-stacked-base":{requires:["axis-numeric-base"]},"axis-time":{requires:["axis","axis-time-base"]},"axis-time-base":{requires:["axis-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{requires:["attribute-base","base-core","base-observable"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-observable":{requires:["attribute-observable","base-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base","escape"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","es","es-AR","fr","hu","it","ja","nb-NO","nl","pt-BR","ru","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-HANT-TW"],requires:["widget","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0},charts:{use:["charts-base"]},"charts-base":{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},color:{use:["color-base","color-hsl","color-harmony"]},"color-base":{requires:["yui-base"]},"color-harmony":{requires:["color-hsl"]},"color-hsl":{requires:["color-base"]},"color-hsv":{requires:["color-base"]},console:{lang:["en","es","hu","it","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},"content-editable":{requires:["node-base","editor-selection","stylesheet","plugin"]},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssnormalize"],type:"css"},"cssgrids-base":{optional:["cssnormalize"],type:"css"},"cssgrids-responsive":{optional:["cssnormalize"],requires:["cssgrids","cssgrids-responsive-base"],type:"css"},"cssgrids-units":{optional:["cssnormalize"],requires:["cssgrids-base"],type:"css"},cssnormalize:{type:"css"},"cssnormalize-context":{type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-foot":{requires:["datatable-core","view"]},"datatable-formatters":{requires:["datatable-body","datatype-number-format","datatype-date-format","escape"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-highlight":{requires:["datatable-base","event-hover"],skinnable:!0},"datatable-keynav":{requires:["datatable-base"]},"datatable-message":{lang:["en","fr","es","hu","it"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-paginator":{lang:["en","fr"],requires:["model","view","paginator-core","datatable-foot","datatable-paginator-templates"],skinnable:!0},"datatable-paginator-templates":{requires:["template"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-sort":{lang:["en","fr","es","hu"],requires:["datatable-base"],skinnable:!0},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","hu","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{requires:["escape"]},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base","selector-css2"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es","hu"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(Y){var testFeature=Y.Features.test,addFeature=Y.Features.add,WINDOW=Y.config.win,DOCUMENT=Y.config.doc;return addFeature("style","computedStyle",{test:function(){return WINDOW&&"getComputedStyle"in WINDOW}}),addFeature("style","opacity",{test:function(){return DOCUMENT&&"opacity"in DOCUMENT.documentElement.style}}),!testFeature("style","opacity")&&!testFeature("style","computedStyle")},trigger:"dom-style"},requires:["dom-style","color-base"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-inline":{requires:["editor-base","content-editable"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(Y){var imp=Y.config.doc&&Y.config.doc.implementation;return imp&&!imp.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","plugin","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(Y){var DOCUMENT=Y.config.doc,useCanvas=Y.config.defaultGraphicEngine&&"canvas"==Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return(!(DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))||useCanvas)&&canvas&&canvas.getContext&&canvas.getContext("2d")},trigger:"graphics"}},"graphics-group":{requires:["graphics"]},"graphics-svg":{condition:{name:"graphics-svg",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(Y){var DOCUMENT=Y.config.doc,useSVG=!Y.config.defaultGraphicEngine||"canvas"!=Y.config.defaultGraphicEngine,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(useSVG||!canvas)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"},requires:["graphics","color-base"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(Y){var DOCUMENT=Y.config.doc,canvas=DOCUMENT&&DOCUMENT.createElement("canvas");return DOCUMENT&&!DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!canvas||!canvas.getContext||!canvas.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(Y){var docMode=Y.config.doc&&Y.config.doc.documentMode;return Y.UA.ie&&(!("onhashchange"in Y.config.win)||!docMode||docMode<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONParse&&!!Native;if(nativeSupport)try{nativeSupport=Native.parse('{"ok":false}',(function(k,v){return"ok"===k||v})).ok}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(Y){var _JSON=Y.config.global.JSON,Native="[object JSON]"===Object.prototype.toString.call(_JSON)&&_JSON,nativeSupport=!1!==Y.config.useNativeJSONStringify&&!!Native;if(nativeSupport)try{nativeSupport="0"===Native.stringify(0)}catch(e){nativeSupport=!1}return!nativeSupport},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-pathogen-combohandler":{},"loader-pathogen-encoder":{use:["loader-base","loader-rollup","loader-yui3","loader-pathogen-combohandler"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-local":{requires:["model","json-stringify"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base","dom-style"]},"node-core":{requires:["dom-core","selector"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["array-extras","base-build","event-resize","node-pluginhost","plugin","selector"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},paginator:{requires:["paginator-core"]},"paginator-core":{requires:["base"]},"paginator-url":{requires:["paginator"]},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(Y){var DOCUMENT=Y.config.doc;return DOCUMENT&&!("querySelectorAll"in DOCUMENT)},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(Y){var DOCUMENT=Y.config.doc,node=DOCUMENT?DOCUMENT.documentElement:null,ret=!0;return node&&node.style&&(ret=!("MozTransition"in node.style||"WebkitTransition"in node.style||"transition"in node.style)),ret},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swfdetect","escape","widget","base","cssbutton","node","event-custom","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(Y){return!Y.UA.nodejs&&!Y.UA.winjs},trigger:"yql"},requires:["yql","jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs"},requires:["yql"]},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs"},requires:["yql"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[Y.version].md5="2fd2be6b12ee9f999b4367499ae61aae"}),"3.18.1",{requires:["loader-base"]}),YUI.add("yui",(function(Y,NAME){}),"3.18.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){var i;if(e)for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,(function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))})),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),(function(e){t=t[e]})),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function i(e,i,r){var o,a,s,u,c,d,p,f,l,h,g=i&&i.split("/"),v=y.map,x=v&&v["*"];if(e&&(d=(e=e.split("/")).length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[d])&&(e[d]=e[d].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),function(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}(e),e=e.join("/")),r&&v&&(g||x)){e:for(s=(a=e.split("/")).length;s>0;s-=1){if(c=a.slice(0,s).join("/"),g)for(u=g.length;u>0;u-=1)if((o=getOwn(v,g.slice(0,u).join("/")))&&(o=getOwn(o,c))){p=o,f=s;break e}!l&&x&&getOwn(x,c)&&(l=getOwn(x,c),h=s)}!p&&l&&(p=l,f=h),p&&(a.splice(0,f,p),e=a.join("/"))}return getOwn(y.pkgs,e)||e}function r(e){isBrowser&&each(scripts(),(function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0}))}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),d=(c=o(e))[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=s&&s.normalize?s.normalize(e,(function(e){return i(e,p,n)})):-1===e.indexOf("!")?i(e,p,n):e:(d=(c=o(h=i(e,p,n)))[0],h=c[1],r=!0,a=q.nameToUrl(h))),{prefix:d,name:h,parentMap:t,unnormalized:!!(u=!d||s||r?"":"_unnormalized"+(A+=1)),url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,(function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))})),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,(function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)})),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,(function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))})),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,(function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1})),o&&a.length)return(e=makeError("timeout","Load timeout for modules: "+a,null,a)).contextName=q.contextName,c(e);d&&each(s,(function(e){f(e,{},{})})),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout((function(){w=0,l()}),50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(null===(e=O.shift())[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,(function(e){this.emit("error",e)}))),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;return this.shim?void q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return e.prefix?this.callPlugin():this.load()}))):e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((t=this.module)?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,(function(e){a.push(e.normalizedMap||e)})),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,(function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,(function(e){return i(e,h,!0)}))||""),u(o=a(e.prefix+"!"+l,this.map.parentMap),"defined",bind(this,(function(e){this.map.normalizedMap=o,this.init([],(function(){return e}),null,{enabled:!0,ignore:!0})}))),void((d=getOwn(S,o.id))&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,(function(e){this.emit("error",e)}))),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):(n=bind(this,(function(e){this.init([],(function(){return e}),null,{enabled:!0})})),n.error=bind(this,(function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,(function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)})),c(e)})),n.fromText=bind(this,(function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)})),void r.load(e.name,m,n,y))}))),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,(function(e){this.undefed||(this.defineDep(t,e),this.check())}))),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,(function(e){this.emit("error",e)})))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)}))),eachProp(this.pluginMaps,bind(this,(function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)}))),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],(function(e){e(t)})),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(-1===i.indexOf("?")?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,(function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e})),e.bundles&&eachProp(e.bundles,(function(e,t){each(e,(function(e){e!==t&&(R[e]=t)}))})),e.shim&&(eachProp(e.shim,(function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e})),y.shim=i),e.packages&&each(e.packages,(function(e){var i;i=(e="string"==typeof e?{name:e}:e).name,e.location&&(y.paths[i]=e.location),y.pkgs[i]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(S,(function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))})),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,n){function o(i,r,u){var d,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(d=a(i,t,!1,!0).id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick((function(){v(),(f=s(a(null,t))).skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()})),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0];return-1!==n&&(!("."===o||".."===o)||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,(function(t,i){t[0]===e&&O.splice(i,1)})),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){getOwn(S,e.id)&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(null===(i=O.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,o=(n=e.split("/")).length;o>0;o-=1)if(u=getOwn(r,n.slice(0,o).join("/"))){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s=("/"===(s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js")).charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,(function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,(function(e){if(e.id===t.id)return i.push(r),!0}))})),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(e){if("interactive"===e.readyState)return interactiveScript=e})),interactiveScript}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return(r=req.createNode(n,t,i)).setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(e,i){t.push(i)})),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&((r=currentlyAddingScript||getInteractiveScript())&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")])),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.2",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(match,singlePrefix){return singlePrefix||""}function isFunction(it){return"[object Function]"===ostring.call(it)}function isArray(it){return"[object Array]"===ostring.call(it)}function each(ary,func){var i;if(ary)for(i=0;i-1&&(!ary[i]||!func(ary[i],i,ary));i-=1);}function hasProp(obj,prop){return hasOwn.call(obj,prop)}function getOwn(obj,prop){return hasProp(obj,prop)&&obj[prop]}function eachProp(obj,func){var prop;for(prop in obj)if(hasProp(obj,prop)&&func(obj[prop],prop))break}function mixin(target,source,force,deepStringMixin){return source&&eachProp(source,(function(value,prop){!force&&hasProp(target,prop)||(!deepStringMixin||"object"!=typeof value||!value||isArray(value)||isFunction(value)||value instanceof RegExp?target[prop]=value:(target[prop]||(target[prop]={}),mixin(target[prop],value,force,deepStringMixin)))})),target}function bind(obj,fn){return function(){return fn.apply(obj,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(err){throw err}function getGlobal(value){if(!value)return value;var g=global;return each(value.split("."),(function(part){g=g[part]})),g}function makeError(id,msg,err,requireModules){var e=new Error(msg+"\nhttp://requirejs.org/docs/errors.html#"+id);return e.requireType=id,e.requireModules=requireModules,err&&(e.originalError=err),e}if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(deps,callback,errback,optional){var context,config,contextName=defContextName;return isArray(deps)||"string"==typeof deps||(config=deps,isArray(callback)?(deps=callback,callback=errback,errback=optional):deps=[]),config&&config.context&&(contextName=config.context),(context=getOwn(contexts,contextName))||(context=contexts[contextName]=req.s.newContext(contextName)),config&&context.configure(config),context.require(deps,callback,errback)},req.config=function(config){return req(config)},req.nextTick=void 0!==setTimeout?function(fn){setTimeout(fn,4)}:function(fn){fn()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],(function(prop){req[prop]=function(){var ctx=contexts[defContextName];return ctx.require[prop].apply(ctx,arguments)}})),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],baseElement=document.getElementsByTagName("base")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(config,moduleName,url){var node=config.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return node.type=config.scriptType||"text/javascript",node.charset="utf-8",node.async=!0,node},req.load=function(context,moduleName,url){var node,config=context&&context.config||{};if(isBrowser)return(node=req.createNode(config,moduleName,url)).setAttribute("data-requirecontext",context.contextName),node.setAttribute("data-requiremodule",moduleName),!node.attachEvent||node.attachEvent.toString&&node.attachEvent.toString().indexOf("[native code")<0||isOpera?(node.addEventListener("load",context.onScriptLoad,!1),node.addEventListener("error",context.onScriptError,!1)):(useInteractive=!0,node.attachEvent("onreadystatechange",context.onScriptLoad)),node.src=url,config.onNodeCreated&&config.onNodeCreated(node,config,moduleName,url),currentlyAddingScript=node,baseElement?head.insertBefore(node,baseElement):head.appendChild(node),currentlyAddingScript=null,node;if(isWebWorker)try{setTimeout((function(){}),0),importScripts(url),context.completeLoad(moduleName)}catch(e){context.onError(makeError("importscripts","importScripts failed for "+moduleName+" at "+url,e,[moduleName]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),(function(script){if(head||(head=script.parentNode),dataMain=script.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0})),define=function(name,deps,callback){var node,context;"string"!=typeof name&&(callback=deps,deps=name,name=null),isArray(deps)||(callback=deps,deps=null),!deps&&isFunction(callback)&&(deps=[],callback.length&&(callback.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,(function(match,dep){deps.push(dep)})),deps=(1===callback.length?["require"]:["require","exports","module"]).concat(deps))),useInteractive&&(node=currentlyAddingScript||getInteractiveScript())&&(name||(name=node.getAttribute("data-requiremodule")),context=contexts[node.getAttribute("data-requirecontext")]),context?(context.defQueue.push([name,deps,callback]),context.defQueueMap[name]=!0):globalDefQueue.push([name,deps,callback])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}function newContext(contextName){var inCheckLoaded,Module,context,handlers,checkLoadedTimeoutId,config={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},registry={},enabledRegistry={},undefEvents={},defQueue=[],defined={},urlFetched={},bundlesMap={},requireCounter=1,unnormalizedCounter=1;function normalize(name,baseName,applyMap){var mapValue,nameParts,i,j,nameSegment,lastIndex,foundMap,foundI,foundStarMap,starI,baseParts=baseName&&baseName.split("/"),map=config.map,starMap=map&&map["*"];if(name&&(lastIndex=(name=name.split("/")).length-1,config.nodeIdCompat&&jsSuffixRegExp.test(name[lastIndex])&&(name[lastIndex]=name[lastIndex].replace(jsSuffixRegExp,"")),"."===name[0].charAt(0)&&baseParts&&(name=baseParts.slice(0,baseParts.length-1).concat(name)),function(ary){var i,part;for(i=0;i0&&(ary.splice(i-1,2),i-=2)}}(name),name=name.join("/")),applyMap&&map&&(baseParts||starMap)){outerLoop:for(i=(nameParts=name.split("/")).length;i>0;i-=1){if(nameSegment=nameParts.slice(0,i).join("/"),baseParts)for(j=baseParts.length;j>0;j-=1)if((mapValue=getOwn(map,baseParts.slice(0,j).join("/")))&&(mapValue=getOwn(mapValue,nameSegment))){foundMap=mapValue,foundI=i;break outerLoop}!foundStarMap&&starMap&&getOwn(starMap,nameSegment)&&(foundStarMap=getOwn(starMap,nameSegment),starI=i)}!foundMap&&foundStarMap&&(foundMap=foundStarMap,foundI=starI),foundMap&&(nameParts.splice(0,foundI,foundMap),name=nameParts.join("/"))}return getOwn(config.pkgs,name)||name}function removeScript(name){isBrowser&&each(scripts(),(function(scriptNode){if(scriptNode.getAttribute("data-requiremodule")===name&&scriptNode.getAttribute("data-requirecontext")===context.contextName)return scriptNode.parentNode.removeChild(scriptNode),!0}))}function hasPathFallback(id){var pathConfig=getOwn(config.paths,id);if(pathConfig&&isArray(pathConfig)&&pathConfig.length>1)return pathConfig.shift(),context.require.undef(id),context.makeRequire(null,{skipMap:!0})([id]),!0}function splitPrefix(name){var prefix,index=name?name.indexOf("!"):-1;return index>-1&&(prefix=name.substring(0,index),name=name.substring(index+1,name.length)),[prefix,name]}function makeModuleMap(name,parentModuleMap,isNormalized,applyMap){var url,pluginModule,suffix,nameParts,prefix=null,parentName=parentModuleMap?parentModuleMap.name:null,originalName=name,isDefine=!0,normalizedName="";return name||(isDefine=!1,name="_@r"+(requireCounter+=1)),prefix=(nameParts=splitPrefix(name))[0],name=nameParts[1],prefix&&(prefix=normalize(prefix,parentName,applyMap),pluginModule=getOwn(defined,prefix)),name&&(prefix?normalizedName=pluginModule&&pluginModule.normalize?pluginModule.normalize(name,(function(name){return normalize(name,parentName,applyMap)})):-1===name.indexOf("!")?normalize(name,parentName,applyMap):name:(prefix=(nameParts=splitPrefix(normalizedName=normalize(name,parentName,applyMap)))[0],normalizedName=nameParts[1],isNormalized=!0,url=context.nameToUrl(normalizedName))),{prefix:prefix,name:normalizedName,parentMap:parentModuleMap,unnormalized:!!(suffix=!prefix||pluginModule||isNormalized?"":"_unnormalized"+(unnormalizedCounter+=1)),url:url,originalName:originalName,isDefine:isDefine,id:(prefix?prefix+"!"+normalizedName:normalizedName)+suffix}}function getModule(depMap){var id=depMap.id,mod=getOwn(registry,id);return mod||(mod=registry[id]=new context.Module(depMap)),mod}function on(depMap,name,fn){var id=depMap.id,mod=getOwn(registry,id);!hasProp(defined,id)||mod&&!mod.defineEmitComplete?(mod=getModule(depMap)).error&&"error"===name?fn(mod.error):mod.on(name,fn):"defined"===name&&fn(defined[id])}function onError(err,errback){var ids=err.requireModules,notified=!1;errback?errback(err):(each(ids,(function(id){var mod=getOwn(registry,id);mod&&(mod.error=err,mod.events.error&&(notified=!0,mod.emit("error",err)))})),notified||req.onError(err))}function takeGlobalQueue(){globalDefQueue.length&&(each(globalDefQueue,(function(queueItem){var id=queueItem[0];"string"==typeof id&&(context.defQueueMap[id]=!0),defQueue.push(queueItem)})),globalDefQueue=[])}function cleanRegistry(id){delete registry[id],delete enabledRegistry[id]}function breakCycle(mod,traced,processed){var id=mod.map.id;mod.error?mod.emit("error",mod.error):(traced[id]=!0,each(mod.depMaps,(function(depMap,i){var depId=depMap.id,dep=getOwn(registry,depId);!dep||mod.depMatched[i]||processed[depId]||(getOwn(traced,depId)?(mod.defineDep(i,defined[depId]),mod.check()):breakCycle(dep,traced,processed))})),processed[id]=!0)}function checkLoaded(){var err,usingPathFallback,waitInterval=1e3*config.waitSeconds,expired=waitInterval&&context.startTime+waitInterval<(new Date).getTime(),noLoads=[],reqCalls=[],stillLoading=!1,needCycleCheck=!0;if(!inCheckLoaded){if(inCheckLoaded=!0,eachProp(enabledRegistry,(function(mod){var map=mod.map,modId=map.id;if(mod.enabled&&(map.isDefine||reqCalls.push(mod),!mod.error))if(!mod.inited&&expired)hasPathFallback(modId)?(usingPathFallback=!0,stillLoading=!0):(noLoads.push(modId),removeScript(modId));else if(!mod.inited&&mod.fetched&&map.isDefine&&(stillLoading=!0,!map.prefix))return needCycleCheck=!1})),expired&&noLoads.length)return(err=makeError("timeout","Load timeout for modules: "+noLoads,null,noLoads)).contextName=context.contextName,onError(err);needCycleCheck&&each(reqCalls,(function(mod){breakCycle(mod,{},{})})),expired&&!usingPathFallback||!stillLoading||!isBrowser&&!isWebWorker||checkLoadedTimeoutId||(checkLoadedTimeoutId=setTimeout((function(){checkLoadedTimeoutId=0,checkLoaded()}),50)),inCheckLoaded=!1}}function callGetModule(args){hasProp(defined,args[0])||getModule(makeModuleMap(args[0],null,!0)).init(args[1],args[2])}function removeListener(node,func,name,ieName){node.detachEvent&&!isOpera?ieName&&node.detachEvent(ieName,func):node.removeEventListener(name,func,!1)}function getScriptData(evt){var node=evt.currentTarget||evt.srcElement;return removeListener(node,context.onScriptLoad,"load","onreadystatechange"),removeListener(node,context.onScriptError,"error"),{node:node,id:node&&node.getAttribute("data-requiremodule")}}function intakeDefines(){var args;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0])return onError(makeError("mismatch","Mismatched anonymous define() module: "+args[args.length-1]));callGetModule(args)}context.defQueueMap={}}return handlers={require:function(mod){return mod.require?mod.require:mod.require=context.makeRequire(mod.map)},exports:function(mod){if(mod.usingExports=!0,mod.map.isDefine)return mod.exports?defined[mod.map.id]=mod.exports:mod.exports=defined[mod.map.id]={}},module:function(mod){return mod.module?mod.module:mod.module={id:mod.map.id,uri:mod.map.url,config:function(){return getOwn(config.config,mod.map.id)||{}},exports:mod.exports||(mod.exports={})}}},(Module=function(map){this.events=getOwn(undefEvents,map.id)||{},this.map=map,this.shim=getOwn(config.shim,map.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0}).prototype={init:function(depMaps,factory,errback,options){options=options||{},this.inited||(this.factory=factory,errback?this.on("error",errback):this.events.error&&(errback=bind(this,(function(err){this.emit("error",err)}))),this.depMaps=depMaps&&depMaps.slice(0),this.errback=errback,this.inited=!0,this.ignore=options.ignore,options.enabled||this.enabled?this.enable():this.check())},defineDep:function(i,depExports){this.depMatched[i]||(this.depMatched[i]=!0,this.depCount-=1,this.depExports[i]=depExports)},fetch:function(){if(!this.fetched){this.fetched=!0,context.startTime=(new Date).getTime();var map=this.map;if(!this.shim)return map.prefix?this.callPlugin():this.load();context.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,(function(){return map.prefix?this.callPlugin():this.load()})))}},load:function(){var url=this.map.url;urlFetched[url]||(urlFetched[url]=!0,context.load(this.map.id,url))},check:function(){if(this.enabled&&!this.enabling){var err,cjsModule,id=this.map.id,depExports=this.depExports,exports=this.exports,factory=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(factory)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{exports=context.execCb(id,factory,depExports,exports)}catch(e){err=e}else exports=context.execCb(id,factory,depExports,exports);if(this.map.isDefine&&void 0===exports&&((cjsModule=this.module)?exports=cjsModule.exports:this.usingExports&&(exports=this.exports)),err)return err.requireMap=this.map,err.requireModules=this.map.isDefine?[this.map.id]:null,err.requireType=this.map.isDefine?"define":"require",onError(this.error=err)}else exports=factory;if(this.exports=exports,this.map.isDefine&&!this.ignore&&(defined[id]=exports,req.onResourceLoad)){var resLoadMaps=[];each(this.depMaps,(function(depMap){resLoadMaps.push(depMap.normalizedMap||depMap)})),req.onResourceLoad(context,this.map,resLoadMaps)}cleanRegistry(id),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(context.defQueueMap,id)||this.fetch()}},callPlugin:function(){var map=this.map,id=map.id,pluginMap=makeModuleMap(map.prefix);this.depMaps.push(pluginMap),on(pluginMap,"defined",bind(this,(function(plugin){var load,normalizedMap,normalizedMod,bundleId=getOwn(bundlesMap,this.map.id),name=this.map.name,parentName=this.map.parentMap?this.map.parentMap.name:null,localRequire=context.makeRequire(map.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(plugin.normalize&&(name=plugin.normalize(name,(function(name){return normalize(name,parentName,!0)}))||""),on(normalizedMap=makeModuleMap(map.prefix+"!"+name,this.map.parentMap),"defined",bind(this,(function(value){this.map.normalizedMap=normalizedMap,this.init([],(function(){return value}),null,{enabled:!0,ignore:!0})}))),void((normalizedMod=getOwn(registry,normalizedMap.id))&&(this.depMaps.push(normalizedMap),this.events.error&&normalizedMod.on("error",bind(this,(function(err){this.emit("error",err)}))),normalizedMod.enable()))):bundleId?(this.map.url=context.nameToUrl(bundleId),void this.load()):((load=bind(this,(function(value){this.init([],(function(){return value}),null,{enabled:!0})}))).error=bind(this,(function(err){this.inited=!0,this.error=err,err.requireModules=[id],eachProp(registry,(function(mod){0===mod.map.id.indexOf(id+"_unnormalized")&&cleanRegistry(mod.map.id)})),onError(err)})),load.fromText=bind(this,(function(text,textAlt){var moduleName=map.name,moduleMap=makeModuleMap(moduleName),hasInteractive=useInteractive;textAlt&&(text=textAlt),hasInteractive&&(useInteractive=!1),getModule(moduleMap),hasProp(config.config,id)&&(config.config[moduleName]=config.config[id]);try{req.exec(text)}catch(e){return onError(makeError("fromtexteval","fromText eval for "+id+" failed: "+e,e,[id]))}hasInteractive&&(useInteractive=!0),this.depMaps.push(moduleMap),context.completeLoad(moduleName),localRequire([moduleName],load)})),void plugin.load(map.name,localRequire,load,config))}))),context.enable(pluginMap,this),this.pluginMaps[pluginMap.id]=pluginMap},enable:function(){enabledRegistry[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,(function(depMap,i){var id,mod,handler;if("string"==typeof depMap){if(depMap=makeModuleMap(depMap,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=depMap,handler=getOwn(handlers,depMap.id))return void(this.depExports[i]=handler(this));this.depCount+=1,on(depMap,"defined",bind(this,(function(depExports){this.undefed||(this.defineDep(i,depExports),this.check())}))),this.errback?on(depMap,"error",bind(this,this.errback)):this.events.error&&on(depMap,"error",bind(this,(function(err){this.emit("error",err)})))}id=depMap.id,mod=registry[id],hasProp(handlers,id)||!mod||mod.enabled||context.enable(depMap,this)}))),eachProp(this.pluginMaps,bind(this,(function(pluginMap){var mod=getOwn(registry,pluginMap.id);mod&&!mod.enabled&&context.enable(pluginMap,this)}))),this.enabling=!1,this.check()},on:function(name,cb){var cbs=this.events[name];cbs||(cbs=this.events[name]=[]),cbs.push(cb)},emit:function(name,evt){each(this.events[name],(function(cb){cb(evt)})),"error"===name&&delete this.events[name]}},context={config:config,contextName:contextName,registry:registry,defined:defined,urlFetched:urlFetched,defQueue:defQueue,defQueueMap:{},Module:Module,makeModuleMap:makeModuleMap,nextTick:req.nextTick,onError:onError,configure:function(cfg){if(cfg.baseUrl&&"/"!==cfg.baseUrl.charAt(cfg.baseUrl.length-1)&&(cfg.baseUrl+="/"),"string"==typeof cfg.urlArgs){var urlArgs=cfg.urlArgs;cfg.urlArgs=function(id,url){return(-1===url.indexOf("?")?"?":"&")+urlArgs}}var shim=config.shim,objs={paths:!0,bundles:!0,config:!0,map:!0};eachProp(cfg,(function(value,prop){objs[prop]?(config[prop]||(config[prop]={}),mixin(config[prop],value,!0,!0)):config[prop]=value})),cfg.bundles&&eachProp(cfg.bundles,(function(value,prop){each(value,(function(v){v!==prop&&(bundlesMap[v]=prop)}))})),cfg.shim&&(eachProp(cfg.shim,(function(value,id){isArray(value)&&(value={deps:value}),!value.exports&&!value.init||value.exportsFn||(value.exportsFn=context.makeShimExports(value)),shim[id]=value})),config.shim=shim),cfg.packages&&each(cfg.packages,(function(pkgObj){var name;name=(pkgObj="string"==typeof pkgObj?{name:pkgObj}:pkgObj).name,pkgObj.location&&(config.paths[name]=pkgObj.location),config.pkgs[name]=pkgObj.name+"/"+(pkgObj.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")})),eachProp(registry,(function(mod,id){mod.inited||mod.map.unnormalized||(mod.map=makeModuleMap(id,null,!0))})),(cfg.deps||cfg.callback)&&context.require(cfg.deps||[],cfg.callback)},makeShimExports:function(value){return function(){var ret;return value.init&&(ret=value.init.apply(global,arguments)),ret||value.exports&&getGlobal(value.exports)}},makeRequire:function(relMap,options){function localRequire(deps,callback,errback){var id,requireMod;return options.enableBuildCallback&&callback&&isFunction(callback)&&(callback.__requireJsBuild=!0),"string"==typeof deps?isFunction(callback)?onError(makeError("requireargs","Invalid require call"),errback):relMap&&hasProp(handlers,deps)?handlers[deps](registry[relMap.id]):req.get?req.get(context,deps,relMap,localRequire):(id=makeModuleMap(deps,relMap,!1,!0).id,hasProp(defined,id)?defined[id]:onError(makeError("notloaded",'Module name "'+id+'" has not been loaded yet for context: '+contextName+(relMap?"":". Use require([])")))):(intakeDefines(),context.nextTick((function(){intakeDefines(),(requireMod=getModule(makeModuleMap(null,relMap))).skipMap=options.skipMap,requireMod.init(deps,callback,errback,{enabled:!0}),checkLoaded()})),localRequire)}return options=options||{},mixin(localRequire,{isBrowser:isBrowser,toUrl:function(moduleNamePlusExt){var ext,index=moduleNamePlusExt.lastIndexOf("."),segment=moduleNamePlusExt.split("/")[0];return-1!==index&&(!("."===segment||".."===segment)||index>1)&&(ext=moduleNamePlusExt.substring(index,moduleNamePlusExt.length),moduleNamePlusExt=moduleNamePlusExt.substring(0,index)),context.nameToUrl(normalize(moduleNamePlusExt,relMap&&relMap.id,!0),ext,!0)},defined:function(id){return hasProp(defined,makeModuleMap(id,relMap,!1,!0).id)},specified:function(id){return id=makeModuleMap(id,relMap,!1,!0).id,hasProp(defined,id)||hasProp(registry,id)}}),relMap||(localRequire.undef=function(id){takeGlobalQueue();var map=makeModuleMap(id,relMap,!0),mod=getOwn(registry,id);mod.undefed=!0,removeScript(id),delete defined[id],delete urlFetched[map.url],delete undefEvents[id],eachReverse(defQueue,(function(args,i){args[0]===id&&defQueue.splice(i,1)})),delete context.defQueueMap[id],mod&&(mod.events.defined&&(undefEvents[id]=mod.events),cleanRegistry(id))}),localRequire},enable:function(depMap){getOwn(registry,depMap.id)&&getModule(depMap).enable()},completeLoad:function(moduleName){var found,args,mod,shim=getOwn(config.shim,moduleName)||{},shExports=shim.exports;for(takeGlobalQueue();defQueue.length;){if(null===(args=defQueue.shift())[0]){if(args[0]=moduleName,found)break;found=!0}else args[0]===moduleName&&(found=!0);callGetModule(args)}if(context.defQueueMap={},mod=getOwn(registry,moduleName),!found&&!hasProp(defined,moduleName)&&mod&&!mod.inited){if(!(!config.enforceDefine||shExports&&getGlobal(shExports)))return hasPathFallback(moduleName)?void 0:onError(makeError("nodefine","No define call for "+moduleName,null,[moduleName]));callGetModule([moduleName,shim.deps||[],shim.exportsFn])}checkLoaded()},nameToUrl:function(moduleName,ext,skipExt){var paths,syms,i,url,parentPath,bundleId,pkgMain=getOwn(config.pkgs,moduleName);if(pkgMain&&(moduleName=pkgMain),bundleId=getOwn(bundlesMap,moduleName))return context.nameToUrl(bundleId,ext,skipExt);if(req.jsExtRegExp.test(moduleName))url=moduleName+(ext||"");else{for(paths=config.paths,i=(syms=moduleName.split("/")).length;i>0;i-=1)if(parentPath=getOwn(paths,syms.slice(0,i).join("/"))){isArray(parentPath)&&(parentPath=parentPath[0]),syms.splice(0,i,parentPath);break}url=syms.join("/"),url=("/"===(url+=ext||(/^data\:|^blob\:|\?/.test(url)||skipExt?"":".js")).charAt(0)||url.match(/^[\w\+\.\-]+:/)?"":config.baseUrl)+url}return config.urlArgs&&!/^blob\:/.test(url)?url+config.urlArgs(moduleName,url):url},load:function(id,url){req.load(context,id,url)},execCb:function(name,callback,args,exports){return callback.apply(exports,args)},onScriptLoad:function(evt){if("load"===evt.type||readyRegExp.test((evt.currentTarget||evt.srcElement).readyState)){interactiveScript=null;var data=getScriptData(evt);context.completeLoad(data.id)}},onScriptError:function(evt){var data=getScriptData(evt);if(!hasPathFallback(data.id)){var parents=[];return eachProp(registry,(function(value,key){0!==key.indexOf("_@r")&&each(value.depMaps,(function(depMap){if(depMap.id===data.id)return parents.push(key),!0}))})),onError(makeError("scripterror",'Script error for "'+data.id+(parents.length?'", needed by: '+parents.join(", "):'"'),evt,[data.id]))}}},context.require=context.makeRequire(),context}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState||eachReverse(scripts(),(function(script){if("interactive"===script.readyState)return interactiveScript=script})),interactiveScript}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),function(){function n(n){return H(n)&&pn.call(n,"callee")&&!yn.call(n,"callee")}function t(n,t){return n.push.apply(n,t),n}function r(n){return function(t){return null==t?Z:t[n]}}function o(n){return n instanceof i?n:new i(n)}function i(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function c(n,t,r){if("function"!=typeof n)throw new TypeError("Expected a function");return setTimeout((function(){n.apply(Z,r)}),t)}function a(n,t,r){for(var e=-1,u=n.length;++et}function b(n,t,r,e,u){return n===t||(null==n||null==t||!H(n)&&!H(t)?n!=n&&t!=t:function(n,t,r,e,u,o){var i=Nn(n),c=Nn(t),f=i?"[object Array]":hn.call(n),a=c?"[object Array]":hn.call(t),l=(f="[object Arguments]"==f?"[object Object]":f,a="[object Arguments]"==a?"[object Object]":a,"[object Object]"==f);c="[object Object]"==a,a=f==a;o||(o=[]);var p=An(o,(function(t){return t[0]==n})),s=An(o,(function(n){return n[0]==t}));if(p&&s)return p[1]==t;if(o.push([n,t]),o.push([t,n]),a&&!l){if(i)r=function(n,t,r,e,u,o){var i=n.length,c=t.length;if(i!=c&&!(1&r&&c>i))return!1;c=-1;for(var f=!0,a=2&r?[]:Z;++ct&&(t=-t>u?0:u+t),0>(r=r>u?u:r)&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++er?jn(e+r,0):r:0)||0)-1;for(var u=t==t;++rarguments.length,mn)}function G(n,t){var r;if("function"!=typeof t)throw new TypeError("Expected a function");return n=Fn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function J(n,t){return n===t||n!=n&&t!=t}function M(n){var t;return(t=null!=n)&&(t="number"==typeof(t=n.length)&&-1=t),t&&!U(n)}function U(n){return!!V(n)&&("[object Function]"==(n=hn.call(n))||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function V(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function H(n){return null!=n&&"object"==typeof n}function K(n){return"number"==typeof n||H(n)&&"[object Number]"==hn.call(n)}function L(n){return"string"==typeof n||!Nn(n)&&H(n)&&"[object String]"==hn.call(n)}function Q(n){return"string"==typeof n?n:null==n?"":n+""}function W(n){return null==n?[]:function(n,t){return j(t,(function(t){return n[t]}))}(n,Dn(n))}function X(n){return n}function Y(n,r,e){var u=Dn(r),o=h(r,u);null!=e||V(r)&&(o.length||!u.length)||(e=r,r=n,n=this,o=h(r,Dn(r)));var i=!(V(e)&&"chain"in e&&!e.chain),c=U(n);return mn(o,(function(e){var u=r[e];n[e]=u,c&&(n.prototype[e]=function(){var r=this.__chain__;if(i||r){var e=n(this.__wrapped__);return(e.__actions__=A(this.__actions__)).push({func:u,args:arguments,thisArg:n}),e.__chain__=r,e}return u.apply(n,t([this.value()],arguments))})})),n}var Z,tn=/[&<>"']/g,rn=RegExp(tn.source),en=/^(?:0|[1-9]\d*)$/,un="object"==typeof self&&self&&self.Object===Object&&self,on="object"==typeof global&&global&&global.Object===Object&&global||un||Function("return this")(),cn=(un="object"==typeof exports&&exports&&!exports.nodeType&&exports)&&"object"==typeof module&&module&&!module.nodeType&&module,fn=function(n){return function(t){return null==n?Z:n[t]}}({"&":"&","<":"<",">":">",'"':""","'":"'"}),an=Array.prototype,ln=Object.prototype,pn=ln.hasOwnProperty,sn=0,hn=ln.toString,vn=on._,bn=Object.create,yn=ln.propertyIsEnumerable,gn=on.isFinite,_n=function(n,t){return function(r){return n(t(r))}}(Object.keys,Object),jn=Math.max,dn=function(){function n(){}return function(t){return V(t)?bn?bn(t):(n.prototype=t,t=new n,n.prototype=Z,t):{}}}();i.prototype=dn(o.prototype),i.prototype.constructor=i;var mn=function(n){return function(r,e){if(null==r)return r;if(!M(r))return n(r,e);for(var u=r.length,o=-1,i=Object(r);++o(r=null==r?0:Fn(r))&&(r=jn(e+r,0));n:{for(t=g(t),e=n.length,r+=-1;++re||o&&c&&a||!u&&a||!i){r=1;break n}if(!o&&renable_solitairey_ui;return function(){const active={name:"freecell",game:null},yui=YUI({base:"js/yui-unpack/yui/build/"});let Y;const games={agnes:"Agnes",klondike:"Klondike",klondike1t:"Klondike1T","flower-garden":"FlowerGarden","forty-thieves":"FortyThieves",freecell:"Freecell",golf:"Golf","grandfathers-clock":"GClock","monte-carlo":"MonteCarlo",pyramid:"Pyramid","russian-solitaire":"RussianSolitaire",scorpion:"Scorpion",spider:"Spider",spider1s:"Spider1S",spider2s:"Spider2S",spiderette:"Spiderette","tri-towers":"TriTowers","will-o-the-wisp":"WillOTheWisp",yukon:"Yukon"},extensions=["auto-turnover","statistics","solitaire-autoplay","solitaire"],Fade=function(){let body,el=null;const css={position:"absolute",display:"none",backgroundColor:"#000",opacity:.7,top:0,left:0,width:0,height:0,zIndex:1e3},element=function(){return null===el&&(el=Y.Node.create("
"),el.setStyles(css),body=Y.one(".solitairey_body").append(el)),el};return{show:function(){const el=element();css.display="block",css.width=el.get("winWidth"),css.height=el.get("winHeight"),el.setStyles(css)},hide:function(){css.display="none",element().setStyles(css)}}}();function switchToGame(name){active.name=name,active.game=Y.Solitaire[games[name]]}function playGame(name){switchToGame(name),enable_cookies()&&$.jStorage.set("FossSolitairey_options",name),newGame()}const GameChooser={selected:null,fade:!1,init:function(){this.refit()},refit:function(){const node=Y.one("#game-chooser");if(!node)return;const height=node.get("winHeight");node.setStyle("min-height",height)},show:function(fade){this.selected||this.select(active.name),fade&&(Fade.show(),this.fade=!0),Y.one("#game-chooser").addClass("show"),Y.one(".solitairey_body").addClass("scrollable")},hide:function(){this.fade&&Fade.hide(),Y.one("#game-chooser").removeClass("show"),Y.fire("gamechooser:hide",this),Y.one(".solitairey_body").removeClass("scrollable")},choose:function(){this.selected&&(this.hide(),playGame(this.selected))},select:function(game){const node=Y.one("#"+game+"> div"),previous=this.selected;previous!==game&&this.unSelect(),node&&(this.selected=game,new Y.Node(document.getElementById(game)).addClass("selected")),previous&&previous!==game&&Y.fire("gamechooser:select",this)},unSelect:function(){this.selected&&(new Y.Node(document.getElementById(this.selected)).removeClass("selected"),this.selected=null)}};const Themes={dondorf:{sizes:[61,79,95,122],61:{hiddenRankHeight:7,rankHeight:25,dimensions:[61,95]},79:{hiddenRankHeight:10,rankHeight:32,dimensions:[79,123]},95:{hiddenRankHeight:12,rankHeight:38,dimensions:[95,148]},122:{hiddenRankHeight:15,rankHeight:48,dimensions:[122,190]}},load:function(name){name in this||(name="dondorf"),Y.Solitaire.Card.base.theme!==name&&this.set(name,122)},set:function(name,size){const theme=this[name][size];Y.mix(Y.Solitaire.Card.base,{theme:name+"/"+size,hiddenRankHeight:theme.hiddenRankHeight,rankHeight:theme.rankHeight,width:theme.dimensions[0],height:theme.dimensions[1]},!0)}};function attachEvents(){if(Y.on("newAppGame",(function(){return newGame()})),enable_solitairey_ui&&(Y.on("click",restart,Y.one("#restart")),Y.on("click",(function(){GameChooser.show(!1)}),Y.one("#choose_game")),Y.on("click",newGame,Y.one("#new_deal")),Y.on("click",(function(){GameChooser.hide()}),Y.one("#close-chooser")),Y.on("click",(function(){active.game.undo()}),Y.one("#undo"))),enable_solitairey_ui){Y.on("click",(function(){const chromestore=Y.one(".chromestore");chromestore&&chromestore.addClass("hidden"),enable_cookies()&&$.jStorage.set("FossSolitairey_disable-chromestore-link",!0)}),Y.one(".chromestore")),Y.delegate("click",(function(e){GameChooser.select(e.currentTarget._node.id),GameChooser.choose()}),"#descriptions","li")}Y.one("document").on("keydown",(function(e){27===e.keyCode&&GameChooser.hide()})),Y.on("afterSetup",(function(){active.game.stationary((function(){resize()}))})),function(){let timer,attachEvent;window.addEventListener?attachEvent="addEventListener":window.attachEvent&&(attachEvent="attachEvent"),window[attachEvent](Y.Solitaire.Application.resizeEvent,(function(){clearTimeout(timer),timer=setTimeout(resize,250)}),!1)}()}const Preloader={loadingCount:0,loaded:function(callback){if(this.loadingCount)setTimeout(function(){this.loaded(callback)}.bind(this),100);else{const loading=Y.one(".loading");loading&&loading.addClass("hidden"),callback(),Fade.hide()}},load:function(path){const image=new Image;image.onload=function(){--this.loadingCount}.bind(this),image.src=path,this.loadingCount++},preload:function(){const that=this;const icons=["agnes","flower-garden","forty-thieves","freecell","gclock","golf","klondike1t","klondike","montecarlo","pyramid","scorpion","spider1s","spider2s","spiderette","spider","tritowers","will-o-the-wisp","yukon"];["s","h","c","d"].forEach((function(suit){for(let rank=1;rank<=13;++rank)that.load(Y.Solitaire.Card.base.theme+"/"+suit+rank+".png")})),this.load(Y.Solitaire.Card.base.theme+"/facedown.png"),enable_solitairey_ui&&icons.forEach((function(image){that.load("layouts/mini/"+image+".png")})),Fade.show();const loading=Y.one(".loading");loading&&loading.removeClass("hidden")}};function _my_load_func(){const save=!!enable_cookies()&&$.jStorage.get("FossSolitairey_saved-game");attachEvents(),function(){if(enable_cookies()){const options=$.jStorage.get("FossSolitairey_options");options&&(active.name=options)}Themes.load("dondorf")}(),Preloader.preload(),Preloader.loaded((function(){save?(clearDOM(),active.game=Y.Solitaire[games[active.name]],active.game.loadGame(save)):enable_solitairey_ui&&playGame(active.name)})),GameChooser.init(),schedule_cb&&schedule_cb(Y)}function resize(){const game=active.game,el=game.container(),padding=Y.Solitaire.padding,offset=Y.Solitaire.offset,width=el.get("winWidth")-padding.x,height=el.get("winHeight")-padding.y;Y.Solitaire.Application.windowHeight=height;const ratio=Math.min((width-offset.left)/game.width(),(height-offset.top)/game.height());active.game.resize(ratio),GameChooser.refit()}function clearDOM(){Y.all(".stack, .card").remove()}function restart(){if(enable_cookies()){const init=Y.Cookie.get("FossSolitairey_initial-game");if(init){clearDOM();const game=active.game;game.cleanup(),game.loadGame(init),game.save()}}}function clearGame(){const game=active.game;clearDOM(),game.cleanup()}function newGame(){clearGame(),active.game.newGame()}newGameRun=function(){playGame("freecell")},schedule=function(cb){schedule_cb=cb},yui.use.apply(yui,function(){const modules=extensions.slice();for(const m in games)games.hasOwnProperty(m)&&modules.unshift(m);return modules}().concat((function(YUI){Y=YUI,Y.on("newGameRun",newGameRun),Y.Solitaire.Application={windowHeight:0,resizeEvent:"resize",GameChooser:GameChooser,newGame:newGame,clearDOM:clearGame,switchToGame:switchToGame},Y.on("domready",_my_load_func)}))),window.setTimeout((function(){yui.use.apply(yui,["solver-freecell"])}),400)}(),{schedule:schedule,newGameRun:newGameRun,setUI:v=>{enable_solitairey_ui=v}}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-stack-clear",(function(Y){const Solitaire=Y.Solitaire;function clearComplete(stack,startIndex){const cards=stack.cards;let count=cards.length-startIndex;const foundation=Y.Array.find(Solitaire.game.foundation.stacks,(function(stack){return!stack.cards.length}));Solitaire.stationary((function(){for(;count;)_.last(cards).moveTo(foundation),count--})),stack.updateCardsPosition()}Y.namespace("Solitaire.AutoStackClear"),Solitaire.AutoStackClear.register=function(){Y.on("solitaire|tableau:afterPush",(function(stack){!function(stack,callback){const cards=stack.cards;let rank,suit,card,i;if(!cards.length)return!1;for(i=cards.length-1,rank=1,suit=cards[i].suit;i>=0&&rank<14;i--,rank++)if(card=cards[i],card.isFaceDown||card.rank!==rank||card.suit!==suit)return!1;const complete=14===rank;complete&&"function"==typeof callback&&callback(stack,i+1)}(stack,clearComplete)}))}}),"0.0.1",{requires:["solitaire"]}),{auto_stack:!0}})),define(["./solitaire"],(function(solitaire){return YUI.add("auto-turnover",(function(Y){Y.on("tableau:afterPop",(function(stack){stack.cards.forEach((function(card){card&&card.isFaceDown&&card.isFree()&&card.faceUp()}))}))}),"0.0.1",{requires:["solitaire"]}),{}})),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-autoplay",(function(Y){Y.namespace("Solitaire.Autoplay");const Solitaire=Y.Solitaire,Autoplay=Solitaire.Autoplay;let whenWon=!0,autoPlayInterval=null;const autoPlayable=["Klondike","Klondike1T","FortyThieves","GClock","Freecell","FlowerGarden","Yukon"];function autoPlay(){let played=!1;Solitaire.game.eachStack((function(stack){const field=stack.field;played||"foundation"===field||"deck"===field||(played=!stack.eachCard((function(card){return!card.autoPlay()})))}))}Y.on("endTurn",(function(){whenWon&&-1!==autoPlayable.indexOf(Solitaire.game.name())&&null===autoPlayInterval&&function(){let stop=!1;return Solitaire.game.eachStack((function(stack){const field=stack.field;let prevRank=14;stop||"tableau"!==field&&"waste"!==field||stack.eachCard((function(card){if(card.rank>prevRank||card.isFaceDown)return stop=!0,!1;prevRank=card.rank}))})),!stop}()&&Y.fire("autoPlay")})),Y.on("win",(function(){clearInterval(autoPlayInterval),autoPlayInterval=null})),Y.on("autoPlay",(function(){autoPlayInterval=setInterval(autoPlay,130)})),Y.mix(Autoplay,{enable:function(){whenWon=!0},disable:function(){whenWon=!1}})}),"0.0.1",{requires:["solitaire"]}),{}})),YUI.add("flower-garden",(function(Y){const Solitaire=Y.Solitaire,FlowerGarden=Y.Solitaire.FlowerGarden=Solitaire.instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,i,stack=0;const stacks=this.tableau.stacks;for(deck=this.deck,reserve=this.reserve.stacks[0],i=0;i<36;i++)card=deck.pop(),stacks[stack].push(card.faceUp()),stack++,6===stack&&(stack=0);for(;card=deck.pop();)card.faceUp(),reserve.push(card)},height:function(){return 5.5*this.Card.base.height},maxStackHeight:function(){return 4.4*this.Card.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 4.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:1,layout:{hspacing:1.25,top:function(){return 4.5*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:6,layout:{hspacing:1.25,top:function(){return 1.25*Solitaire.Card.height},left:function(){return 3*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{rankHeight:24,createProxyStack:function(){let stack;switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this);case"reserve":stack=Solitaire.instance(this.stack),stack.cards=[this],this.proxyStack=stack}return this.proxyStack},moveTo:function(stack){const cards=this.stack.cards,index=cards.indexOf(this);let i,len;for(Solitaire.Card.moveTo.call(this,stack),cards.splice(index,0,null),i=index+1,len=cards.length;istop&&i;i--)deck.my_Last().faceUp().moveTo(waste)},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 3*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck",init:function(){Solitaire.Deck.init.call(this),this.cards.forEach((function(c){c.faceDown()}))},createStack:function(){for(let i=this.cards.length-1;i>=0;i--)this.stacks[0].push(this.cards[i])}}),Waste:{stackConfig:{total:1,layout:{hspacing:0,top:0,left:function(){return 1.25*Solitaire.Card.width}}},field:"waste",draggable:!0},Tableau:{stackConfig:{total:10,layout:{hspacing:1.31,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.suit===this.suit&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});FortyThieves.fields.forEach((function(field){FortyThieves[field].Stack=Solitaire.instance(FortyThieves.Stack)})),Y.mix(FortyThieves.Stack,{cssClass:"freestack",validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(FortyThieves.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(FortyThieves.Deck.Stack,{createDOMElement:function(){Solitaire.Stack.createDOMElement.call(this),this.node.on("click",Solitaire.Events.clickEmptyDeck)}},!0),FortyThieves.Foundation.Stack.cssClass="freefoundation"}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){const instance=solitaire.instance;return YUI.add("freecell",(function(Y){const Solitaire=Y.Solitaire,Freecell=Y.Solitaire.Freecell=instance(Solitaire,{fields:["Foundation","Reserve","Tableau"],deal:function(){let card,stack=0;const stacks=this.tableau.stacks;for(;card=this.deck.pop();)stacks[stack].push(card.faceUp()),stack++,8===stack&&(stack=0)},openSlots:function(exclude){let total=1,freeTableaus=0;const rStacks=this.reserve.stacks,tStacks=this.tableau.stacks;for(let i=0;i<4;i++)rStacks[i].my_Last()||++total;for(let i=0;i<8;i++){const stack=tStacks[i];exclude!==stack&&!stack.my_Last()&&++freeTableaus}return total*Math.pow(2,freeTableaus)},Stack:instance(Solitaire.Stack),height:function(){return 5*this.Card.base.height},Foundation:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:function(){return 6*Solitaire.Card.width}}},field:"foundation",draggable:!1},Reserve:{stackConfig:{total:4,layout:{hspacing:1.25,top:0,left:0}},field:"reserve",draggable:!0},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau",draggable:!0},Card:instance(Solitaire.Card,{playable:function(){switch(this.stack.field){case"reserve":return!0;case"tableau":return this.createProxyStack();case"foundation":return!1}},createProxyStack:function(){const stack=Solitaire.Card.createProxyStack.call(this);return this.proxyStack=stack&&stack.cards.length<=Freecell.openSlots(stack)?stack:null,this.proxyStack},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return!target||target.color!==this.color&&target.rank===this.rank+1;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;case"reserve":return!target}}})});Freecell.fields.forEach((function(field){Freecell[field].Stack=instance(Freecell.Stack)})),Y.mix(Freecell.Stack,{validTarget:function(stack){return!("tableau"!==stack.field||!this.first().validTarget(stack))&&this.cards.length<=Freecell.openSlots(stack)}},!0),Y.mix(Freecell.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),{instance:instance}})),YUI.add("golf",(function(Y){const Solitaire=Y.Solitaire,Golf=Y.Solitaire.Golf=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],deal:function(){let card,stack,row;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(row=0;row<5;row++)for(stack=0;stack<7;stack++)card=deck.pop().faceUp(),stacks[stack].push(card);card=deck.pop().faceUp(),foundation.push(card),deck.createStack()},turnOver:function(){const deck=this.deck.stacks[0],foundation=this.foundation.stacks[0],last=deck.my_Last();last&&last.faceUp().moveTo(foundation)},isWon:function(){let won=!0;return this.eachStack((function(stack){stack.eachCard((function(card){return card&&(won=!1),won}))}),"tableau"),won},height:function(){return 4*this.Card.base.height},Deck:Solitaire.instance(Solitaire.Deck,{field:"deck",stackConfig:{total:1,layout:{hspacing:0,top:function(){return 3*Solitaire.Card.height},left:0}},createStack:function(){let i,len;for(i=0,len=this.cards.length;i=0;){for(card=cards[i],found=!1,rank=2;rank<=13;rank++)if(card.rank===rank&&card.suit===wrap(suits,rank)){found=!0,cards.splice(i,1),clock[rank-2]=card.faceUp();break}found||(stacks[stack].push(card.faceUp()),stack=(stack+1)%8),i--}for(i=0;i<12;i++)foundations[(i+2)%12].push(clock[i])},height:function(){return 6.7*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:12,layout:{hspacing:1.25,top:function(){return 3*Solitaire.Card.height},left:function(){return 3.25*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 7.25*Solitaire.Card.width}}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{createProxyStack:function(){switch(this.stack.field){case"foundation":this.proxyStack=null;break;case"tableau":return Solitaire.Card.createProxyStack.call(this)}return this.proxyStack},validTarget:function(stack){const target=stack.my_Last();let rank,hour;switch(stack.field){case"tableau":return!target||target.rank===this.rank+1;case"foundation":return hour=(stack.index()+3)%12,rank=target.rank,target.suit===this.suit&&(target.rank+1)%13==this.rank%13&&(low=stack.first().rank,high=hour,value=this.rank,low<=high?low<=value&&value<=high:low<=value||value<=high);default:return!1}var low,high,value}})});function normalize(valOrFunction){const val="function"==typeof valOrFunction?valOrFunction():valOrFunction;return isNaN(val)?void 0:val}GClock.fields.forEach((function(field){GClock[field].Stack=Solitaire.instance(GClock.Stack)})),Y.mix(GClock.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validCard:function(){return!1}},!0),Y.mix(GClock.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0),Y.mix(GClock.Foundation.Stack,{index:function(){return GClock.foundation.stacks.indexOf(this)},layout:function(layout,i){const top=Math.sin(Math.PI*i/6)*Solitaire.Card.height*2.25,left=Math.cos(Math.PI*i/6)*Solitaire.Card.width*3;this.top=top+normalize(layout.top),this.left=left+normalize(layout.left)}},!0)}),"0.0.1",{requires:["solitaire"]}),YUI.add("solitaire-background-fix",(function(Y){let _body;function resize(){const width=body().get("winWidth"),height=body().get("winHeight"),style=document.body.style;Y.UA.mobile||body().setStyles({width:width,height:height}),void 0===style.backgroundSize&&void 0===style.MozBackgroundSize&&body().setStyles({backgroundImage:"url(greentiled.jpg)",backgroundRepeat:"repeat"})}function body(){return _body||(_body=new Y.Node(document.body)),_body}Y.on("load",resize),Y.on("resize",resize)}),"0.0.1",{requires:["solitaire"]}),define(["./solitaire"],(function(solitaire){return YUI.add("solitaire-ios",(function(Y){if(Y.UA.ios){var setCardPosition,Solitaire=Y.Solitaire,_scale=Solitaire.scale,BARE_LAYOUT={hspacing:0,vspacing:0,left:0,top:0},DEFAULTS={scale:1,offset:60,maxStackHeight:155},OPTIONS={Agnes:{offset:[null,5],maxStackHeight:260},FlowerGarden:{offset:[-60,5],maxStackHeight:235},Freecell:{scale:[1,.93],offset:[35,5]},Golf:{scale:[1.1,1],offset:[45,8]},GClock:{scale:.93,offset:5,maxStackHeight:130},Klondike:{offset:[null,5],maxStackHeight:[null,340]},MonteCarlo:{scale:[.88,1],offset:[80,15]},Pyramid:{offset:20},Scorpion:{offset:5,maxStackHeight:[235,380]},Spider:{scale:[1.13,.79],offset:[5,2],maxStackHeight:[160,340]},TriTowers:{scale:.9,offset:10},Yukon:{scale:[.95,1],offset:[50,5],maxStackHeight:[235,390]}},gameOverrides={Agnes:function(){var hspacing={hspacing:1.13};fieldLayout(this,"Reserve",Y.merge(hspacing,{top:60})),fieldLayout(this,"Tableau",Y.merge(hspacing,{top:145})),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:135}))},FlowerGarden:[function(){this.Card.rankHeight=15,fieldLayout(this,"Reserve",{top:0,left:70}),fieldLayout(this,"Foundation",{top:0,left:470,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{top:0,left:140}),Y.mix(this.Reserve.Stack,{setCardPosition:function(card){var last=_.last(this.cards),top=last?last.top+11:this.top,left=this.left;card.left=left,card.top=top},update:Solitaire.noop},!0)},(setCardPosition=Solitaire.FlowerGarden.Reserve.Stack.setCardPosition,function(){fieldLayout(this,"Tableau",{left:10,top:120}),fieldLayout(this,"Reserve",{left:17,top:60}),fieldLayout(this,"Foundation",{left:55,top:0,hspacing:1.5,vspacing:0}),Y.mix(this.Reserve.Stack,{setCardPosition:setCardPosition,update:Solitaire.noop},!0)})],Freecell:[originalLayout("Freecell",["Foundation","Reserve","Tableau"]),function(){var hspacing={hspacing:1.05};fieldLayout(this,"Tableau",hspacing),fieldLayout(this,"Reserve",hspacing),fieldLayout(this,"Foundation",Y.merge(hspacing,{left:157}))}],Golf:[originalLayout("Golf",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{hspacing:1.1}),fieldLayout(this,"Foundation",{left:132})}],GClock:function(){fieldLayout(this,"Foundation",{left:143}),fieldLayout(this,"Tableau",{left:0,top:250,hspacing:1.05})},Klondike:[function(){originalLayout("Klondike","Foundation").call(this),originalLayout("Klondike","Tableau").call(this)},function(){Y.mix(this.Foundation.stackConfig.layout,{left:135,hspacing:1.13},!0),Y.mix(this.Tableau.stackConfig.layout,{hspacing:1.13},!0)}],MonteCarlo:function(){fieldLayout(this,"Tableau",{cardGap:1.1,vspacing:1.05})},Pyramid:[function(){var deck=originalLayout("Pyramid","Deck"),waste=originalLayout("Pyramid","Waste");return function(){deck.call(this),waste.call(this),Y.mix(this.Tableau.stackConfig.layout,{left:190,cardGap:1.1,hspacing:-.55},!0)}}(),function(){Y.mix(this.Deck.stackConfig.layout,{left:-10,top:300},!0),Y.mix(this.Waste.stackConfig.layout,{top:300},!0),Y.mix(this.Tableau.stackConfig.layout,{left:120,cardGap:1.1,hspacing:-.55},!0)}],Scorpion:[function(){fieldLayout(this,"Deck",{top:0,left:0}),fieldLayout(this,"Foundation",{top:0,left:420,hspacing:0,vspacing:1.1}),fieldLayout(this,"Tableau",{left:60,top:0,hspacing:1.13})},function(){fieldLayout(this,"Deck",{left:10,top:0}),fieldLayout(this,"Foundation",{left:75,top:0,hspacing:1.5,vspacing:0}),fieldLayout(this,"Tableau",{left:0,top:60,hspacing:1.13})}],Spider:[function(){fieldLayout(this,"Foundation",{left:94,hspacing:1.05}),fieldLayout(this,"Tableau",{top:65,hspacing:1.05})},function(){fieldLayout(this,"Foundation",{left:62,hspacing:1}),fieldLayout(this,"Tableau",{hspacing:1})}],TriTowers:function(){Y.mix(this.Tableau.stackConfig.layout,{hspacing:-.5,rowGaps:[3,2,1,0],cardGap:1},!0)},RussianSolitaire:[originalLayout("RussianSolitaire",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}],Yukon:[originalLayout("Yukon",["Tableau","Foundation"]),function(){fieldLayout(this,"Tableau",{top:55,hspacing:1.13}),fieldLayout(this,"Foundation",{left:46,top:0,hspacing:1.5,vspacing:0})}]};OPTIONS.FortyThieves=OPTIONS.Spider1S=OPTIONS.Spider2S=OPTIONS.Spider,gameOverrides.FortyThieves=gameOverrides.Spider1S=gameOverrides.Spider2S=gameOverrides.Spider,OPTIONS.WillOTheWisp=OPTIONS.Spiderette=OPTIONS.Klondike1T=OPTIONS.Klondike,gameOverrides.WillOTheWisp=gameOverrides.Spiderette=gameOverrides.Klondike1T=gameOverrides.Klondike,OPTIONS.RussianSolitaire=OPTIONS.Yukon,Y.mix(Y.DD.DDM,{useHash:!1,_pg_activate:Solitaire.noop,_pg_size:function(){this.activeDrag&&this._pg.setStyles({width:"100%",height:"100%"})}},!0),Y.DD.DDM.set("throttleTime",40),Y.mix(Y.DD.Drop.prototype,{_activateShim:function(){var DDM=Y.DD.DDM;return!!DDM.activeDrag&&(this.get("node")!==DDM.activeDrag.get("node")&&(!this.get("lock")&&void(this.inGroup(DDM.activeDrag.get("groups"))?(DDM._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get("node")),this.sizeShim()):DDM._removeValid(this))))},_deactivateShim:function(){this.overTarget=!1}},!0),Solitaire.Statistics.winDisplay=function(){alert("You win!")},Solitaire.scale=Solitaire.noop,Solitaire.Card.ghost=!1,Solitaire.Animation.animate=!1,Solitaire.Card.base={theme:"mobile",hiddenRankHeight:3,rankHeight:15,width:40,height:50},Y.on("beforeSetup",setLayout),Y.on("beforeResize",setLayout),Y.on("afterResize",scrollToTop),Y.on("load",scrollToTop),Y.on("touchstart",(function(e){e.target._node===document.body&&e.preventDefault()}),document),Y.on("touchmove",(function(e){e.target.test("#descriptions *")||e.preventDefault()}),document),Y.on("domready",(function(){var undo,cancel,showMenu,menu,body,nav,fb,index,closeMenu=function(){menu.removeClass("show")};(index=0,{deleteSelector:function(selector){var rules,idx,ss=document.styleSheets[index];ss&&-1!==(idx=(rules=Array.prototype.splice.call(ss.rules,0)).indexOf(rules.filter((function(rule){return rule.selectorText===selector}))[0]))&&ss.deleteRule(idx)}}).deleteSelector("#menu li:hover"),menu=Y.one("#menu"),body=Y.one("body"),undo=Y.one("#undo"),fb=Y.one("#social"),nav=Y.Node.create("
"),stack=this.proxyStack;if(stack)node.setStyles({opacity:1,top:-this.top,left:-this.left}),this.proxyCards().forEach((function(c){c.proxyStack=stack,node.append(c.node)}));else{if(!this.ghost)return null;node.setStyles({opacity:.6,top:-this.top,left:-this.left}).append(this.node.cloneNode(!0))}return node},updatePosition:function(fields){if(!this.node)return;const to={left:this.left+"px",top:this.top+"px",zIndex:this.zIndex},origin=this.origin;this.positioned||this.node.setStyles({left:normalize(origin.left),top:normalize(origin.top)}),Y.Solitaire.Animation.init(this,to,fields)},pushPosition:function(){const index=this.index>=0?this.index:this.stack.cards.indexOf(this);Solitaire.pushMove({card:this,index:index,from:this.stack})},moveTo:function(stack){const origin=this.stack;return this.pushPosition(),origin.deleteItem(this),stack.push(this),Y.fire(origin.field+":afterPop",origin),this},after:function(callback){this.callback=callback},runCallback:function(){this.callback&&(this.callback.call(this),this.callback=null)}},Y.Solitaire.Stack={cards:null,node:null,images:{tableau:"freeslot.png",deck:"freeslot.png",reserve:"freeslot.png",foundation:"freeslot.png"},serialize:function(){let i,len,card,bite;const cards=this.cards,serialized=[],suits=Game.deck.suits;for(i=0,len=cards.length;i>2&15,deck.suits[3&value]),64&value?card.faceDown(!0):card.faceUp(!0)),card})),this.update()},imageSrc:function(){const basename=this.images[this.field];return basename?Solitaire.Card.base.theme+"/"+basename:"trans.gif"},layout:function(layout){const hoffset=layout.hoffset*Y.Solitaire.Card.width,voffset=layout.voffset*Y.Solitaire.Card.height,gameOffset=Solitaire.offset,self=this;["top","left"].forEach((function(p){self[p]=normalize(layout[p])})),this.left+=hoffset+gameOffset.left,this.top+=voffset+gameOffset.top},deleteItem:function(card){_deleteItem(this.cards,card)},push:function(card,temp){const last=this.my_Last(),to=this.field,from=card.stack?card.stack.field:"deck";last?card.zIndex=last.zIndex+1:"deck"===to||"foundation"===to?card.zIndex=200:"deck"===from&&(card.zIndex=Game.Card.zIndex),temp||(card.stack=this,this.setCardPosition(card),card.truncatePosition(),card.ensureDOM()),this.cards.push(card),temp||card.updatePosition({from:from,to:to})},pushStack:function(proxy){const origin=Solitaire.activeCard.stack,stack=this;origin.eachCard((function(card,i){card.index=i})),Game.stationary((function(){proxy.eachCard((function(card){card.moveTo(stack),card.index=-1})),origin.eachCard((function(card){card.index=-1}))})),origin.updateCardsPosition(),origin.update(),Y.fire(stack.field+":afterPush",stack)},adjustRankHeight:function(){const cards=this.cards,last=this.my_Last(),max=Game.maxStackHeight();let sumRankHeights,i,len,sumHidden=0,sumVisible=0,height=0,countHidden=0,countVisible=0;const Card=Solitaire.Card;if(cards.length<=1)return;for(i=0,len=cards.length-1;i").setAttribute("src",this.imageSrc()).setData("target",this).plug(Y.Plugin.Drop,{useShim:!0});this.updateStyle(),Solitaire.container().append(node)},cleanup:function(){const n=this.node;n&&n.clearData().destroy(!0),this.eachCard((function(c){c.destroyNode()}))},updateDragGroups:function(){const active=Solitaire.activeCard,last=this.my_Last();this.eachCard((function(c){c.node.drop.removeFromGroup("open")})),active.validTarget(this)?(last&&last.node.drop.addToGroup("open"),this.node.drop.addToGroup("open")):this.node.drop.removeFromGroup("open")},validCard:function(){return!0},validProxy:function(card){return card&&card.validTarget(this)&&this.validCard(card)},update:function(){}},Y.Solitaire.Animation={animate:!0,dealing:!1,duration:.5,interval:20,queue:new Y.AsyncQueue,init:function(card,to,fields){if(!this.animate)return card.node.setStyles(to),card.positioned=!0,void setTimeout((function(){card.runCallback()}),0);const node=card.node,q=this.queue,speeds=card.animSpeeds,from=mapAppend(function(that){for(const p in that)that.hasOwnProperty(p)&&(that[p]=parseFloat(that[p]));return that}({top:node.getStyle("top"),left:node.getStyle("left")}),"px");let duration;const zIndex=to.zIndex;if(from.top===to.top&&from.left===to.left)return;duration=this.dealing?speeds.slow:fields&&fields.from!==fields.to&&"waste"!==fields.to&&"foundation"!==fields.to?"deck"===fields.from?speeds.slow:speeds.mid:speeds.fast,node.setStyle("zIndex",500+zIndex),delete to.zIndex;const anim=new Y.Anim({node:node,from:from,to:to,easing:Y.Easing.easeOut,duration:duration});anim.on("end",(function(){card.positioned=!0,node.setStyle("zIndex",zIndex),card.runCallback()})),q.add((function(){anim.run()})),q.run()},initQueue:function(){this.queue.defaults.timeout=this.interval}};const Undo={stack:null,clear:function(){this.stack=[]},push:function(moves){this.stack.push(moves)},pop:function(){return this.stack.pop()||[]},undo:function(){Y.Array.unique(my_Flatten(Y.Array.map(this.pop(),this.act))).forEach((function(stack){stack&&(stack.updateCardsPosition(),stack.update(!0))}))},act:function(move){const from=move.from,card=move.card,to=card.stack,cards=to.cards;return from&&(from===card.stack?cards[cards.indexOf(card)]=null:_deleteItem(cards,card),from.cards[move.index]=card,card.stack=from,Solitaire.container().append(card.node)),"faceDown"in move&&(move.faceDown?card.faceUp(!0):card.faceDown(!0)),[to,from]}}}),"0.0.1",{requires:["dd","dd-plugin","dd-delegate","anim","async-queue","array-extras"]}),{instance:instance,Game:Game,getGame:getGame,setUI:v=>{enable_solitairey_ui=v}}})),define(["./libfcs-wrap","./web-fc-solve","./solitaire","./flatted"],(function(Module,w,solitaire,flatted){"use strict";const FC_Solve=w.FC_Solve,FCS_STATE_SUSPEND_PROCESS=w.FCS_STATE_SUSPEND_PROCESS,FCS_STATE_WAS_SOLVED=w.FCS_STATE_WAS_SOLVED;let getGame,_module_wrapper,_startSolution_cb;let _my_non_promise_module,_my_module,WITH_UI=!1;WITH_UI=!0;let _my_mod_counter=5;const suitTable={s:0,h:1,c:2,d:3};function cardToValue(card){return card?card.rank<<2|suitTable[card.suit]:0}function withSelector(Y,selector,callback){const node=Y.one(selector);node&&callback(node)}function sortedStacks(Y,field){return Y.Array.map(field.stacks,(function(s){return s})).sort((function(s1,s2){return cardToValue(s1.first())-cardToValue(s2.first())}))}function to_int(s){return parseInt(s,10)}const _suits=["S","H","C","D"],_ranks=["A","2","3","4","5","6","7","8","9","T","J","Q","K"];function _rev(arr,delta){const ret={};for(let i=0;i>2)-1]}function _render_suit(c){return _suits[3&c]}function _render_foundation(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)}function cardRank(val){return val>>2}function cardSuit(val){return["s","h","c","d"][3&val]}function _render_freecell(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)}function _str_to_c(s){const m=s.match(/^(.)(.)$/);if(!m)throw"Should not happen";return _ranks_rev[m[1]]<<2|_suits_rev[m[2]]}function _get_stack_c(pre_s,src,card_idx){const arr=pre_s[src+2].replace(/ *$/,"").split(" "),src_c_s=arr[arr.length-card_idx];return":"==src_c_s?0:_str_to_c(src_c_s)}function _get_freecell_c(pre_s,idx){const fc_line=pre_s[1],pat=new RegExp("^Freecells:"+(0==idx?"":"(?:....){"+idx+"}")+"(....)",""),matched=fc_line.match(pat);if(matched){const c_s=matched[1].substring(2,4);return" "==c_s?0:_str_to_c(c_s)}return 0}function _calc__move_content(pre_s,str){let matched=str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)/);if(matched){const num_cards=to_int(matched[1]);return{source:["tableau",_get_stack_c(pre_s,to_int(matched[2]),num_cards)],dest:["tableau",_get_stack_c(pre_s,to_int(matched[3]),1)],num_cards:num_cards}}if(matched=str.match(/^Move a card from (stack|freecell) ([0-9]+) to the foundations/),matched){const src=to_int(matched[2]);let m_t,src_c;"stack"==matched[1]?(src_c=_get_stack_c(pre_s,src,1),m_t="tableau"):(src_c=_get_freecell_c(pre_s,src),m_t="reserve");const f_suit=3&src_c,f_rank=function(pre_s,f){const f_line=pre_s[0],pat=new RegExp(f+"-([0A2-9TJQK])",""),m=f_line.match(pat)[1];return"0"==m?0:_ranks_rev[m]}(pre_s,_suits[f_suit]);return{source:[m_t,src_c],dest:["foundation",0!=f_rank&&f_rank<<2|f_suit],num_cards:1}}if(matched=str.match(/^Move a card from stack ([0-9]+) to freecell ([0-9]+)/),matched)return{source:["tableau",_get_stack_c(pre_s,to_int(matched[1]),1)],dest:["reserve",_get_freecell_c(pre_s,to_int(matched[2]))],num_cards:1};if(matched=str.match(/^Move a card from freecell ([0-9]+) to stack ([0-9]+)/),matched)return{source:["reserve",_get_freecell_c(pre_s,to_int(matched[1]))],dest:["tableau",_get_stack_c(pre_s,to_int(matched[2]),1)],num_cards:1};throw"Must not happen - _calc__move_content() failed with <"+str+">"}function _calc_instance_from_state(state){let exceeded_iters=!1;const instance=new FC_Solve({cmd_line_preset:"video-editing",module_wrapper:_module_wrapper,set_status_callback:function(status){"exceeded"==status&&(exceeded_iters=!0)}}),state_as_string=function(obj){let ret="";const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map(_render_foundation).join("")+"\n",ret+="Freecells:"+reserve.map(_render_freecell).join("")+"\n";for(let i=0;i=this.remainingMovesArr.length)return;const move=function(game,move){const source=move.source,dest=move.dest,ret={top_card:!0};let value=source[1];const source_type=source[0];if(game.eachStack((function(stack){if(ret.card)return;const len=stack.cards.length;stack.eachCard((function(card,i){return!ret.card&&(!card||(card.rank===cardRank(value)&&card.suit===cardSuit(value)?(ret.card=card,"tableau"===source_type&&i!=len-1&&(ret.top_card=!1),!1):void 0))}))}),source_type),!ret.card)throw"Excalibur";if(value=dest[1],game.eachStack((function(stack){if(ret.stack)return;const card=stack.my_Last();card||value||(ret.stack=stack),card&&card.rank===cardRank(value)&&card.suit===cardSuit(value)&&(ret.stack=stack)}),dest[0]),!ret.stack)throw"Must not happen - could not find dest stack for <"+value+">";return ret.num_cards=move.num_cards,ret}(game,this.remainingMovesArr[this.remainingMovesIdx]),card=move.card;if(!card)return;const origin=card.stack;if(move.top_card)card.moveTo(move.stack);else{Solitaire.activeCard=card,card.createProxyStack();const proxyStack=card.proxyStack;proxyStack.cards.length!==move.num_cards&&alert("Error !!! mismatch in num_cards"),proxyStack.cards.forEach((function(card){})),move.stack.pushStack(proxyStack),move.stack.updateCardsPosition(),origin.updateCardsPosition(),Solitaire.endTurn()}return!0},_resetGameFoo:function(){},playCurrent:function(game){const that=this;that._playCurrentHelper(game)||that._resetGameFoo()},prev:function(game){const that=this;that.remainingMovesIdx>0&&(Y.fire("undo",!0),--that.remainingMovesIdx)},next:function(game){const that=this,next_idx=this.remainingMovesIdx+1;Solitaire.Statistics.disable(),that.playCurrent(game),that.remainingMovesIdx=next_idx,that.remainingMovesIdx>=that.remainingMovesArr.length&&that._resetGameFoo(),Y.fire("endTurn",!0)},play:function(game){const that=this;that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(Solitaire.Autoplay.disable(),withSelector(Y,"#solver_bar .play",(function(node){node.removeClass("play"),node.addClass("pause")})),that.next(game),that.remainingMovesIdx>=that.remainingMovesArr.length||that.remainingMovesIdx<0||(that.timer=window.setTimeout((function(){that.play(game)}),that.interval)))}},Status={bar:null,indicator:null,indicatorTimer:null,indicatorInterval:750,delay:400,updateIndicator:function(ticks){const that=this,indicator=that.indicator;if(!indicator)return;ticks=(ticks||0)%4;let text="Solving";for(let i=0;i'),indicator=Y.Node.create('');function _create_button(args){return Y.Node.create('')}const next=_create_button({cls:"fastforward",title:"Next move"}),prev=_create_button({cls:"rewind",title:"Previous move"}),playPause=_create_button({cls:"play",title:"Play/Pause"}),controls=Y.Node.create("
");next.on("click",(function(){Animation.pause(),Animation.next(getGame())})),prev.on("click",(function(){Animation.pause(),Animation.prev(getGame())})),playPause.on("click",(function(){const that=playPause;that.hasClass("play")?Animation.play(getGame()):that.hasClass("pause")&&Animation.pause()})),controls.append(prev),controls.append(playPause),controls.append(next),bar.append(indicator),bar.append(controls),Y.one(".solitairey_body").append(bar),this.indicator=indicator,this.bar=bar},hide:function(){0}};_startSolution_cb=function(args){return Y.Solitaire.Application.switchToGame("freecell"),Y.Solitaire.Application.clearDOM(),Y.Solitaire.Freecell.setup((()=>{function _from_card(card){return Y.Solitaire.Freecell.Card.create(card.getRank(),game.deck.suits[[2,0,1,3][card.getSuit()]]).faceUp()}const board=args.board,game=getGame(),tableau=game.tableau.stacks;board.columns.forEach(((col,ci)=>{const column=col.col;tableau[ci].setCards(column.getLen(),(function(i){return _from_card(column.getCard(i))}))}));const fc=board.freecells;game.reserve.stacks.forEach(((stack,i)=>{const card=fc?fc.freecells.getCard(i):null;stack.setCards(card?1:0,(function(_unused){return _from_card(card)}))}));const foundations=board.foundations;game.foundation.stacks.forEach((function(stack,suit){stack.setCards(foundations?1+foundations.foundations.getByIdx(0,[1,2,0,3][suit]):0,(function(rank){return Y.Solitaire.Freecell.Card.create(rank,game.deck.suits[suit]).faceUp()}))}))}),{disableDragging:!0}),_solve_cb(Y,FreecellSolver,args.instance._pre_expand_states_and_moves_seq,Animation)},Y.mix(FreecellSolver,{solver_active:!1,currentSolution:null,attached:!1,supportedGames:["Freecell"],isSupported:function(){return-1!==this.supportedGames.indexOf(getGame().name())},enable:function(){this.isSupported()&&this.createUI(),this.attachEvents()},disable:function(){Status.hide()},attachEvents:function(){const that=this;if(that.attached)return;const pause=Animation.pause.bind(Animation);Y.on("afterDealingAnimation",(function(){that.isSupported()?(that.solver_active=!1,Animation.remainingMovesIdx=null,Animation.remainingMovesArr=[],that.solve()):that.disable()})),Y.on("autoPlay",(function(){FreecellSolver.disable()})),Y.on("win",(function(){})),document.documentElement.addEventListener("mousedown",(function(e){e.target.className.match(/\bpause\b/)||pause()}),!0),that.attached=!0},createUI:function(){Status.show()},stop:function(){},solve:function(){const that=this;if(that.solver_active)return;that.solver_active=!0,that.stop(),that.currentSolution=null;const state=function(Y,game){const tableau=Y.Array.map(sortedStacks(Y,game.tableau),(function(s){const buffer=[];return s.eachCard((function(c,i){buffer[i]=cardToValue(c)})),[buffer,s.cards.length]})),reserve=[];sortedStacks(Y,game.reserve).forEach((function(s,i){reserve[i]=cardToValue(s.my_Last())}));const foundation=[];return sortedStacks(Y,game.foundation).forEach((function(s,i){foundation[i]=cardToValue(s.my_Last())})),{reserve:reserve,foundation:foundation,tableau:tableau}}(Y,getGame());function _cb(){window.setTimeout((function(){const instance=_calc_instance_from_state(state);return _solve_cb(Y,that,instance?instance._pre_expand_states_and_moves_seq:null,Animation)}),400)}var callback;_my_non_promise_module?_cb():(callback=_cb,_my_mod_counter>=5?(_my_module=Module({onRuntimeInitialized:()=>{_my_module.then((result=>{_my_non_promise_module=result;const module_wrapper=w.FC_Solve_init_wrappers_with_module(_my_non_promise_module);_module_wrapper=module_wrapper,callback()}))}}),_my_mod_counter=0):++_my_mod_counter)}}),Y.on("beforeSetup",FreecellSolver.enable.bind(FreecellSolver))}),"0.0.1",{requires:["solitaire"]}),{startSolution:function(args){return _startSolution_cb(args)}}})),importScripts("libfreecell-solver.min.js","web-fc-solve--expand-moves.js","web-fc-solve.js");let attempts=0;const maxFastAttempts=15e4;function GameState(obj){if(!obj)return;let i,stack;for(this.reserve=new Uint8Array(obj.reserve),this.foundation=new Uint8Array(obj.foundation),this.tableau=[],i=0;i200)return 200;if(state.solved())return state.becomeChild(),0;for(i=0;i<4;i++)if(val=state.reserve[i],val){if(destIndex=state.validTarget("foundation",val),destIndex>-1&&(moves.push({source:["reserve",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["reserve",i],dest:["tableau",destIndex]})}const tableau=state.tableau;for(i=0;i-1&&(moves.push({source:["tableau",i],dest:["foundation",destIndex]}),foundFoundation=!0),foundFoundation)break;for(destIndex=state.validTarget("reserve",val),destIndex>-1&&moves.push({source:["tableau",i],dest:["reserve",destIndex]}),destIndex=0;(destIndex=state.validTarget("tableau",val,destIndex))>-1;)moves.push({source:["tableau",i],dest:["tableau",destIndex]})}for(foundFoundation?movesSinceFoundation=0:movesSinceFoundation++,i=0;i=20&&(scale=.7),fastSearch&&++attempts>maxFastAttempts&&(scale=.001),i=0;i>2)-1]}const reserve=obj.reserve;ret+="Foundations:"+obj.foundation.map((function(c){return 0==c?"":" "+_render_suit(c)+"-"+_render_rank(c)})).join("")+"\n",ret+="Freecells:"+reserve.map((function(c){return 0==c?" -":" "+_render_rank(c)+_render_suit(c)})).join("")+"\n";for(let i=0;i>2!=13)return!1;return!0},eachTableau:function(callback){const tableau=this.tableau;for(let i=0,len=tableau.length;i>2,suit=3&value;let dest,tableau,i,len;if(!value)return-1;switch(void 0===start?start=0:start++,field){case"foundation":for(i=0;i<4;i++)if(dest=this.foundation[i],!dest&&1===rank||suit===(3&dest)&&rank===1+(dest>>2))return i;break;case"reserve":for(i=0;i<4;i++)if(!this.reserve[i])return i;break;case"tableau":for(tableau=this.tableau,i=start,len=tableau.length;i>2)-1)return i}return-1},move:function(sourceField,sourceStack,destField,destStack){const val=this.pop(sourceField,sourceStack);this.push(destField,destStack,val)},pop:function(field,stack){let val;if("reserve"===field||"foundation"===field)return val=this[field][stack],this[field]=new Uint8Array(this[field]),this[field][stack]=0,val;const tableau=this.tableau,bufferLength=tableau[stack][1];return bufferLength?(val=tableau[stack][0][bufferLength-1],this.copyTableau(stack,bufferLength-1),val):0},push:function(field,stack,val){if(!val)return;if("reserve"===field||"foundation"===field)return this[field]=new Uint8Array(this[field]),void(this[field][stack]=val);const newLength=this.tableau[stack][1]+1;this.copyTableau(stack,newLength),this.tableau[stack][0][newLength-1]=val},copyTableau:function(stack,newLength){const old=this.tableau,tableau=old[stack][0],newBuffer=new Uint8Array(new ArrayBuffer(newLength));for(let i=0;i=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=15-(length-2-i)+(13-(stack[0][i]>>2)));this.validTarget("tableau",stack[0][length-2])>-1&&(rating+=10)}if("reserve"===sourceField&&(rating+=10,card=this.reserve[sourceIndex]),"tableau"===destField){for(rating+=2,stack=this.tableau[destIndex],length=stack[1],i=length-1;i>=0;i--)this.validTarget("foundation",stack[0][i])>-1&&(rating+=-5*(length-i));if(0===stack[1]){if("tableau"===sourceField&&1===this.tableau[sourceIndex][1])return-1e3;for(i=0;i<4;i++)nextCard=this.reserve[i],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);for(i=0;i<8;i++)stack=this.tableau[i],nextCard=stack[0][stack[1]-1],nextCard>>2==(card>>2)-1&&1&nextCard^1&card&&(rating+=20+(nextCard>>2),followup=!0);followup||(rating+=-10)}}return"reserve"===destField&&(rating+=-1),rating},transformParentMove:function(){const move=this.parentMove,parent=this.parent;move&&parent&&(move.source[1]=parent.lastCard(move.source[0],move.source[1]),move.dest[1]=parent.lastCard(move.dest[0],move.dest[1]))},lastCard:function(field,index){switch(field){case"reserve":case"foundation":return this[field][index];case"tableau":const stack=this[field][index],length=stack[1];return stack[0][length-1]}},becomeChild:function(){const parent=this.parent;parent&&(parent.child=this,this.transformParentMove())}},onmessage=function(e){let solution;const data=e.data;"solve"===data.action&&(solution=attemptSolution(data.param,!0),solution||(solution=attemptSolution(data.param,!1)),self.postMessage({solution:solution}))},YUI.add("spider",(function(Y){const Solitaire=Y.Solitaire,Spider=Solitaire.Spider=Solitaire.instance(Solitaire,{fields:["Foundation","Deck","Tableau"],createEvents:function(){Solitaire.AutoStackClear.register(),Solitaire.createEvents.call(this)},deal:function(){const deck=this.deck,stacks=this.tableau.stacks;for(let row=0;row<5;row++)for(let stack=0;stack<10;stack++)(stack<4||row<4)&&stacks[stack].push(deck.pop());for(let stack=0;stack<10;stack++)stacks[stack].push(deck.pop().faceUp());deck.createStack()},redeal:function(){},turnOver:function(){const deck=this.deck.stacks[0],that=this;hasFreeTableaus()||this.eachStack((function(stack){const card=deck.my_Last();card&&card.faceUp().moveTo(stack).after((function(){that.stack.updateCardsPosition()}))}),"tableau")},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:8,layout:{hspacing:1.25,top:0,left:function(){return 2.5*Solitaire.Card.width}}},field:"foundation",draggable:!1},Deck:Solitaire.instance(Solitaire.Deck,{count:2,stackConfig:{total:1,layout:{hspacing:0,top:0,left:0}},field:"deck"}),Tableau:{stackConfig:{total:10,layout:{hspacing:1.25,top:function(){return 1.5*Solitaire.Card.height},left:0}},field:"tableau"},Card:Solitaire.instance(Solitaire.Card,{playable:function(){this.stack[this.index-1];switch(this.stack.field){case"tableau":return this.createProxyStack();case"deck":return!hasFreeTableaus();case"foundation":return!1}},validTarget:function(stack){if("tableau"!==stack.field)return!1;const target=stack.my_Last();return!target||!target.isFaceDown&&target.rank===this.rank+1}})});function hasFreeTableaus(){return Y.Array.some(Solitaire.getGame().tableau.stacks,(function(stack){return!stack.cards.length}))}Spider.fields.forEach((function(field){Spider[field].Stack=Solitaire.instance(Spider.Stack)})),Y.mix(Spider.Stack,{validCard:function(card){return card.suit===_.last(this.cards).suit},validTarget:function(stack){switch(stack.field){case"tableau":return this.first().validTarget(stack);case"foundation":return 13===this.cards.length}}},!0),Y.mix(Spider.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["auto-stack-clear"]}),YUI.add("spider1s",(function(Y){const Solitaire=Y.Solitaire;(Y.Solitaire.Spider1S=Solitaire.instance(Y.Solitaire.Spider)).Deck=Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s"],count:8})}),"0.0.1",{requires:["spider"]}),YUI.add("spider2s",(function(Y){(Y.Solitaire.Spider2S=Y.Solitaire.instance(Y.Solitaire.Spider)).Deck=Y.Solitaire.instance(Y.Solitaire.Spider.Deck,{suits:["s","h"],count:4})}),"0.0.1",{requires:["spider"]}),YUI.add("spiderette",(function(Y){const Solitaire=Y.Solitaire,Klondike=Solitaire.Klondike,Spider=Solitaire.Spider;Y.Solitaire.Spiderette=Solitaire.instance(Spider,{height:Klondike.height,deal:Klondike.deal,Tableau:Solitaire.instance(Spider.Tableau,{stackConfig:Klondike.Tableau.stackConfig}),Foundation:Solitaire.instance(Spider.Foundation,{stackConfig:Klondike.Foundation.stackConfig}),Deck:Solitaire.instance(Spider.Deck,{count:1})})}),"0.0.1",{requires:["klondike","spider"]}),define(["./solitaire"],(function(solitaire){const getGame=solitaire.getGame;return YUI.add("statistics",(function(Y){let loaded,won,enabled=!0;const localStorage=window.localStorage,Solitaire=Y.Solitaire,Statistics=Y.namespace("Solitaire.Statistics");function winDisplay(){const stats=function(raw){function parse(){const entries=raw.split("|");return entries.splice(entries.length-1),Y.Array.map(entries,(function(entry){return entry=entry.split("_"),{date:new Date(entry[0]),won:!!parseInt(entry[1],10)}}))}function won(entry){return entry.won}const record=parse();return{streaks:function(){const streaks=[];let streak=null;return record.forEach((function(entry){entry.won?(streak||(streak=[]),streak.push(entry)):(streak&&streaks.push(streak),streak=null)})),streak&&streaks.push(streak),streaks},wins:function(){return Y.Array.filter(record,won)},loses:function(){return Y.Array.reject(record,won)}}}(localStorage[Solitaire.game.name()+"record"]);let output="
";const streakCount=_.last(stats.streaks()).length,winCount=stats.wins().length,loseCount=stats.loses().length;return output+="

You win! You're awesome.

",output+="

"+{Agnes:"Agnes",Klondike:"Klondike",Klondike1T:"Klondike (Vegas style)",FlowerGarden:"Flower Garden",FortyThieves:"Forty Thieves",Freecell:"Freecell",Golf:"Golf",GClock:"Grandfather's Clock",MonteCarlo:"Monte Carlo",Pyramid:"Pyramid",RussianSolitaire:"Russian Solitaire",Scorpion:"Scorpion",Spider:"Spider",Spider1S:"Spider (1 Suit)",Spider2S:"Spider (2 Suit)",Spiderette:"Spiderette",WillOTheWisp:"Will O' The Wisp",TriTowers:"Tri Towers",Yukon:"Yukon"}[Solitaire.game.name()]+" stats:

",output+="
    ",output+="
  • Current win streak: "+streakCount+"
  • ",output+="
  • Total wins: "+winCount+"
  • ",output+="
  • Total loses: "+loseCount+"
  • ",output+='
    ',output+="
",output}function record(value){const key=localStorage.currentGame+"record";let record=localStorage[key]||"";record+=(new Date).getTime()+"_"+value+"|",localStorage[key]=record}function clearProgress(){localStorage.removeItem("currentGame")}function saveProgress(){localStorage.currentGame=Solitaire.game.name()}localStorage&&(Y.on("newGame",(function(){loaded&&(record(0),clearProgress()),won=!1,loaded=null})),Y.on("loadGame",(function(){loaded=Solitaire.game.name(),saveProgress(),won=!1})),Y.on("endTurn",(function(){loaded||(loaded=Solitaire.game.name(),saveProgress())})),Y.on("win",(function(){!won&&enabled&&(loaded=null,won=!0,record(1),clearProgress(),function(){const delay=500,duration=900,interval=900;getGame().eachStack((function(stack){stack.eachCard((function(card){if(!card)return;const node=card.node;card===stack.my_Last()?(node.plug(Y.Breakout,{columns:5}),function(node){setTimeout((function(){node.breakout.explode({random:.65,duration:duration})}),delay)}(node),delay+=interval):node.addClass("hidden")}))}),"foundation"),setTimeout((function(){Statistics.winDisplay()}),delay+200)}())})),Y.on("beforeSetup",(function(){const winDisplay=Y.one("#win_display");winDisplay&&winDisplay.remove(),Statistics.enable()})),Y.mix(Statistics,{winDisplay:function(){const Application=Solitaire.Application;Y.one(".solitairey_body").append(winDisplay()),Y.on("click",(function(){Application.newGame()}),Y.one("#win_display .new_deal"))},enable:function(){enabled=!0},disable:function(){enabled=!1}}))}),"0.0.1",{requires:["solitaire","array-extras","breakout"]}),{}})),YUI.add("tri-towers",(function(Y){const Solitaire=Y.Solitaire,TriTowers=Y.Solitaire.TriTowers=Solitaire.instance(Solitaire,{fields:["Deck","Foundation","Tableau"],width:function(){return 15*this.Card.base.width},height:function(){return 5*this.Card.base.height},createEvents:function(){Y.on("solitaire|endTurn",(function(){const tableaus=Solitaire.game.tableau.stacks;for(let i=0;i<3;i++)Y.fire("tableau:afterPop",tableaus[i])})),Solitaire.createEvents.call(this)},deal:function(){let card,stack,i,stackLength;const stacks=this.tableau.stacks,deck=this.deck,foundation=this.foundation.stacks[0];for(stack=0;stack<4;stack++)for(stackLength=3*(stack+1),i=0;i=0;){for(card=deck.pop().faceUp(),stacks[6-piles].push(card),stack=7-piles;stack<7;stack++)card=deck.pop(),stacks[stack].push(card);piles--}for(stack=1;deck.cards.length;)card=deck.pop().faceUp(),stacks[stack].push(card),stack=stack%6+1},height:function(){return 4.8*this.Card.base.height},Stack:Solitaire.instance(Solitaire.Stack),Foundation:{stackConfig:{total:4,layout:{vspacing:1.25,top:0,left:function(){return 9*Solitaire.Card.width}}},field:"foundation",draggable:!1},Tableau:{stackConfig:{total:7,layout:{hspacing:1.25,top:0,left:0}},field:"tableau",draggable:!0},Card:Solitaire.instance(Solitaire.Card,{playable:function(){return"tableau"===this.stack.field&&!this.isFaceDown},validTarget:function(stack){const target=stack.my_Last();switch(stack.field){case"tableau":return target?!target.isFaceDown&&target.color!==this.color&&target.rank===this.rank+1:13===this.rank;case"foundation":return target?target.suit===this.suit&&target.rank===this.rank-1:1===this.rank;default:return!1}}})});Yukon.fields.forEach((function(field){Yukon[field].Stack=Solitaire.instance(Yukon.Stack)})),Y.mix(Yukon.Stack,{validTarget:function(stack){return"tableau"===stack.field&&this.first().validTarget(stack)},validProxy:function(card){return!0}},!0),Y.mix(Yukon.Tableau.Stack,{setCardPosition:function(card){return this.lastCardSetCardPosition(card)}},!0)}),"0.0.1",{requires:["solitaire"]}),define(["require","exports","./prange","./french-cards","./capitalize-cards"],(function(require,exports,prange_1,french_cards_1,capitalize_cards_1){"use strict";function is_int(input){const value=""+input;return parseFloat(value)===parseInt(value,10)&&!isNaN(input)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.BoardParseResult=exports.ParseErrorType=exports.ErrorLocationType=exports.Foundations=exports.suits__str_to_int=exports.MAX_RANK=exports.MIN_RANK=exports.NUM_SUITS=exports.ranks__str_to_int=void 0,exports.fcs_js__card_from_string=fcs_js__card_from_string,exports.fcs_js__column_from_string=fcs_js__column_from_string,exports.fcs_js__freecells_from_string=fcs_js__freecells_from_string,exports.fcs_js__foundations_from_string=fcs_js__foundations_from_string,exports.determine_if_string_is_board_like=function(s){return lax_card_three_matches.test(s)};exports.ranks__str_to_int={},exports.NUM_SUITS=4;const _suits=(0,prange_1.perl_range)(0,exports.NUM_SUITS-1);exports.MIN_RANK=1,exports.MAX_RANK=13;const _ranks=(0,prange_1.perl_range)(exports.MIN_RANK,exports.MAX_RANK);for(const rank of _ranks)exports.ranks__str_to_int["0A23456789TJQK".substring(rank,rank+1)]=rank;exports.suits__str_to_int=new Map;for(const suit of _suits)exports.suits__str_to_int.set(french_cards_1.suits__int_to_str.substring(suit,suit+1),suit);class Card{constructor(rank,suit){if(this.rank=rank,this.suit=suit,!is_int(rank))throw"rank is not an integer.";if(!is_int(suit))throw"suit is not an integer.";if(rank<1)throw"rank is too low.";if(rank>exports.MAX_RANK)throw"rank is too high.";if(suit<0)throw"suit is negative.";if(suit>=exports.NUM_SUITS)throw"suit is too high."}getRank(){return this.rank}getSuit(){return this.suit}toString(){return"0A23456789TJQK".substring(this.rank,this.rank+1)+french_cards_1.suits__int_to_str.substring(this.suit,this.suit+1)}}class Column{constructor(cards){this.cards=cards}getLen(){return this.cards.length}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getLen())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getLen()-1).map((i=>that.getCard(i).toString()))}toString(){return Array.prototype.concat.apply([],[[":"],this.getArrOfStrs()]).join(" ")+"\n"}}const card_re="("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")";function fcs_js__card_from_string(s){const m=s.match("^"+card_re+"$");if(!m)throw'Invalid format for a card - "'+s+'"';return new Card(exports.ranks__str_to_int[m[1]],exports.suits__str_to_int.get(m[2]))}class BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error){this.is_correct=is_correct,this.start_char_idx=start_char_idx,this.num_consumed_chars=num_consumed_chars,this.error=error}getEnd(){return this.start_char_idx+this.num_consumed_chars}}class ColumnParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,cards){super(is_correct,start_char_idx,num_consumed_chars,error),this.col=new Column(cards)}getLen(){return this.col.getLen()}toString(){return this.col.toString()}}class StringParser{constructor(s){this.s=s,this.consumed=0}consume(m){const len_match=m[1].length;this.consumed+=len_match,this.s=this.s.substring(len_match)}getConsumed(){return this.consumed}isNotEmpty(){return this.s.length>0}match(re){return this.s.match(re)}consume_match(re){const that=this,m=that.match(re);return m&&that.consume(m),m}skipComments(){this.consume_match(/^((?:[ \t]*#[^\n\r]*\r?\n)*)/)}}class CardsStringParser extends StringParser{constructor(s,card_mapper){super(s),this.card_mapper=card_mapper,this.cards=[],this.is_start=!0}afterStart(){this.is_start=!1}getStartSpace(){return this.is_start?"":" +"}should_loop(){return this.isNotEmpty()&&!this.consume_match(/^(\s*(?:#[^\n]*)?\n?)$/)}add(m){this.cards.push(this.card_mapper(m[2])),this.afterStart()}loop(re,callback){const p=this;for(;p.should_loop();){const m=p.consume_match("^("+p.getStartSpace()+"("+re+"))");if(!m)return p.consume_match("^( *)"),callback();p.add(m)}return null}}function calc_1H_error_string(suit){return'Wrong rank specifier "1" (followed by "[R]"). Perhaps you meant either "A[R]" (for ace) or "T[R]" (for rank ten).'.replace(/\[R\]/g,suit)}function fcs_js__column_from_string(start_char_idx,orig_s,force_leading_colon){const p=new CardsStringParser(orig_s,fcs_js__card_from_string),match=p.consume_match("^((?:: +|:(?:$|(?=\\n)))?)");if(force_leading_colon&&!match[1].length)return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),'Columns must start with a ":" in strict mode.',[]);const ret=p.loop(card_re,(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return new ColumnParseResult(!1,start_char_idx,p.getConsumed(),m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]",[])}));return ret||new ColumnParseResult(!0,start_char_idx,p.getConsumed(),"",p.cards)}class Freecells{constructor(num_freecells,cards){if(this.num_freecells=num_freecells,this.cards=cards,!is_int(num_freecells))throw"num_freecells is not an integer.";if(cards.length!==num_freecells)throw"cards length mismatch."}getNum(){return this.num_freecells}getCard(idx){if(idx<0)throw"idx is below zero.";if(idx>=this.getNum())throw"idx exceeds the length of the column.";return this.cards[idx]}getArrOfStrs(){const that=this;return(0,prange_1.perl_range)(0,that.getNum()-1).map((i=>{const card=that.getCard(i);return null!==card?card.toString():"-"}))}toString(){return Array.prototype.concat.apply([],[["Freecells:"],this.getArrOfStrs()]).join(" ")+"\n"}}class FreecellsParseResult extends BaseResult{constructor(is_correct,start_char_idx,num_consumed_chars,error,num_freecells,fc){super(is_correct,start_char_idx,num_consumed_chars,error),is_correct&&(this.freecells=new Freecells(num_freecells,fc))}}function fcs_js__freecells_from_string(num_freecells,start_char_idx,orig_s){const p=new CardsStringParser(orig_s,(card_str=>"-"===card_str?null:fcs_js__card_from_string(card_str)));function make_ret(verdict,err_str){return new FreecellsParseResult(verdict,start_char_idx,p.getConsumed(),err_str,num_freecells,verdict?p.cards:[])}if(!p.consume_match(new RegExp("^("+freecells_prefix_re+":(?: +|$|(?=\\n)))")))return make_ret(!1,'Wrong line prefix for freecells - should be "Freecells:"');const ret=p.loop("\\-|(?:"+card_re+")",(()=>{const m=p.match(/^(\S+)/)[1].match("^1("+french_cards_1.suit_re+")");return make_ret(!1,m?calc_1H_error_string(m[1]):"Wrong card format - should be [Rank][Suit]")}));if(ret)return ret;for(;p.cards.length=0&&rank<=exports.MAX_RANK))throw"rank is out of range.";return!(this.ranks[suit]>=0)&&(this.ranks[suit]=rank,!0)}finalize(){const that=this;for(let i=0;i0&&arr.push(french_cards_1.suits__int_to_str[suit]+"-"+"0A23456789TJQK"[val])}return Array.prototype.concat.apply([],[["Foundations:"],arr]).join(" ")+"\n"}_validateDeckSuit(deck,suit){if(0!==deck)throw"multiple decks are not supported.";if(!is_int(suit))throw"suit is not an integer.";if(!(suit>=0&&suitnew capitalize_cards_1.BoardTextLine(l)));for(const l of lines){{const matches=l.getContent().match(/[a-z]+/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.LOWERCASE_LETTERS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}{const matches=l.getContent().match(/10/g);if(matches&&matches.length>0){const err=new ParseError(ParseErrorType.HAS_10_STRINGS,[],fcs_js__card_from_string("AH"));err.problem_strings=matches,that.errors.push(err),that.is_valid=!1}}}that.columns=[];const counter=_suits.map((i=>(0,prange_1.perl_range)(0,exports.MAX_RANK).map((i=>[])))),p=new StringParser(orig_s);if(p.skipComments(),p.match(foundations_prefix_re)){const start_char_idx=p.getConsumed(),fo=fcs_js__foundations_from_string(1,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.foundations=fo,!fo.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Foundations,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}if(p.skipComments(),p.match(new RegExp("^"+freecells_prefix_re+":"))){const start_char_idx=p.getConsumed(),fc=fcs_js__freecells_from_string(num_freecells,start_char_idx,p.consume_match(/^([^\n]*(?:\n|$))/)[1]);if(that.freecells=fc,!fc.is_correct)return that.errors.push(new ParseError(ParseErrorType.LINE_PARSE_ERROR,[new ErrorLocation(ErrorLocationType.Freecells,0,start_char_idx,p.getConsumed())],fcs_js__card_from_string("AH"))),void(that.is_valid=!1)}for(let i=0;i{const col=col_res.col;for(const h of(0,prange_1.perl_range)(0,col.getLen()-1)){const card=col.getCard(h);counter[card.getSuit()][card.getRank()].push(new ParseLocation(ErrorLocationType.Column,idx,h))}}));const too_many_cards__errors=[],not_enough_cards__errors=[];for(const suit of _suits)for(const rank of _ranks){const count=counter[suit][rank];function add_error(arr,type_,locs){arr.push(new ParseError(type_,locs,new Card(rank,suit))),that.is_valid=!1}if(count.length>1){const locs=count.map((v=>new ErrorLocation(v.type_,v.row,0,0)));add_error(too_many_cards__errors,ParseErrorType.TOO_MUCH_OF_CARD,locs)}else count.length<1&&add_error(not_enough_cards__errors,ParseErrorType.NOT_ENOUGH_OF_CARD,[])}that.errors.push(...too_many_cards__errors),that.errors.push(...not_enough_cards__errors)}getBoardString(){const that=this;let ret="";that.foundations&&(ret+=that.foundations.foundations.toString()),that.freecells&&(ret+=that.freecells.freecells.toString());for(const col of that.columns)ret+=col.toString();return ret}_calc_filled(){return this.columns.filter((c=>c.getLen()>0))}checkIfFlipped(){let i=0;const my_filled_columns=this._calc_filled();for(;i<6;++i){if(i>=my_filled_columns.length)return!1;if(8!=my_filled_columns[i].getLen())return!1}for(;i<7;++i){if(i>=my_filled_columns.length)return!1;if(4!=my_filled_columns[i].getLen())return!1}for(;imy_filled_columns[c].col.getCard(i).toString())).join(" ")+"\n",!1));return new BoardParseResult(8,4,new_columns.map((col=>col.toString())).join(""))}}exports.BoardParseResult=BoardParseResult;const lax_card_rank_re="(?:(?:"+french_cards_1.rank_re+")|10|[01])",lax_card_with_spaces_re="(?:(?:\\s|^)"+("(?:(?:"+lax_card_rank_re+french_cards_1.suit_re+")|(?:"+french_cards_1.suit_re+lax_card_rank_re+"))")+"(?=(?:\\s|$)))",lax_card_three_matches=new RegExp(lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re+".*?"+lax_card_with_spaces_re,"ims")})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.rank_re=exports.rank_str=exports.suit_re=exports.suits__int_to_str=void 0,exports.suits__int_to_str="HCDS",exports.suit_re="["+exports.suits__int_to_str+"]",exports.rank_str="A23456789TJQK",exports.rank_re="["+exports.rank_str+"]"})),define(["require","exports"],(function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.perl_range=function(start,end){const ret=[];for(let i=start;i<=end;++i)ret.push(i);return ret}})),define(["require","exports"],(function(require,exports){"use strict";function _to_int(s){return parseInt(s,10)}function _find_max_step(n){let x=1;for(;x<<1{},this.past_first_output_state_promise=expander=>expander.past_first_output_state()}init_from_string(num_stacks,num_freecells,ultimate_source,ultimate_dest,initial_src_state_str){const expander=this,col_matches=initial_src_state_str.match(/(\n:[^\n]*)/g);if(!col_matches||col_matches.length!==num_stacks)throw"Miscount of stacks.";for(let idx=0;idxfc?"s"===fc.t?fc.s:" "+fc.c:" ")).join("")+"\n"+this.modified_state.c.map((col=>":"+col.map((card=>" "+card)).join("")+"\n")).join("");this.ret_array.push({str:state_string,type:"s"})}move_using_freecells(source,dest,count){const expander=this,num_cards_thru_freecell=count-1;for(let i=0;i=0;--i)expander.add_move({t:"f2s",src:expander.empty_fc_indexes[i],dest:dest})}recursive_move(source,dest,num_cards_r,empty_cols){const expander=this;if(num_cards_r<=0)return;const running_empty_cols=empty_cols.slice(0),steps=[];for(;Math.ceil(num_cards_r/expander.step_width)>1;){const count_cards=_find_max_step(Math.ceil(num_cards_r/expander.step_width))*expander.step_width,temp_dest=running_empty_cols.shift();expander.recursive_move(source,temp_dest,count_cards,running_empty_cols),steps.push({count:count_cards,dest:temp_dest,source:source}),num_cards_r-=count_cards}expander.move_using_freecells(source,dest,num_cards_r);for(const s of steps.reverse())expander.recursive_move(s.dest,dest,s.count,running_empty_cols),running_empty_cols.push(s.dest),running_empty_cols.sort(((a,b)=>a-b))}add_move(my_move){this.output_state_promise(this),this.ret_array.push({str:_render_move(my_move),type:"m"}),this.perform_move(my_move),this.output_state_promise=this.past_first_output_state_promise}perform_move(my_move){const expander=this,src=my_move.src,dest=my_move.dest;if("s2f"===my_move.t)expander.modified_state.f[dest]={c:expander.modified_state.c[src].pop(),t:"c"};else if("s2s"===my_move.t)expander.modified_state.c[dest].push(expander.modified_state.c[src].pop());else{if("c"!==expander.modified_state.f[src].t)throw"Wrong val in "+src+"Freecell.";expander.modified_state.c[dest].push(expander.modified_state.f[src].c),expander.modified_state.f[src]=null}}}function fc_solve_expand_move(num_stacks,num_freecells,initial_src_state_str,initial_move,initial_dest_state_str){const matched=initial_move.str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)$/),raw_ret=[{str:initial_move.str,type:"m"}];if(!matched)return raw_ret;const ultimate_num_cards=_to_int(matched[1]);if(1===ultimate_num_cards)return raw_ret;const ultimate_source=_to_int(matched[2]),ultimate_dest=_to_int(matched[3]),expander=new Expander;return expander.init_from_string(num_stacks,num_freecells,ultimate_source,ultimate_dest,initial_src_state_str),expander.recursive_move(ultimate_source,ultimate_dest,ultimate_num_cards,expander.empty_stack_indexes),expander.ret_array}})),define(["require","exports","./fcs-validate","./web-fcs-api-base","./web-fc-solve--expand-moves","./french-cards"],(function(require,exports,validate,BaseApi,web_fc_solve__expand_moves_1,french_cards_1){"use strict";let myalert;Object.defineProperty(exports,"__esModule",{value:!0}),exports.FC_Solve=exports.DisplayFilter=exports.FCS_STATE_SUSPEND_PROCESS=exports.FCS_STATE_WAS_SOLVED=exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR=exports.FCS_ES_FILLED_BY_ANY_CARD=void 0,exports.FC_Solve_init_wrappers_with_module=function(Module){const module_wrapper=BaseApi.base_calc_module_wrapper(Module);return module_wrapper.bh_create=Module._black_hole_solver_create,module_wrapper.bh_free=Module._black_hole_solver_free,module_wrapper.user_alloc=Module._freecell_solver_user_alloc,module_wrapper.user_solve_board=Module.cwrap("freecell_solver_user_solve_board","number",["number","string"]),module_wrapper.user_resume_solution=Module._freecell_solver_user_resume_solution,module_wrapper.user_cmd_line_read_cmd_line_preset=Module.cwrap("freecell_solver_user_cmd_line_read_cmd_line_preset","number",["number","string","number","number","number","string"]),module_wrapper.user_get_empty_stacks_filled_by=Module._freecell_solver_user_get_empty_stacks_filled_by,module_wrapper.user_get_next_move=Module.cwrap("freecell_solver_user_get_next_move","number",["number","number"]),module_wrapper.user_get_num_freecells=Module._freecell_solver_user_get_num_freecells,module_wrapper.user_get_num_stacks=Module._freecell_solver_user_get_num_stacks,module_wrapper.user_get_num_states_in_collection_long=Module._freecell_solver_user_get_num_states_in_collection_long,module_wrapper.user_get_num_times_long=Module._freecell_solver_user_get_num_times_long,module_wrapper.user_get_sequence_move=Module._freecell_solver_user_get_sequence_move,module_wrapper.user_get_sequences_are_built_by_type=Module._freecell_solver_user_get_sequences_are_built_by_type,module_wrapper.user_get_unrecognized_cmd_line_flag=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag","number",["number","number"]),module_wrapper.user_get_unrecognized_cmd_line_flag_status=Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag_status","number",["number","number"]),module_wrapper.user_current_state_stringify=Module._freecell_solver_user_current_state_stringify,module_wrapper.user_stringify_move_ptr=Module.cwrap("freecell_solver_user_stringify_move_ptr","number",["number","number","number","number"]),module_wrapper.user_free=Module._freecell_solver_user_free,module_wrapper.user_limit_iterations_long=Module._freecell_solver_user_limit_iterations_long,module_wrapper.user_get_invalid_state_error_into_string=Module.cwrap("freecell_solver_user_get_invalid_state_error_into_string","number",["number","number","number"]),module_wrapper.user_cmd_line_parse_args_with_file_nesting_count=Module.cwrap("freecell_solver_user_cmd_line_parse_args_with_file_nesting_count","number",["number","number","number","number","number","number","number","number","number","number","number"]),module_wrapper.alloc_wrap=(my_malloc=>(size,desc,error)=>{const buffer=my_malloc(size);if(0===buffer)throw alert("Could not allocate "+desc+" (out of memory?)"),error;return buffer})(Module.cwrap("malloc","number",["number"])),module_wrapper.c_free=Module.cwrap("free","number",["number"]),module_wrapper.fc_solve_Pointer_stringify=ptr=>Module.UTF8ToString(ptr,1e4),module_wrapper.stringToAscii=(s,outPtr)=>Module.writeArrayToMemory(Module.intArrayFromString(s),outPtr),module_wrapper.stringToUTF8=(s,outPtr,maxBytes)=>Module.stringToUTF8(s,outPtr,maxBytes),module_wrapper};try{myalert=alert||(e=>{throw console.log(e+"\n"),e})}catch(x){myalert=e=>{throw console.log(e+"\n"),e}}const remove_trailing_space_re=/[ \t]+$/gm;exports.FCS_ES_FILLED_BY_ANY_CARD=0,exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR=0,exports.FCS_STATE_WAS_SOLVED=0;exports.FCS_STATE_SUSPEND_PROCESS=5;const fc_solve_2uni_suit_map={H:"♥",C:"♣",D:"♦",S:"♠"},fc_solve_2uni_suit_map_num={H:1,C:3,D:2,S:0};function fc_solve_2uni_card(match,p1,p2,offset,mystring){return p1+fc_solve_2uni_suit_map[p2]}function fc_solve_2uni_char_card(match,p1,p2,offset,mystring){const rank=validate.ranks__str_to_int[p1];return String.fromCodePoint(16*fc_solve_2uni_suit_map_num[p2]+127136+rank)}function fc_solve_2uni_found(match,p1,p2,offset,mystring){return fc_solve_2uni_suit_map[p1]+p2}const card_re=new RegExp("\\b("+french_cards_1.rank_re+")("+french_cards_1.suit_re+")\\b","g"),found_re=new RegExp("\\b("+french_cards_1.suit_re+")(-[0A2-9TJQK])\\b","g");exports.DisplayFilter=class{constructor(args){this.is_unicode_cards=args.is_unicode_cards,this.is_unicode_cards_chars=args.is_unicode_cards_chars}unicode_preprocess(out_buffer){return this.is_unicode_cards?this._replace_found(this.is_unicode_cards_chars?this._replace_char_card(out_buffer):this._replace_card(out_buffer)):out_buffer}_replace_char_card(s){return s.replace(card_re,fc_solve_2uni_char_card)}_replace_card(s){return s.replace(card_re,fc_solve_2uni_card)}_replace_found(s){return s.replace(found_re,fc_solve_2uni_found)}};exports.FC_Solve=class{constructor(args){const that=this;that.module_wrapper=args.module_wrapper,that._do_not_alert=!1,that._cached_num_times_long=-1,that._cached_num_states_long=-1,that.dir_base=args.dir_base,that.string_params=args.string_params?[args.string_params]:null,that.set_status_callback=args.set_status_callback,that.cmd_line_preset=args.cmd_line_preset,that.current_iters_limit=0,that.obj=(()=>{const ret_obj=that.module_wrapper.user_alloc();if(0===ret_obj)throw alert("Could not allocate solver instance (out of memory?)"),"Foo";if(0!==that._initialize_obj(ret_obj))throw that._do_not_alert?that._do_not_alert=!1:alert("Failed to initialize solver (Bug!)"),that.module_wrapper.user_free(ret_obj),"Bar";return ret_obj})(),that._cached_num_times_long=-1,that._cached_num_states_long=-1,that.proto_states_and_moves_seq=null,that._pre_expand_states_and_moves_seq=null,that._post_expand_states_and_moves_seq=null}get_pre_expand_states_and_moves_seq(){return this._pre_expand_states_and_moves_seq}set_status(myclass,mylabel){return this.set_status_callback(myclass,mylabel)}handle_err_code(solve_err_code){const that=this;if(8===solve_err_code){const error_string_ptr=that._error_string_buffer;that.module_wrapper.user_get_invalid_state_error_into_string(that.obj,error_string_ptr,1);const error_string=that.module_wrapper.fc_solve_Pointer_stringify(error_string_ptr);throw alert(error_string+"\n"),"Foo"}if(solve_err_code===exports.FCS_STATE_SUSPEND_PROCESS)return that.current_iters_limit>=131072?void that.set_status("exceeded","Iterations count exceeded at "+that.current_iters_limit):void that.set_status("running","Running ("+that.current_iters_limit+" iterations)");if(solve_err_code!==exports.FCS_STATE_WAS_SOLVED){if(1!==solve_err_code)throw alert("Unknown Error code "+solve_err_code+"!"),"Foo";that.set_status("impossible","Could not solve.")}else that.set_status("solved","Solved")}resume_solution(){this._increase_iters_limit();const solve_err_code=this.module_wrapper.user_resume_solution(this.obj);return this.handle_err_code(solve_err_code),solve_err_code}do_solve(proto_board_string){const that=this;that.set_status("running","Running");try{that._increase_iters_limit();const board_string=that._process_board_string(proto_board_string),solve_err_code=that.module_wrapper.user_solve_board(that.obj,board_string);return that.handle_err_code(solve_err_code),solve_err_code}catch(e){return void that.set_status("error","Error")}}unicode_preprocess(out_buffer,display){return display.unicode_preprocess(out_buffer)}display_solution(args){const that=this,displayer=args.displayer;let ret;try{that._calc_states_and_moves_seq(),that.set_status("solved","Solved"),ret=that._display_specific_sol(that._pre_expand_states_and_moves_seq,displayer)}catch(e){return}return ret}display_expanded_moves_solution(args){return this._calc_expanded_seq(),this.set_status("solved","Solved"),this._display_specific_sol(this._post_expand_states_and_moves_seq,args.displayer)}calc_expanded_move(idx){const states_and_moves_sequence=this.proto_states_and_moves_seq;return states_and_moves_sequence[idx].exp||(states_and_moves_sequence[idx].exp=(0,web_fc_solve__expand_moves_1.fc_solve_expand_move)(8,4,states_and_moves_sequence[idx-1].str,states_and_moves_sequence[idx].m,states_and_moves_sequence[idx+1].str)),states_and_moves_sequence[idx].exp}generic_display_sol(args){return args.expand?this.display_expanded_moves_solution(args):this.display_solution(args)}get_empty_stacks_filled_by(){return this.module_wrapper.user_get_empty_stacks_filled_by(this.obj)}get_num_freecells(){return this.module_wrapper.user_get_num_freecells(this.obj)}_is_num_times_invalid(iters){return iters<0}get_num_times_long(){const that=this;if(that._is_num_times_invalid(that._cached_num_times_long)){if(!that.obj)throw"obj is null when num_times not set.";return that._calc_get_num_times_long_based_obj()}return that._cached_num_times_long}_calc_get_num_states_in_collection_long_based_obj(){return this.module_wrapper.user_get_num_states_in_collection_long(this.obj)}_calc_get_num_times_long_based_obj(){return this.module_wrapper.user_get_num_times_long(this.obj)}get_num_stacks(){return this.module_wrapper.user_get_num_stacks(this.obj)}get_num_states_in_collection_long(){const that=this;if(that._is_num_times_invalid(that._cached_num_states_long)){if(!that.obj)throw"obj is null when num_times not set.";return that._calc_get_num_states_in_collection_long_based_obj()}return that._cached_num_states_long}get_sequence_move(){return this.module_wrapper.user_get_sequence_move(this.obj)}get_sequences_are_built_by_type(){return this.module_wrapper.user_get_sequences_are_built_by_type(this.obj)}_check_if_params_match_preset({empty_stacks_filled_by:empty_stacks_filled_by,sequence_move:sequence_move,sequences_are_built_by_type:sequences_are_built_by_type,wanted_num_freecells:wanted_num_freecells,wanted_num_stacks:wanted_num_stacks}){let reasons="";this.get_empty_stacks_filled_by()!==empty_stacks_filled_by&&(reasons+="Wrong empty_stacks_filled_by!\n"),this.get_num_stacks()!==wanted_num_stacks&&(reasons+="Wrong number of stacks!\n"),this.get_num_freecells()!==wanted_num_freecells&&(reasons+="Wrong number of freecells!\n"),this.get_sequence_move()!==sequence_move&&(reasons+="Wrong sequence_move!\n"),this.get_sequences_are_built_by_type()!==sequences_are_built_by_type&&(reasons+="Wrong sequences_are_built_by_type!\n");return{reasons:reasons,verdict:0==reasons.length}}check_if_params_match_freecell(){const empty_stacks_filled_by=exports.FCS_ES_FILLED_BY_ANY_CARD,sequences_are_built_by_type=exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR;return this._check_if_params_match_preset({empty_stacks_filled_by:empty_stacks_filled_by,sequence_move:0,sequences_are_built_by_type:sequences_are_built_by_type,wanted_num_freecells:4,wanted_num_stacks:8})}_calc_states_and_moves_seq(){const that=this;if(that._pre_expand_states_and_moves_seq)return;const states_and_moves_sequence=[];function _out_state(s){states_and_moves_sequence.push({type:"s",str:s})}function get_state_str(){return that.module_wrapper.user_current_state_stringify(that.obj,that._state_string_buffer,1,0,1),that.module_wrapper.fc_solve_Pointer_stringify(that._state_string_buffer)}let move_ret_code;_out_state(get_state_str());const move_buffer=that._move_buffer;for(;0===(move_ret_code=that.module_wrapper.user_get_next_move(that.obj,move_buffer));){const state_as_string=get_state_str();that.module_wrapper.user_stringify_move_ptr(that.obj,that._move_string_buffer,move_buffer,0);const move_as_string=that.module_wrapper.fc_solve_Pointer_stringify(that._move_string_buffer);states_and_moves_sequence.push({exp:null,is_exp:!1,m:{str:move_as_string,type:"m"},type:"m"}),_out_state(state_as_string)}that.proto_states_and_moves_seq=states_and_moves_sequence,that._pre_expand_states_and_moves_seq=states_and_moves_sequence.map((item=>"m"===item.type?item.m:item)),that._post_expand_states_and_moves_seq=null,that._cached_num_times_long=that._calc_get_num_times_long_based_obj(),that._cached_num_states_long=that._calc_get_num_states_in_collection_long_based_obj(),that.module_wrapper.user_free(that.obj),that.obj=0,that.module_wrapper.c_free(that._state_string_buffer),that._state_string_buffer=0,that._move_string_buffer=0,that._move_buffer=0}_calc_expanded_seq(){const that=this;if(that._post_expand_states_and_moves_seq)return;that._calc_states_and_moves_seq();const states_and_moves_sequence=that.proto_states_and_moves_seq,new_array=[states_and_moves_sequence[0]];for(let i=1;i[]));let deck=(0,prange_1.perl_range)(0,51);randomizer.shuffle(deck),deck=deck.reverse();for(let i=0;i<52;i++)columns[i%8].push(deck[i]);function render_card(card){const suit=card%4,rank=Math.floor(card/4);return"A23456789TJQK".charAt(rank)+"CDHS".charAt(suit)}return columns.map((function(col){return": "+col.map(render_card).join(" ")+"\n"})).join("")};class MSRand{constructor(args){this.module_wrapper=args.module_wrapper,this.gamenumber=args.gamenumber,this.rander=this.module_wrapper.ms_rand__get(),this.module_wrapper.ms_rand__init(this.rander,""+this.gamenumber)}max_rand(mymax){return this.module_wrapper.ms_rand__mod_rand(this.rander,mymax)}shuffle(deck){const that=this;if(deck.length){let i=deck.length;for(;--i;){const j=that.max_rand(i+1),tmp=deck[i];deck[i]=deck[j],deck[j]=tmp}}return deck}}})); \ No newline at end of file diff --git a/docs/js/fcs-validate.js b/docs/js/fcs-validate.js index 9c083e4..061adc3 100644 --- a/docs/js/fcs-validate.js +++ b/docs/js/fcs-validate.js @@ -1,8 +1,7 @@ -define(["require", "exports", "./prange", "./french-cards"], function (require, exports, prange_1, french_cards_1) { +define(["require", "exports", "./prange", "./french-cards", "./capitalize-cards"], function (require, exports, prange_1, french_cards_1, capitalize_cards_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BoardParseResult = exports.ParseErrorType = exports.ErrorLocationType = exports.Foundations = exports.suits__str_to_int = exports.MAX_RANK = exports.MIN_RANK = exports.NUM_SUITS = exports.ranks__str_to_int = void 0; - exports.capitalize_cards = capitalize_cards; exports.fcs_js__card_from_string = fcs_js__card_from_string; exports.fcs_js__column_from_string = fcs_js__column_from_string; exports.fcs_js__freecells_from_string = fcs_js__freecells_from_string; @@ -66,52 +65,6 @@ define(["require", "exports", "./prange", "./french-cards"], function (require, french_cards_1.suits__int_to_str.substring(this.suit, this.suit + 1)); } } - class BoardTextLine { - constructor(line) { - this.line = line; - const that = this; - const m1 = line.match(/^([^\n\r]*)([\n\r]*)$/); - that.newline = m1[2]; - let l = m1[1]; - if (m1[1].match(/#/)) { - const m2 = m1[1].match(/^(.*?)(#.*)/); - that.comment = m2[2]; - l = m2[1]; - } - else { - that.comment = ""; - } - if (l.match(/:/)) { - const m3 = l.match(/^([^:]*:)(.*)/); - that.prefix = m3[1]; - that.content = m3[2]; - } - else { - that.prefix = ""; - that.content = l; - } - return; - } - getContent() { - return this.content; - } - capitalize() { - const that = this; - const ret = that.prefix + - that.getContent().toUpperCase() + - that.comment + - that.newline; - return ret; - } - } - function capitalize_cards(board) { - return board - .match(/[^\n]*\n?/g) - .map((l) => { - return new BoardTextLine(l).capitalize(); - }) - .join(""); - } class Column { constructor(cards) { this.cards = cards; @@ -490,7 +443,7 @@ define(["require", "exports", "./prange", "./french-cards"], function (require, this.is_valid = true; const that = this; const lines = orig_s.match(/[^\n]*\n?/g).map((l) => { - return new BoardTextLine(l); + return new capitalize_cards_1.BoardTextLine(l); }); for (const l of lines) { { diff --git a/docs/js/web-fc-solve--expand-moves.js b/docs/js/web-fc-solve--expand-moves.js index 3c51f6d..1558950 100644 --- a/docs/js/web-fc-solve--expand-moves.js +++ b/docs/js/web-fc-solve--expand-moves.js @@ -2,6 +2,7 @@ define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.fc_solve_expand_move = fc_solve_expand_move; + exports.fc_solve_expand_moves_filter_solution_text = fc_solve_expand_moves_filter_solution_text; function _to_int(s) { return parseInt(s, 10); } @@ -95,7 +96,13 @@ define(["require", "exports"], function (require, exports) { "\n" + expander.modified_state.c .map((col) => { - return ": " + col.join(" ") + "\n"; + return (":" + + col + .map((card) => { + return " " + card; + }) + .join("") + + "\n"); }) .join(""); expander.ret_array.push({ @@ -192,13 +199,19 @@ define(["require", "exports"], function (require, exports) { } function fc_solve_expand_move(num_stacks, num_freecells, initial_src_state_str, initial_move, initial_dest_state_str) { const matched = initial_move.str.match(/^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)$/); + const raw_ret = [ + { + str: initial_move.str, + type: "m", + }, + ]; if (!matched) { - return [initial_move]; + return raw_ret; } const ultimate_num_cards = _to_int(matched[1]); // TODO : Implement the case where the sequence move is unlimited. if (ultimate_num_cards === 1) { - return [initial_move]; + return raw_ret; } const ultimate_source = _to_int(matched[2]); const ultimate_dest = _to_int(matched[3]); @@ -208,4 +221,58 @@ define(["require", "exports"], function (require, exports) { expander.recursive_move(ultimate_source, ultimate_dest, ultimate_num_cards, expander.empty_stack_indexes); return expander.ret_array; } + function fc_solve_expand_moves_filter_solution_text(num_stacks, num_freecells, initial_str) { + const founds_pat = "^Foundations:[^\\n]*\\n"; + const freecells_pat = "^Freecells:[^\\n]*\\n"; + const move_line_pat = "^Move (?:[2-9][0-9]*|1[0-9]+) cards from stack [0-9]+ to stack [0-9]+$"; + const board_pat = founds_pat + freecells_pat + "(?:^:[^\\n]*\\n)+"; + const board2move_sep = "\n\n====================\n\n"; + const move2board_sep = "\n"; + const move2board_sep4output = "\n\n"; + const re = new RegExp("(" + + board_pat + + ")" + + board2move_sep + + "(" + + move_line_pat + + ")" + + "\\n" + + move2board_sep + + "(?=" + + "(" + + board_pat + + ")" + + ")", "gms"); + let expanded_sol = initial_str; + let changes = 0; + do { + changes = 0; + expanded_sol = expanded_sol.replace(re, function replacer(match, initial_str, move, fin) { + ++changes; + let ret = ""; + const arr = fc_solve_expand_move(num_stacks, num_freecells, initial_str, { str: move }, fin); + ret += initial_str; + ret += board2move_sep; + let i; + for (i = 0; i < arr.length - 1; i += 2) { + const m_elem = arr[i]; + if (m_elem.type != "m") { + throw "wrong KI.T ''" + m_elem.type + "''"; + } + ret += m_elem.str; + ret += move2board_sep4output; + const s_elem = arr[i + 1]; + if (s_elem.type != "s") { + throw "wrong K[I+1].T ''" + s_elem.type + "''"; + } + ret += s_elem.str; + ret += board2move_sep; + } + ret += arr[i].str; + ret += move2board_sep4output; + return ret; + }); + } while (changes != 0); + return expanded_sol; + } }); diff --git a/docs/js/web-fc-solve.js b/docs/js/web-fc-solve.js index 0fa6caa..725f6ec 100644 --- a/docs/js/web-fc-solve.js +++ b/docs/js/web-fc-solve.js @@ -1,26 +1,58 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc-solve--expand-moves", "./french-cards"], function (require, exports, validate, BaseApi, web_fc_solve__expand_moves_1, french_cards_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - exports.FC_Solve = exports.DisplayFilter = exports.FCS_STATE_SUSPEND_PROCESS = exports.FCS_STATE_WAS_SOLVED = void 0; + exports.FC_Solve = exports.DisplayFilter = exports.FCS_STATE_SUSPEND_PROCESS = exports.FCS_STATE_WAS_SOLVED = exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR = exports.FCS_ES_FILLED_BY_ANY_CARD = void 0; exports.FC_Solve_init_wrappers_with_module = FC_Solve_init_wrappers_with_module; + let myalert; + try { + if (!alert) { + myalert = (e) => { + console.log(e + "\n"); + throw e; + }; + } + else { + myalert = alert; + } + } + catch (x) { + myalert = (e) => { + console.log(e + "\n"); + throw e; + }; + } function FC_Solve_init_wrappers_with_module(Module) { const module_wrapper = BaseApi.base_calc_module_wrapper(Module); - module_wrapper.fc_solve_allocate_i8 = (p1) => { - return Module.allocate(p1, "i8", Module.ALLOC_STACK); - }; - module_wrapper.user_alloc = Module.cwrap("freecell_solver_user_alloc", "number", []); + module_wrapper.bh_create = Module._black_hole_solver_create; + module_wrapper.bh_free = Module._black_hole_solver_free; + module_wrapper.user_alloc = Module._freecell_solver_user_alloc; module_wrapper.user_solve_board = Module.cwrap("freecell_solver_user_solve_board", "number", ["number", "string"]); - module_wrapper.user_resume_solution = Module.cwrap("freecell_solver_user_resume_solution", "number", ["number"]); + module_wrapper.user_resume_solution = + Module._freecell_solver_user_resume_solution; module_wrapper.user_cmd_line_read_cmd_line_preset = Module.cwrap("freecell_solver_user_cmd_line_read_cmd_line_preset", "number", ["number", "string", "number", "number", "number", "string"]); + module_wrapper.user_get_empty_stacks_filled_by = + Module._freecell_solver_user_get_empty_stacks_filled_by; module_wrapper.user_get_next_move = Module.cwrap("freecell_solver_user_get_next_move", "number", ["number", "number"]); - module_wrapper.user_get_num_freecells = Module.cwrap("freecell_solver_user_get_num_freecells", "number", ["number"]); - module_wrapper.user_get_num_stacks = Module.cwrap("freecell_solver_user_get_num_stacks", "number", ["number"]); + module_wrapper.user_get_num_freecells = + Module._freecell_solver_user_get_num_freecells; + module_wrapper.user_get_num_stacks = + Module._freecell_solver_user_get_num_stacks; + module_wrapper.user_get_num_states_in_collection_long = + Module._freecell_solver_user_get_num_states_in_collection_long; + module_wrapper.user_get_num_times_long = + Module._freecell_solver_user_get_num_times_long; + module_wrapper.user_get_sequence_move = + Module._freecell_solver_user_get_sequence_move; + module_wrapper.user_get_sequences_are_built_by_type = + Module._freecell_solver_user_get_sequences_are_built_by_type; module_wrapper.user_get_unrecognized_cmd_line_flag = Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag", "number", ["number", "number"]); module_wrapper.user_get_unrecognized_cmd_line_flag_status = Module.cwrap("freecell_solver_user_get_unrecognized_cmd_line_flag_status", "number", ["number", "number"]); - module_wrapper.user_current_state_stringify = Module.cwrap("freecell_solver_user_current_state_stringify", "number", ["number", "number", "number", "number", "number"]); + module_wrapper.user_current_state_stringify = + Module._freecell_solver_user_current_state_stringify; module_wrapper.user_stringify_move_ptr = Module.cwrap("freecell_solver_user_stringify_move_ptr", "number", ["number", "number", "number", "number"]); - module_wrapper.user_free = Module.cwrap("freecell_solver_user_free", "number", ["number"]); - module_wrapper.user_limit_iterations_long = Module.cwrap("freecell_solver_user_limit_iterations_long", "number", ["number", "number"]); + module_wrapper.user_free = Module._freecell_solver_user_free; + module_wrapper.user_limit_iterations_long = + Module._freecell_solver_user_limit_iterations_long; module_wrapper.user_get_invalid_state_error_into_string = Module.cwrap("freecell_solver_user_get_invalid_state_error_into_string", "number", ["number", "number", "number"]); module_wrapper.user_cmd_line_parse_args_with_file_nesting_count = Module.cwrap("freecell_solver_user_cmd_line_parse_args_with_file_nesting_count", "number", [ @@ -50,9 +82,17 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- module_wrapper.fc_solve_Pointer_stringify = (ptr) => { return Module.UTF8ToString(ptr, 10000); }; + module_wrapper.stringToAscii = (s, outPtr) => { + return Module.writeArrayToMemory(Module.intArrayFromString(s), outPtr); + }; + module_wrapper.stringToUTF8 = (s, outPtr, maxBytes) => { + return Module.stringToUTF8(s, outPtr, maxBytes); + }; return module_wrapper; } const remove_trailing_space_re = /[ \t]+$/gm; + exports.FCS_ES_FILLED_BY_ANY_CARD = 0; + exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR = 0; exports.FCS_STATE_WAS_SOLVED = 0; const FCS_STATE_IS_NOT_SOLVEABLE = 1; const FCS_STATE_ALREADY_EXISTS = 2; @@ -110,12 +150,17 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- } } exports.DisplayFilter = DisplayFilter; + const _PTR_SIZE = 4; + const _read_from_file_str_ptr_size = 32; + const _arg_str_ptr_size = 128; const ptr_type = "i32"; class FC_Solve { constructor(args) { const that = this; that.module_wrapper = args.module_wrapper; that._do_not_alert = false; + that._cached_num_times_long = -1; + that._cached_num_states_long = -1; that.dir_base = args.dir_base; that.string_params = args.string_params ? [args.string_params] : null; that.set_status_callback = args.set_status_callback; @@ -141,13 +186,17 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- } return ret_obj; })(); + that._cached_num_times_long = -1; + that._cached_num_states_long = -1; that.proto_states_and_moves_seq = null; that._pre_expand_states_and_moves_seq = null; that._post_expand_states_and_moves_seq = null; - that._state_string_buffer = that.module_wrapper.alloc_wrap(500, "state string buffer", "Zam"); - that._move_string_buffer = that.module_wrapper.alloc_wrap(200, "move string buffer", "Plum"); return; } + get_pre_expand_states_and_moves_seq() { + const that = this; + return that._pre_expand_states_and_moves_seq; + } set_status(myclass, mylabel) { const that = this; return that.set_status_callback(myclass, mylabel); @@ -155,10 +204,9 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- handle_err_code(solve_err_code) { const that = this; if (solve_err_code === FCS_STATE_INVALID_STATE) { - const error_string_ptr = that.module_wrapper.alloc_wrap(300, "state error string", "Gum"); + const error_string_ptr = that._error_string_buffer; that.module_wrapper.user_get_invalid_state_error_into_string(that.obj, error_string_ptr, 1); const error_string = that.module_wrapper.fc_solve_Pointer_stringify(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr); alert(error_string + "\n"); throw "Foo"; } @@ -248,14 +296,95 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- ? that.display_expanded_moves_solution(args) : that.display_solution(args); } + get_empty_stacks_filled_by() { + const that = this; + return that.module_wrapper.user_get_empty_stacks_filled_by(that.obj); + } get_num_freecells() { const that = this; return that.module_wrapper.user_get_num_freecells(that.obj); } + _is_num_times_invalid(iters) { + return iters < 0; + } + get_num_times_long() { + const that = this; + if (that._is_num_times_invalid(that._cached_num_times_long)) { + if (!that.obj) { + throw "obj is null when num_times not set."; + } + return that._calc_get_num_times_long_based_obj(); + } + return that._cached_num_times_long; + } + _calc_get_num_states_in_collection_long_based_obj() { + const that = this; + return that.module_wrapper.user_get_num_states_in_collection_long(that.obj); + } + _calc_get_num_times_long_based_obj() { + const that = this; + return that.module_wrapper.user_get_num_times_long(that.obj); + } get_num_stacks() { const that = this; return that.module_wrapper.user_get_num_stacks(that.obj); } + get_num_states_in_collection_long() { + const that = this; + if (that._is_num_times_invalid(that._cached_num_states_long)) { + if (!that.obj) { + throw "obj is null when num_times not set."; + } + return that._calc_get_num_states_in_collection_long_based_obj(); + } + return that._cached_num_states_long; + } + get_sequence_move() { + const that = this; + return that.module_wrapper.user_get_sequence_move(that.obj); + } + get_sequences_are_built_by_type() { + const that = this; + return that.module_wrapper.user_get_sequences_are_built_by_type(that.obj); + } + _check_if_params_match_preset({ empty_stacks_filled_by, sequence_move, sequences_are_built_by_type, wanted_num_freecells, wanted_num_stacks, }) { + const that = this; + let reasons = ""; + if (that.get_empty_stacks_filled_by() !== empty_stacks_filled_by) { + reasons += "Wrong empty_stacks_filled_by!\n"; + } + if (that.get_num_stacks() !== wanted_num_stacks) { + reasons += "Wrong number of stacks!\n"; + } + if (that.get_num_freecells() !== wanted_num_freecells) { + reasons += "Wrong number of freecells!\n"; + } + if (that.get_sequence_move() !== sequence_move) { + reasons += "Wrong sequence_move!\n"; + } + if (that.get_sequences_are_built_by_type() !== + sequences_are_built_by_type) { + reasons += "Wrong sequences_are_built_by_type!\n"; + } + const verdict = reasons.length == 0; + return { reasons: reasons, verdict: verdict }; + } + check_if_params_match_freecell() { + const that = this; + let reasons = ""; + const wanted_num_freecells = 4; + const wanted_num_stacks = 8; + const empty_stacks_filled_by = exports.FCS_ES_FILLED_BY_ANY_CARD; + const sequence_move = 0; + const sequences_are_built_by_type = exports.FCS_SEQ_BUILT_BY_ALTERNATE_COLOR; + return that._check_if_params_match_preset({ + empty_stacks_filled_by: empty_stacks_filled_by, + sequence_move: sequence_move, + sequences_are_built_by_type: sequences_are_built_by_type, + wanted_num_freecells: wanted_num_freecells, + wanted_num_stacks: wanted_num_stacks, + }); + } _calc_states_and_moves_seq() { const that = this; if (that._pre_expand_states_and_moves_seq) { @@ -274,7 +403,7 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- _out_state(get_state_str()); let move_ret_code; // 128 bytes are enough to hold a move. - const move_buffer = that.module_wrapper.alloc_wrap(128, "a buffer for the move", "maven"); + const move_buffer = that._move_buffer; while ((move_ret_code = that.module_wrapper.user_get_next_move(that.obj, move_buffer)) === 0) { const state_as_string = get_state_str(); that.module_wrapper.user_stringify_move_ptr(that.obj, that._move_string_buffer, move_buffer, 0); @@ -295,14 +424,16 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- return item.type === "m" ? item.m : item; }); that._post_expand_states_and_moves_seq = null; + that._cached_num_times_long = that._calc_get_num_times_long_based_obj(); + that._cached_num_states_long = + that._calc_get_num_states_in_collection_long_based_obj(); // Cleanup C resources - that.module_wrapper.c_free(move_buffer); that.module_wrapper.user_free(that.obj); that.obj = 0; that.module_wrapper.c_free(that._state_string_buffer); that._state_string_buffer = 0; - that.module_wrapper.c_free(that._move_string_buffer); that._move_string_buffer = 0; + that._move_buffer = 0; return; } _calc_expanded_seq() { @@ -357,17 +488,48 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- ? that.module_wrapper.fc_solve_Pointer_stringify(s_ptr) : ""; } + _initialize_object_buffers() { + const that = this; + const _error_string_buffer_size = 512; + const _state_string_buffer_size = 500; + const _move_string_buffer_size = 200; + const _move_buffer_size = 64; + const _args_buffer_size = _PTR_SIZE * 2; + const _last_arg_ptr_buffer_size = _PTR_SIZE; + const _total_buffer_size = _state_string_buffer_size + + _move_string_buffer_size + + _move_buffer_size + + _read_from_file_str_ptr_size + + _arg_str_ptr_size + + _args_buffer_size + + _last_arg_ptr_buffer_size + + _error_string_buffer_size; + that._state_string_buffer = that.module_wrapper.alloc_wrap(_total_buffer_size, "state+move string buffer", "Zam"); + if (!that._state_string_buffer) { + alert("that._state_string_buffer is 0"); + } + that._move_string_buffer = + that._state_string_buffer + _state_string_buffer_size; + that._move_buffer = that._move_string_buffer + _move_string_buffer_size; + that._read_from_file_str_ptr = that._move_buffer + _move_buffer_size; + that._arg_str_ptr = + that._read_from_file_str_ptr + _read_from_file_str_ptr_size; + that._args_buffer = that._arg_str_ptr + _arg_str_ptr_size; + that._last_arg_ptr_buffer = that._args_buffer + _args_buffer_size; + that._error_string_buffer = + that._last_arg_ptr_buffer + _last_arg_ptr_buffer_size; + } _initialize_obj(obj) { const that = this; const cmd_line_preset = that.cmd_line_preset; try { + that._initialize_object_buffers(); if (cmd_line_preset !== "default") { - const error_string_ptr_buf = that.module_wrapper.alloc_wrap(128, "error string buffer", "Foo"); + const error_string_ptr_buf = that._error_string_buffer; const preset_ret = that.module_wrapper.user_cmd_line_read_cmd_line_preset(obj, cmd_line_preset, 0, error_string_ptr_buf, 0, null); const error_string_ptr = that.module_wrapper.Module.getValue(error_string_ptr_buf, ptr_type); const error_string = that._stringify_possibly_null_ptr(error_string_ptr); that.module_wrapper.c_free(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr_buf); if (preset_ret !== 0) { alert("Failed to load command line preset '" + cmd_line_preset + @@ -378,28 +540,27 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- } } if (that.string_params) { - const error_string_ptr_buf = that.module_wrapper.alloc_wrap(128, "error string buffer", "Engo"); + const error_string_ptr_buf = that._error_string_buffer; // Create a file with the contents of string_params. // var base_path = '/' + that.dir_base; const base_path = "/"; const file_basename = "string-params.fc-solve.txt"; const string_params_file_path = base_path + file_basename; that.module_wrapper.Module.FS.writeFile(string_params_file_path, that.string_params[0], {}); - const args_buf = that.module_wrapper.alloc_wrap(4 * 2, "args buf", "Seed"); + const args_buf = that._args_buffer; // TODO : Is there a memory leak here? - const read_from_file_str_ptr = that.module_wrapper.fc_solve_allocate_i8(that.module_wrapper.Module.intArrayFromString("--read-from-file")); - const arg_str_ptr = that.module_wrapper.fc_solve_allocate_i8(that.module_wrapper.Module.intArrayFromString("0," + string_params_file_path)); + const read_from_file_str_ptr = that._read_from_file_str_ptr; + that.module_wrapper.stringToUTF8("--read-from-file", read_from_file_str_ptr, _read_from_file_str_ptr_size); + const arg_str_ptr = that._arg_str_ptr; + that.module_wrapper.stringToUTF8("0," + string_params_file_path, arg_str_ptr, _arg_str_ptr_size); that.module_wrapper.Module.setValue(args_buf, read_from_file_str_ptr, ptr_type); - that.module_wrapper.Module.setValue(args_buf + 4, arg_str_ptr, ptr_type); - const last_arg_ptr = that.module_wrapper.alloc_wrap(4, "last_arg_ptr", "cherry"); + that.module_wrapper.Module.setValue(args_buf + _PTR_SIZE, arg_str_ptr, ptr_type); + const last_arg_ptr = that._last_arg_ptr_buffer; // Input the file to the solver. const args_ret_code = that.module_wrapper.user_cmd_line_parse_args_with_file_nesting_count(obj, 2, args_buf, 0, 0, 0, 0, error_string_ptr_buf, last_arg_ptr, -1, 0); - that.module_wrapper.c_free(last_arg_ptr); - that.module_wrapper.c_free(args_buf); const error_string_ptr = that.module_wrapper.Module.getValue(error_string_ptr_buf, ptr_type); const error_string = that._stringify_possibly_null_ptr(error_string_ptr); that.module_wrapper.c_free(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr_buf); if (args_ret_code !== 0) { const unrecognized_opt_ptr = that.module_wrapper.user_get_unrecognized_cmd_line_flag_status(obj, 0) == 0 ? that.module_wrapper.user_get_unrecognized_cmd_line_flag(obj, 0) @@ -443,6 +604,7 @@ define(["require", "exports", "./fcs-validate", "./web-fcs-api-base", "./web-fc- return 0; } catch (e) { + console.log("Error = " + e + "\n"); that.set_status("error", "Error"); return -1; } diff --git a/docs/js/web-fcs-api-base.js b/docs/js/web-fcs-api-base.js index 8d03ace..45b2a49 100644 --- a/docs/js/web-fcs-api-base.js +++ b/docs/js/web-fcs-api-base.js @@ -4,11 +4,11 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) exports.base_calc_module_wrapper = base_calc_module_wrapper; exports.deal_ms_fc_board = deal_ms_fc_board; function base_calc_module_wrapper(Module) { - const ms_rand__get_singleton = Module.cwrap("fc_solve__hll_ms_rand__get_singleton", "number", []); + const ms_rand__get = Module.cwrap("fc_solve__hll_ms_rand__get_global_instance", "number", []); const ms_rand__init = Module.cwrap("fc_solve__hll_ms_rand__init", "number", ["number", "string"]); const ms_rand__mod_rand = Module.cwrap("fc_solve__hll_ms_rand__mod_rand", "number", ["number", "number"]); return { - ms_rand__get_singleton, + ms_rand__get, ms_rand__init, ms_rand__mod_rand, Module, @@ -25,7 +25,7 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) const that = this; that.module_wrapper = args.module_wrapper; that.gamenumber = args.gamenumber; - that.rander = that.module_wrapper.ms_rand__get_singleton(); + that.rander = that.module_wrapper.ms_rand__get(); that.module_wrapper.ms_rand__init(that.rander, "" + that.gamenumber); return; } @@ -34,10 +34,11 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) return that.module_wrapper.ms_rand__mod_rand(that.rander, mymax); } shuffle(deck) { + const that = this; if (deck.length) { let i = deck.length; while (--i) { - const j = this.max_rand(i + 1); + const j = that.max_rand(i + 1); const tmp = deck[i]; deck[i] = deck[j]; deck[j] = tmp; diff --git a/src/js/capitalize-cards.js b/src/js/capitalize-cards.js new file mode 100644 index 0000000..2022c5e --- /dev/null +++ b/src/js/capitalize-cards.js @@ -0,0 +1,53 @@ +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.BoardTextLine = void 0; + exports.capitalize_cards = capitalize_cards; + class BoardTextLine { + constructor(line) { + this.line = line; + const that = this; + const m1 = line.match(/^([^\n\r]*)([\n\r]*)$/); + that.newline = m1[2]; + let l = m1[1]; + if (m1[1].match(/#/)) { + const m2 = m1[1].match(/^(.*?)(#.*)/); + that.comment = m2[2]; + l = m2[1]; + } + else { + that.comment = ""; + } + if (l.match(/:/)) { + const m3 = l.match(/^([^:]*:)(.*)/); + that.prefix = m3[1]; + that.content = m3[2]; + } + else { + that.prefix = ""; + that.content = l; + } + return; + } + getContent() { + return this.content; + } + capitalize() { + const that = this; + const ret = that.prefix + + that.getContent().toUpperCase() + + that.comment + + that.newline; + return ret; + } + } + exports.BoardTextLine = BoardTextLine; + function capitalize_cards(board) { + return board + .match(/[^\n]*\n?/g) + .map((l) => { + return new BoardTextLine(l).capitalize(); + }) + .join(""); + } +}); diff --git a/src/js/web-fcs-api-base.js b/src/js/web-fcs-api-base.js index 8d03ace..45b2a49 100644 --- a/src/js/web-fcs-api-base.js +++ b/src/js/web-fcs-api-base.js @@ -4,11 +4,11 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) exports.base_calc_module_wrapper = base_calc_module_wrapper; exports.deal_ms_fc_board = deal_ms_fc_board; function base_calc_module_wrapper(Module) { - const ms_rand__get_singleton = Module.cwrap("fc_solve__hll_ms_rand__get_singleton", "number", []); + const ms_rand__get = Module.cwrap("fc_solve__hll_ms_rand__get_global_instance", "number", []); const ms_rand__init = Module.cwrap("fc_solve__hll_ms_rand__init", "number", ["number", "string"]); const ms_rand__mod_rand = Module.cwrap("fc_solve__hll_ms_rand__mod_rand", "number", ["number", "number"]); return { - ms_rand__get_singleton, + ms_rand__get, ms_rand__init, ms_rand__mod_rand, Module, @@ -25,7 +25,7 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) const that = this; that.module_wrapper = args.module_wrapper; that.gamenumber = args.gamenumber; - that.rander = that.module_wrapper.ms_rand__get_singleton(); + that.rander = that.module_wrapper.ms_rand__get(); that.module_wrapper.ms_rand__init(that.rander, "" + that.gamenumber); return; } @@ -34,10 +34,11 @@ define(["require", "exports", "./prange"], function (require, exports, prange_1) return that.module_wrapper.ms_rand__mod_rand(that.rander, mymax); } shuffle(deck) { + const that = this; if (deck.length) { let i = deck.length; while (--i) { - const j = this.max_rand(i + 1); + const j = that.max_rand(i + 1); const tmp = deck[i]; deck[i] = deck[j]; deck[j] = tmp; diff --git a/src/ts/capitalize-cards.ts b/src/ts/capitalize-cards.ts new file mode 100644 index 0000000..674b36a --- /dev/null +++ b/src/ts/capitalize-cards.ts @@ -0,0 +1,49 @@ +export class BoardTextLine { + private newline: string; + private comment: string; + private prefix: string; + private content: string; + constructor(public line: string) { + const that = this; + const m1 = line.match(/^([^\n\r]*)([\n\r]*)$/); + that.newline = m1[2]; + let l = m1[1]; + if (m1[1].match(/#/)) { + const m2 = m1[1].match(/^(.*?)(#.*)/); + that.comment = m2[2]; + l = m2[1]; + } else { + that.comment = ""; + } + if (l.match(/:/)) { + const m3 = l.match(/^([^:]*:)(.*)/); + that.prefix = m3[1]; + that.content = m3[2]; + } else { + that.prefix = ""; + that.content = l; + } + return; + } + public getContent(): string { + return this.content; + } + public capitalize(): string { + const that = this; + const ret = + that.prefix + + that.getContent().toUpperCase() + + that.comment + + that.newline; + return ret; + } +} + +export function capitalize_cards(board: string): string { + return board + .match(/[^\n]*\n?/g) + .map((l) => { + return new BoardTextLine(l).capitalize(); + }) + .join(""); +} diff --git a/src/ts/fcs-validate.ts b/src/ts/fcs-validate.ts index 1199538..bdddd43 100644 --- a/src/ts/fcs-validate.ts +++ b/src/ts/fcs-validate.ts @@ -1,5 +1,6 @@ import { perl_range } from "./prange"; import { rank_re, suits__int_to_str, suit_re } from "./french-cards"; +import { BoardTextLine, capitalize_cards } from "./capitalize-cards"; // Adapted from http://www.inventpartners.com/javascript_is_int - thanks. function is_int(input: number): boolean { @@ -28,7 +29,10 @@ for (const suit of _suits) { } class Card { - constructor(private rank: number, private suit: number) { + constructor( + private rank: number, + private suit: number, + ) { if (!is_int(rank)) { throw "rank is not an integer."; } @@ -65,56 +69,6 @@ class Card { } } -class BoardTextLine { - private newline: string; - private comment: string; - private prefix: string; - private content: string; - constructor(public line: string) { - const that = this; - const m1 = line.match(/^([^\n\r]*)([\n\r]*)$/); - that.newline = m1[2]; - let l = m1[1]; - if (m1[1].match(/#/)) { - const m2 = m1[1].match(/^(.*?)(#.*)/); - that.comment = m2[2]; - l = m2[1]; - } else { - that.comment = ""; - } - if (l.match(/:/)) { - const m3 = l.match(/^([^:]*:)(.*)/); - that.prefix = m3[1]; - that.content = m3[2]; - } else { - that.prefix = ""; - that.content = l; - } - return; - } - public getContent(): string { - return this.content; - } - public capitalize(): string { - const that = this; - const ret = - that.prefix + - that.getContent().toUpperCase() + - that.comment + - that.newline; - return ret; - } -} - -export function capitalize_cards(board: string): string { - return board - .match(/[^\n]*\n?/g) - .map((l) => { - return new BoardTextLine(l).capitalize(); - }) - .join(""); -} - class Column { constructor(private cards: Card[]) {} @@ -238,7 +192,10 @@ class CardsStringParser extends StringParser { public cards: CardType[] = []; private is_start: boolean = true; - constructor(s: string, private card_mapper: (string) => CardType) { + constructor( + s: string, + private card_mapper: (string) => CardType, + ) { super(s); } @@ -346,7 +303,10 @@ export function fcs_js__column_from_string( type MaybeCard = Card | null; class Freecells { - constructor(private num_freecells: number, private cards: MaybeCard[]) { + constructor( + private num_freecells: number, + private cards: MaybeCard[], + ) { if (!is_int(num_freecells)) { throw "num_freecells is not an integer."; } diff --git a/src/ts/web-fc-solve--expand-moves.ts b/src/ts/web-fc-solve--expand-moves.ts index 31438d0..9f3e1ad 100644 --- a/src/ts/web-fc-solve--expand-moves.ts +++ b/src/ts/web-fc-solve--expand-moves.ts @@ -29,11 +29,17 @@ function _render_move(my_move: Expander_Move): string { return "Move a card from freecell " + src + " to stack " + dest; } } + +interface Expander_RetElem { + str: string; + type: string; +} + class Expander { public modified_state = { f: [], c: [] }; public empty_fc_indexes: number[] = []; public empty_stack_indexes: number[] = []; - public ret_array: any[] = []; + public ret_array: Expander_RetElem[] = []; public foundations_str: string; public step_width: number; constructor() { @@ -117,7 +123,15 @@ class Expander { "\n" + expander.modified_state.c .map((col) => { - return ": " + col.join(" ") + "\n"; + return ( + ":" + + col + .map((card) => { + return " " + card; + }) + .join("") + + "\n" + ); }) .join(""); @@ -253,20 +267,27 @@ export function fc_solve_expand_move( initial_src_state_str: string, initial_move: { str: string }, initial_dest_state_str: string, -) { +): Expander_RetElem[] { const matched = initial_move.str.match( /^Move ([0-9]+) cards from stack ([0-9]+) to stack ([0-9]+)$/, ); + const raw_ret = [ + { + str: initial_move.str, + type: "m", + }, + ]; + if (!matched) { - return [initial_move]; + return raw_ret; } const ultimate_num_cards = _to_int(matched[1]); // TODO : Implement the case where the sequence move is unlimited. if (ultimate_num_cards === 1) { - return [initial_move]; + return raw_ret; } const ultimate_source = _to_int(matched[2]); @@ -291,3 +312,76 @@ export function fc_solve_expand_move( return expander.ret_array; } + +export function fc_solve_expand_moves_filter_solution_text( + num_stacks: number, + num_freecells: number, + initial_str: string, +): string { + const founds_pat = "^Foundations:[^\\n]*\\n"; + const freecells_pat = "^Freecells:[^\\n]*\\n"; + const move_line_pat = + "^Move (?:[2-9][0-9]*|1[0-9]+) cards from stack [0-9]+ to stack [0-9]+$"; + const board_pat = founds_pat + freecells_pat + "(?:^:[^\\n]*\\n)+"; + const board2move_sep = "\n\n====================\n\n"; + const move2board_sep = "\n"; + const move2board_sep4output = "\n\n"; + const re = new RegExp( + "(" + + board_pat + + ")" + + board2move_sep + + "(" + + move_line_pat + + ")" + + "\\n" + + move2board_sep + + "(?=" + + "(" + + board_pat + + ")" + + ")", + "gms", + ); + let expanded_sol = initial_str; + let changes = 0; + do { + changes = 0; + expanded_sol = expanded_sol.replace( + re, + function replacer(match, initial_str, move, fin) { + ++changes; + let ret = ""; + const arr = fc_solve_expand_move( + num_stacks, + num_freecells, + initial_str, + { str: move }, + fin, + ); + ret += initial_str; + ret += board2move_sep; + let i; + for (i = 0; i < arr.length - 1; i += 2) { + const m_elem = arr[i]; + if (m_elem.type != "m") { + throw "wrong KI.T ''" + m_elem.type + "''"; + } + ret += m_elem.str; + ret += move2board_sep4output; + const s_elem = arr[i + 1]; + if (s_elem.type != "s") { + throw "wrong K[I+1].T ''" + s_elem.type + "''"; + } + ret += s_elem.str; + ret += board2move_sep; + } + ret += arr[i].str; + ret += move2board_sep4output; + return ret; + }, + ); + } while (changes != 0); + + return expanded_sol; +} diff --git a/src/ts/web-fc-solve.ts b/src/ts/web-fc-solve.ts index 5e55ccd..20dda81 100644 --- a/src/ts/web-fc-solve.ts +++ b/src/ts/web-fc-solve.ts @@ -3,24 +3,55 @@ import * as BaseApi from "./web-fcs-api-base"; import { fc_solve_expand_move } from "./web-fc-solve--expand-moves"; import { rank_re, suit_re } from "./french-cards"; +let myalert: any; +try { + if (!alert) { + myalert = (e) => { + console.log(e + "\n"); + throw e; + }; + } else { + myalert = alert; + } +} catch (x) { + myalert = (e) => { + console.log(e + "\n"); + throw e; + }; +} + export interface ModuleWrapper extends BaseApi.ModuleWrapper { alloc_wrap: (size: number, desc: string, error: string) => number; + bh_create: (buffer: number) => number; + bh_free: (instance: number) => number; c_free: (buffer: number) => number; - fc_solve_allocate_i8: (pointer: number) => number; fc_solve_Pointer_stringify: (buffer: number) => string; - user_alloc: (...args: any) => any; + stringToAscii: (s: string, outPtr: number) => void; + stringToUTF8: (s: string, outPtr: number, maxBytes: number) => void; + user_alloc: () => number; user_cmd_line_parse_args_with_file_nesting_count: (...args: any) => any; user_cmd_line_read_cmd_line_preset: (...args: any) => any; - user_current_state_stringify: (...args: any) => any; - user_free: (...args: any) => any; + user_current_state_stringify: ( + instance: number, + a1: number, + a2: number, + a3: number, + a4: number, + ) => number; + user_free: (instance: number) => number; + user_get_empty_stacks_filled_by: (instance: number) => number; user_get_invalid_state_error_into_string: (...args: any) => any; user_get_next_move: (...args: any) => any; - user_get_num_freecells: (...args: any) => any; - user_get_num_stacks: (...args: any) => any; + user_get_num_freecells: (instance: number) => number; + user_get_num_stacks: (instance: number) => number; + user_get_num_states_in_collection_long: (instance: number) => number; + user_get_num_times_long: (instance: number) => number; + user_get_sequence_move: (instance: number) => number; + user_get_sequences_are_built_by_type: (instance: number) => number; user_get_unrecognized_cmd_line_flag: (...args: any) => any; user_get_unrecognized_cmd_line_flag_status: (...args: any) => any; - user_limit_iterations_long: (...args: any) => any; - user_resume_solution: (...args: any) => any; + user_limit_iterations_long: (instance: number, limit: number) => number; + user_resume_solution: (instance: number) => number; user_solve_board: (...args: any) => any; user_stringify_move_ptr: (...args: any) => any; } @@ -29,44 +60,40 @@ export function FC_Solve_init_wrappers_with_module(Module): ModuleWrapper { const module_wrapper = BaseApi.base_calc_module_wrapper( Module, ) as ModuleWrapper; - module_wrapper.fc_solve_allocate_i8 = (p1) => { - return Module.allocate(p1, "i8", Module.ALLOC_STACK); - }; - module_wrapper.user_alloc = Module.cwrap( - "freecell_solver_user_alloc", - "number", - [], - ); + module_wrapper.bh_create = Module._black_hole_solver_create; + module_wrapper.bh_free = Module._black_hole_solver_free; + module_wrapper.user_alloc = Module._freecell_solver_user_alloc; module_wrapper.user_solve_board = Module.cwrap( "freecell_solver_user_solve_board", "number", ["number", "string"], ); - module_wrapper.user_resume_solution = Module.cwrap( - "freecell_solver_user_resume_solution", - "number", - ["number"], - ); + module_wrapper.user_resume_solution = + Module._freecell_solver_user_resume_solution; module_wrapper.user_cmd_line_read_cmd_line_preset = Module.cwrap( "freecell_solver_user_cmd_line_read_cmd_line_preset", "number", ["number", "string", "number", "number", "number", "string"], ); + module_wrapper.user_get_empty_stacks_filled_by = + Module._freecell_solver_user_get_empty_stacks_filled_by; module_wrapper.user_get_next_move = Module.cwrap( "freecell_solver_user_get_next_move", "number", ["number", "number"], ); - module_wrapper.user_get_num_freecells = Module.cwrap( - "freecell_solver_user_get_num_freecells", - "number", - ["number"], - ); - module_wrapper.user_get_num_stacks = Module.cwrap( - "freecell_solver_user_get_num_stacks", - "number", - ["number"], - ); + module_wrapper.user_get_num_freecells = + Module._freecell_solver_user_get_num_freecells; + module_wrapper.user_get_num_stacks = + Module._freecell_solver_user_get_num_stacks; + module_wrapper.user_get_num_states_in_collection_long = + Module._freecell_solver_user_get_num_states_in_collection_long; + module_wrapper.user_get_num_times_long = + Module._freecell_solver_user_get_num_times_long; + module_wrapper.user_get_sequence_move = + Module._freecell_solver_user_get_sequence_move; + module_wrapper.user_get_sequences_are_built_by_type = + Module._freecell_solver_user_get_sequences_are_built_by_type; module_wrapper.user_get_unrecognized_cmd_line_flag = Module.cwrap( "freecell_solver_user_get_unrecognized_cmd_line_flag", "number", @@ -77,26 +104,16 @@ export function FC_Solve_init_wrappers_with_module(Module): ModuleWrapper { "number", ["number", "number"], ); - module_wrapper.user_current_state_stringify = Module.cwrap( - "freecell_solver_user_current_state_stringify", - "number", - ["number", "number", "number", "number", "number"], - ); + module_wrapper.user_current_state_stringify = + Module._freecell_solver_user_current_state_stringify; module_wrapper.user_stringify_move_ptr = Module.cwrap( "freecell_solver_user_stringify_move_ptr", "number", ["number", "number", "number", "number"], ); - module_wrapper.user_free = Module.cwrap( - "freecell_solver_user_free", - "number", - ["number"], - ); - module_wrapper.user_limit_iterations_long = Module.cwrap( - "freecell_solver_user_limit_iterations_long", - "number", - ["number", "number"], - ); + module_wrapper.user_free = Module._freecell_solver_user_free; + module_wrapper.user_limit_iterations_long = + Module._freecell_solver_user_limit_iterations_long; module_wrapper.user_get_invalid_state_error_into_string = Module.cwrap( "freecell_solver_user_get_invalid_state_error_into_string", "number", @@ -134,12 +151,24 @@ export function FC_Solve_init_wrappers_with_module(Module): ModuleWrapper { module_wrapper.fc_solve_Pointer_stringify = (ptr) => { return Module.UTF8ToString(ptr, 10000); }; + module_wrapper.stringToAscii = (s: string, outPtr: number) => { + return Module.writeArrayToMemory(Module.intArrayFromString(s), outPtr); + }; + module_wrapper.stringToUTF8 = ( + s: string, + outPtr: number, + maxBytes: number, + ) => { + return Module.stringToUTF8(s, outPtr, maxBytes); + }; return module_wrapper; } const remove_trailing_space_re = /[ \t]+$/gm; +export const FCS_ES_FILLED_BY_ANY_CARD = 0; +export const FCS_SEQ_BUILT_BY_ALTERNATE_COLOR = 0; export const FCS_STATE_WAS_SOLVED = 0; const FCS_STATE_IS_NOT_SOLVEABLE = 1; const FCS_STATE_ALREADY_EXISTS = 2; @@ -218,6 +247,14 @@ interface DisplaySolArgs { displayer: DisplayFilter; expand: boolean; } +export interface GameVariantPresetCheckRet { + reasons: string; + verdict: boolean; +} + +const _PTR_SIZE: number = 4; +const _read_from_file_str_ptr_size: number = 32; +const _arg_str_ptr_size: number = 128; const ptr_type: string = "i32"; export class FC_Solve { @@ -229,17 +266,27 @@ export class FC_Solve { private current_iters_limit: number; private module_wrapper: ModuleWrapper; private obj: any; + private _cached_num_times_long: number; + private _cached_num_states_long: number; private _do_not_alert: boolean; private _pre_expand_states_and_moves_seq: any; private _post_expand_states_and_moves_seq: any; - private _state_string_buffer: number; + private _args_buffer: number; + private _error_string_buffer: number; + private _last_arg_ptr_buffer: number; + private _move_buffer: number; private _move_string_buffer: number; + private _state_string_buffer: number; + private _read_from_file_str_ptr: number; + private _arg_str_ptr: number; private _unrecognized_opt: string; constructor(args) { const that = this; that.module_wrapper = args.module_wrapper; that._do_not_alert = false; + that._cached_num_times_long = -1; + that._cached_num_states_long = -1; that.dir_base = args.dir_base; that.string_params = args.string_params ? [args.string_params] : null; @@ -271,22 +318,18 @@ export class FC_Solve { return ret_obj; })(); + that._cached_num_times_long = -1; + that._cached_num_states_long = -1; that.proto_states_and_moves_seq = null; that._pre_expand_states_and_moves_seq = null; that._post_expand_states_and_moves_seq = null; - that._state_string_buffer = that.module_wrapper.alloc_wrap( - 500, - "state string buffer", - "Zam", - ); - that._move_string_buffer = that.module_wrapper.alloc_wrap( - 200, - "move string buffer", - "Plum", - ); - return; } + public get_pre_expand_states_and_moves_seq() { + const that = this; + + return that._pre_expand_states_and_moves_seq; + } public set_status(myclass, mylabel) { const that = this; @@ -295,11 +338,7 @@ export class FC_Solve { public handle_err_code(solve_err_code) { const that = this; if (solve_err_code === FCS_STATE_INVALID_STATE) { - const error_string_ptr = that.module_wrapper.alloc_wrap( - 300, - "state error string", - "Gum", - ); + const error_string_ptr: number = that._error_string_buffer; that.module_wrapper.user_get_invalid_state_error_into_string( that.obj, @@ -311,7 +350,6 @@ export class FC_Solve { that.module_wrapper.fc_solve_Pointer_stringify( error_string_ptr, ); - that.module_wrapper.c_free(error_string_ptr); alert(error_string + "\n"); @@ -433,16 +471,134 @@ export class FC_Solve { ? that.display_expanded_moves_solution(args) : that.display_solution(args); } - public get_num_freecells() { + public get_empty_stacks_filled_by(): number { + const that = this; + + return that.module_wrapper.user_get_empty_stacks_filled_by(that.obj); + } + public get_num_freecells(): number { const that = this; return that.module_wrapper.user_get_num_freecells(that.obj); } - public get_num_stacks() { + private _is_num_times_invalid(iters: number): boolean { + return iters < 0; + } + public get_num_times_long(): number { + const that = this; + + if (that._is_num_times_invalid(that._cached_num_times_long)) { + if (!that.obj) { + throw "obj is null when num_times not set."; + } + return that._calc_get_num_times_long_based_obj(); + } + return that._cached_num_times_long; + } + private _calc_get_num_states_in_collection_long_based_obj(): number { + const that = this; + + return that.module_wrapper.user_get_num_states_in_collection_long( + that.obj, + ); + } + private _calc_get_num_times_long_based_obj(): number { + const that = this; + + return that.module_wrapper.user_get_num_times_long(that.obj); + } + public get_num_stacks(): number { const that = this; return that.module_wrapper.user_get_num_stacks(that.obj); } + public get_num_states_in_collection_long(): number { + const that = this; + + if (that._is_num_times_invalid(that._cached_num_states_long)) { + if (!that.obj) { + throw "obj is null when num_times not set."; + } + return that._calc_get_num_states_in_collection_long_based_obj(); + } + return that._cached_num_states_long; + } + public get_sequence_move(): number { + const that = this; + + return that.module_wrapper.user_get_sequence_move(that.obj); + } + public get_sequences_are_built_by_type(): number { + const that = this; + + return that.module_wrapper.user_get_sequences_are_built_by_type( + that.obj, + ); + } + private _check_if_params_match_preset({ + empty_stacks_filled_by, + sequence_move, + sequences_are_built_by_type, + wanted_num_freecells, + wanted_num_stacks, + }: { + empty_stacks_filled_by: number; + sequence_move: number; + sequences_are_built_by_type: number; + wanted_num_freecells: number; + wanted_num_stacks: number; + }): GameVariantPresetCheckRet { + const that = this; + + let reasons: string = ""; + + if (that.get_empty_stacks_filled_by() !== empty_stacks_filled_by) { + reasons += "Wrong empty_stacks_filled_by!\n"; + } + + if (that.get_num_stacks() !== wanted_num_stacks) { + reasons += "Wrong number of stacks!\n"; + } + + if (that.get_num_freecells() !== wanted_num_freecells) { + reasons += "Wrong number of freecells!\n"; + } + + if (that.get_sequence_move() !== sequence_move) { + reasons += "Wrong sequence_move!\n"; + } + + if ( + that.get_sequences_are_built_by_type() !== + sequences_are_built_by_type + ) { + reasons += "Wrong sequences_are_built_by_type!\n"; + } + + const verdict: boolean = reasons.length == 0; + + return { reasons: reasons, verdict: verdict }; + } + public check_if_params_match_freecell(): GameVariantPresetCheckRet { + const that = this; + + let reasons: string = ""; + + const wanted_num_freecells: number = 4; + const wanted_num_stacks: number = 8; + const empty_stacks_filled_by: number = FCS_ES_FILLED_BY_ANY_CARD; + const sequence_move: number = 0; + const sequences_are_built_by_type: number = + FCS_SEQ_BUILT_BY_ALTERNATE_COLOR; + + return that._check_if_params_match_preset({ + empty_stacks_filled_by: empty_stacks_filled_by, + sequence_move: sequence_move, + sequences_are_built_by_type: sequences_are_built_by_type, + wanted_num_freecells: wanted_num_freecells, + wanted_num_stacks: wanted_num_stacks, + }); + } private _calc_states_and_moves_seq() { const that = this; @@ -476,11 +632,7 @@ export class FC_Solve { let move_ret_code; // 128 bytes are enough to hold a move. - const move_buffer = that.module_wrapper.alloc_wrap( - 128, - "a buffer for the move", - "maven", - ); + const move_buffer = that._move_buffer; while ( (move_ret_code = that.module_wrapper.user_get_next_move( that.obj, @@ -519,14 +671,17 @@ export class FC_Solve { ); that._post_expand_states_and_moves_seq = null; + that._cached_num_times_long = that._calc_get_num_times_long_based_obj(); + that._cached_num_states_long = + that._calc_get_num_states_in_collection_long_based_obj(); + // Cleanup C resources - that.module_wrapper.c_free(move_buffer); that.module_wrapper.user_free(that.obj); that.obj = 0; that.module_wrapper.c_free(that._state_string_buffer); that._state_string_buffer = 0; - that.module_wrapper.c_free(that._move_string_buffer); that._move_string_buffer = 0; + that._move_buffer = 0; return; } @@ -602,16 +757,49 @@ export class FC_Solve { ? that.module_wrapper.fc_solve_Pointer_stringify(s_ptr) : ""; } + private _initialize_object_buffers() { + const that = this; + const _error_string_buffer_size: number = 512; + const _state_string_buffer_size: number = 500; + const _move_string_buffer_size: number = 200; + const _move_buffer_size: number = 64; + const _args_buffer_size: number = _PTR_SIZE * 2; + const _last_arg_ptr_buffer_size: number = _PTR_SIZE; + const _total_buffer_size: number = + _state_string_buffer_size + + _move_string_buffer_size + + _move_buffer_size + + _read_from_file_str_ptr_size + + _arg_str_ptr_size + + _args_buffer_size + + _last_arg_ptr_buffer_size + + _error_string_buffer_size; + that._state_string_buffer = that.module_wrapper.alloc_wrap( + _total_buffer_size, + "state+move string buffer", + "Zam", + ); + if (!that._state_string_buffer) { + alert("that._state_string_buffer is 0"); + } + that._move_string_buffer = + that._state_string_buffer + _state_string_buffer_size; + that._move_buffer = that._move_string_buffer + _move_string_buffer_size; + that._read_from_file_str_ptr = that._move_buffer + _move_buffer_size; + that._arg_str_ptr = + that._read_from_file_str_ptr + _read_from_file_str_ptr_size; + that._args_buffer = that._arg_str_ptr + _arg_str_ptr_size; + that._last_arg_ptr_buffer = that._args_buffer + _args_buffer_size; + that._error_string_buffer = + that._last_arg_ptr_buffer + _last_arg_ptr_buffer_size; + } private _initialize_obj(obj) { const that = this; const cmd_line_preset = that.cmd_line_preset; try { + that._initialize_object_buffers(); if (cmd_line_preset !== "default") { - const error_string_ptr_buf = that.module_wrapper.alloc_wrap( - 128, - "error string buffer", - "Foo", - ); + const error_string_ptr_buf: number = that._error_string_buffer; const preset_ret = that.module_wrapper.user_cmd_line_read_cmd_line_preset( obj, @@ -631,7 +819,6 @@ export class FC_Solve { that._stringify_possibly_null_ptr(error_string_ptr); that.module_wrapper.c_free(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr_buf); if (preset_ret !== 0) { alert( @@ -646,11 +833,7 @@ export class FC_Solve { } if (that.string_params) { - const error_string_ptr_buf = that.module_wrapper.alloc_wrap( - 128, - "error string buffer", - "Engo", - ); + const error_string_ptr_buf: number = that._error_string_buffer; // Create a file with the contents of string_params. // var base_path = '/' + that.dir_base; const base_path = "/"; @@ -662,22 +845,21 @@ export class FC_Solve { {}, ); - const args_buf = that.module_wrapper.alloc_wrap( - 4 * 2, - "args buf", - "Seed", - ); + const args_buf: number = that._args_buffer; // TODO : Is there a memory leak here? - const read_from_file_str_ptr = - that.module_wrapper.fc_solve_allocate_i8( - that.module_wrapper.Module.intArrayFromString( - "--read-from-file", - ), - ); - const arg_str_ptr = that.module_wrapper.fc_solve_allocate_i8( - that.module_wrapper.Module.intArrayFromString( - "0," + string_params_file_path, - ), + const read_from_file_str_ptr: number = + that._read_from_file_str_ptr; + that.module_wrapper.stringToUTF8( + "--read-from-file", + read_from_file_str_ptr, + _read_from_file_str_ptr_size, + ); + + const arg_str_ptr: number = that._arg_str_ptr; + that.module_wrapper.stringToUTF8( + "0," + string_params_file_path, + arg_str_ptr, + _arg_str_ptr_size, ); that.module_wrapper.Module.setValue( @@ -686,16 +868,12 @@ export class FC_Solve { ptr_type, ); that.module_wrapper.Module.setValue( - args_buf + 4, + args_buf + _PTR_SIZE, arg_str_ptr, ptr_type, ); - const last_arg_ptr = that.module_wrapper.alloc_wrap( - 4, - "last_arg_ptr", - "cherry", - ); + const last_arg_ptr: number = that._last_arg_ptr_buffer; // Input the file to the solver. const args_ret_code = @@ -713,9 +891,6 @@ export class FC_Solve { 0, ); - that.module_wrapper.c_free(last_arg_ptr); - that.module_wrapper.c_free(args_buf); - const error_string_ptr = that.module_wrapper.Module.getValue( error_string_ptr_buf, ptr_type, @@ -724,7 +899,6 @@ export class FC_Solve { const error_string = that._stringify_possibly_null_ptr(error_string_ptr); that.module_wrapper.c_free(error_string_ptr); - that.module_wrapper.c_free(error_string_ptr_buf); if (args_ret_code !== 0) { const unrecognized_opt_ptr = @@ -782,6 +956,7 @@ export class FC_Solve { } return 0; } catch (e) { + console.log("Error = " + e + "\n"); that.set_status("error", "Error"); return -1; } diff --git a/src/ts/web-fcs-api-base.ts b/src/ts/web-fcs-api-base.ts index 983ed3e..0815665 100644 --- a/src/ts/web-fcs-api-base.ts +++ b/src/ts/web-fcs-api-base.ts @@ -1,15 +1,15 @@ import { perl_range } from "./prange"; export interface ModuleWrapper { - ms_rand__get_singleton: (...args: any) => any; + ms_rand__get: (...args: any) => any; ms_rand__init: (...args: any) => any; ms_rand__mod_rand: (...args: any) => any; Module: any; } export function base_calc_module_wrapper(Module: any): ModuleWrapper { - const ms_rand__get_singleton = Module.cwrap( - "fc_solve__hll_ms_rand__get_singleton", + const ms_rand__get = Module.cwrap( + "fc_solve__hll_ms_rand__get_global_instance", "number", [], ); @@ -24,7 +24,7 @@ export function base_calc_module_wrapper(Module: any): ModuleWrapper { ["number", "number"], ); return { - ms_rand__get_singleton, + ms_rand__get, ms_rand__init, ms_rand__mod_rand, Module, @@ -45,19 +45,20 @@ class MSRand { const that = this; that.module_wrapper = args.module_wrapper; that.gamenumber = args.gamenumber; - that.rander = that.module_wrapper.ms_rand__get_singleton(); + that.rander = that.module_wrapper.ms_rand__get(); that.module_wrapper.ms_rand__init(that.rander, "" + that.gamenumber); return; } - public max_rand(mymax) { + public max_rand(mymax: number): number { const that = this; return that.module_wrapper.ms_rand__mod_rand(that.rander, mymax); } public shuffle(deck) { + const that = this; if (deck.length) { let i = deck.length; while (--i) { - const j = this.max_rand(i + 1); + const j = that.max_rand(i + 1); const tmp = deck[i]; deck[i] = deck[j]; deck[j] = tmp;