xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PatternDirective=function(aa,ba,ca){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"PatternDirective.ctor");if(!xmp.isNonEmptyString(aa)){throw new xmp.util.internals.InvalidArgsError("Argument 'type' must be a non-empty string.");}
this._type=aa;this._metadataMap=new xmp.util.internals.MetadataMap(true);this._metadataMap._reInitialize(ba);this._parameters=ca;};xmp.playlistapi.internals.PatternDirective.prototype.getType=function(){return this._type;};xmp.playlistapi.internals.PatternDirective.prototype.getParameterArray=function(){return this._parameters;};xmp.playlistapi.internals.PatternDirective.prototype.getMetadata=function(da,ea){return this._metadataMap._get(da,ea);};xmp.playlistapi.internals.PatternDirective.prototype._findNamedContentNode=function(fa,ga,ha){var ia=this._findNamedContentNodeFromIterator(fa._getDataIterator(),ga,ha);if(ia===null){xmp.util.internals.CategoryLogger.create('PatternDirective').info('Did not find named content node: '+ha+', trying historical data.');ia=this._findNamedContentNodeFromIterator(fa._getHistoricalDataIterator(),ga,ha);}
return ia;};xmp.playlistapi.internals.PatternDirective.prototype._findNamedContentNodeFromIterator=function(ja,ka,la){ja.first();var ma=(la==='@Content');while(ja.hasNext()){var na=ja.next();if(!na.isValid()){continue;}
if(na.isContentType()&&na.getNodeType()._getParent()._isContentCompositeType()){if(ma){if(na._getPatternAddress().isSibling(ka._getPatternAddress(),true)){return na;}}
else{if(na.getNodeType()._getParent().getId()===la){var oa=na._getPatternAddress().getParent();if(oa.isSibling(ka._getPatternAddress(),true)){return na;}}}}}
return null;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.AdPatternPlayList=function(pa,qa,ra,sa){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"AdPatternPlayList.ctor");if(!pa||!qa||!ra){throw new xmp.util.internals.InvalidArgsError("One or more constructor arguments is null.");}
this._LOOK_AHEAD_AND_BEHIND_MIN=7;this._LOOK_AHEAD_AND_BEHIND_MAX=100;this._MAX_NODE_POOL_SIZE=50;this._logger=new xmp.util.internals.CategoryLogger('AdPatternPlayList');this._lockedForModification=false;this._metadataMap=new xmp.util.internals.MetadataMap(true);this._listener=pa;this._adPatternRootNodeType=null;this._invariantRuleContextArray=null;this._ruleIdToFactoryMap={};this._ruleIdToRuleMap={};this._ruleSetRunContext=new xmp.playlistapi.RuleSetRunContext();this._lookAheadAndBehindCount=this._calculateLookAheadAndBehind();this._internalPlayListArray=[];this._historicalPlayListArray=[];this._lastNode=null;this._outStandingPlayableNodeArray=[];this._poolPlayableNodeArray=[];this._iteratator=new xmp.playlistapi.PlayListIterator(this);this._parameterMap=null;xmp.util.PlayableNode._staticInit();this._parameterMap=xmp.playlistapi.internals.ParameterMap.calcInitial(qa,sa);var ta=new xmp.playlistapi.internals.AdPatternBuilder(this._parameterMap);this._metadataMap._reInitialize(ta._extractOptionalMetaData(qa));this._adPatternRootNodeType=ta._build(qa);this._invariantRuleContextArray=ta._buildRuleContextArray(ra,null);this._logger.info('Constructed AdPatternPlayList');};xmp.playlistapi.AdPatternPlayList.prototype.getMetadata=function(ua,va){return this._metadataMap._get(ua,va);};xmp.playlistapi.AdPatternPlayList.prototype.setContentMetaResourceIds=function(wa){try{for(var i=0;i<wa.length;i++){if(typeof wa[i]!=='string'){throw new xmp.util.internals.InvalidArgsError("Argument 'contentMetaResourceIdArray' must be an array of strings.");}}
this._checkLockedForModification();this._lockForModification();var xa=new xmp.playlistapi.internals.PlayListBuilder(this,this._lastNode,this._adPatternRootNodeType,wa,this._listener);this._internalPlayListArray=xa._getOutput();}
finally{this._unlockForModification();}};xmp.playlistapi.AdPatternPlayList.prototype._getHistoricalDataIterator=function(){var ya=[];ya=ya.concat(this._historicalPlayListArray);ya=ya.concat(this._internalPlayListArray);return(new xmp.playlistapi.internals.SimplePlayListIterator(ya));};xmp.playlistapi.AdPatternPlayList.prototype.getIterator=function(){return this._iteratator;};xmp.playlistapi.AdPatternPlayList.prototype.getRuleIdArray=function(){var za=[];var Aa={};for(var i=0;i<this._invariantRuleContextArray.length;i++){var Ba=this._invariantRuleContextArray[i].getId();if(!Aa[Ba]){Aa[Ba]=Ba;za.push(Ba);}}
this._getPatternRuleIdsHelper(this._adPatternRootNodeType,za,Aa);return za;};xmp.playlistapi.AdPatternPlayList.prototype.loadRuleFactoryArray=function(Ca){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"AdPatternPlayList.loadRuleFactoryArray");if(!Ca){throw new xmp.util.internals.InvalidArgsError("Argument 'ruleFactoryArray' cannot be null.");}
this._buildRuleIdToFactoryMap(Ca);if(this._logger.isDebugEnabled()){this._logger.debug('Loaded rule factories.');}};xmp.playlistapi.AdPatternPlayList.prototype.getLookAheadNodeArray=function(){return this._buildLookAheadArray();};xmp.playlistapi.AdPatternPlayList.prototype.getLookBehindNodeArray=function(){return this._buildLookBehindArray();};xmp.playlistapi.AdPatternPlayList.prototype._getParameterMapInternal=function(){return this._parameterMap;};xmp.playlistapi.AdPatternPlayList.prototype._findRule=function(Da){var Ea=this._ruleIdToRuleMap[Da];if(typeof Ea==="undefined"){var Fa=this._getFactory(Da);try{Ea=Fa.createRule(Da);}
catch(e){throw this._createExtensionGuardException(e,'RuleFactory.createRule');}
this._ruleIdToRuleMap[Da]=Ea;}
return Ea;};xmp.playlistapi.AdPatternPlayList.prototype._buildRuleIdToFactoryMap=function(Ga){for(var i=0;i<Ga.length;i++){var Ha=Ga[i];var Ia=null;try{Ia=Ha.getCreatableRuleIds();}
catch(e){throw this._createExtensionGuardException(e,'RuleFactory.getCreatableRuleIds');}
for(var j=0;j<Ia.length;j++){var Ja=Ia[j];if(!Ja||Ja.length===0){throw new xmp.playlistapi.internals.PlayListError("RuleFactory retured a rule ID that is null, undefined, or empty.");}
if(typeof this._ruleIdToFactoryMap[Ja]!=="undefined"){throw new xmp.playlistapi.internals.PlayListError("Rule "+Ja+" found in more than one factory.");}
this._ruleIdToFactoryMap[Ja]=Ha;}}
this._verifyRuleFactories();};xmp.playlistapi.AdPatternPlayList.prototype.addRuleFactory=function(Ka,La){this._ruleIdToFactoryMap[Ka]=La;};xmp.playlistapi.AdPatternPlayList.prototype._createExtensionGuardException=function(e,Ma){var Na='Error occurred while invoking extension method: '+Ma;this._logger.warn(Na,e);Na+=', Error data: ';Na+=xmp.extractErrorMessage(e);return new xmp.playlistapi.internals.PlayListError(Na);};xmp.playlistapi.AdPatternPlayList.prototype._calculateLookAheadAndBehind=function(){var Oa=xmp.util.SettingsManager.getInstance().getContextNode();var Pa=Oa.getNodeForPath('BasePlayer');var Qa=Pa.getInt('look ahead and behind count',this._LOOK_AHEAD_AND_BEHIND_MIN);if(Qa<this._LOOK_AHEAD_AND_BEHIND_MIN){Qa=this._LOOK_AHEAD_AND_BEHIND_MIN;}
else if(Qa>this._LOOK_AHEAD_AND_BEHIND_MAX){Qa=this._LOOK_AHEAD_AND_BEHIND_MAX;}
return Qa;};xmp.playlistapi.AdPatternPlayList.prototype._verifyRuleFactories=function(){this._verifyInvariantRuleFactories();this._verifyPlayableNodeTypeRuleFactoriesHelper(this._adPatternRootNodeType);};xmp.playlistapi.AdPatternPlayList.prototype._verifyInvariantRuleFactories=function(){for(var i=0;i<this._invariantRuleContextArray.length;i++){var Ra=this._invariantRuleContextArray[i].getId();this._getFactory(Ra);}};xmp.playlistapi.AdPatternPlayList.prototype._verifyPlayableNodeTypeRuleFactoriesHelper=function(Sa){if(Sa._isCompositeType()){var Ta=Sa._getChildCount();for(var i=0;i<Ta;i++){this._verifyPlayableNodeTypeRuleFactoriesHelper(Sa._getChild(i));}}
else{var Ua=Sa._getRuleContextArray();for(var j=0;j<Ua.length;j++){var Va=Ua[j].getId();this._getFactory(Va);}}};xmp.playlistapi.AdPatternPlayList.prototype._getFactory=function(Wa){var Xa=this._ruleIdToFactoryMap[Wa];if(!Xa){throw new xmp.playlistapi.internals.PlayListError("No factory defined for rule: "+Wa);}
return Xa;};xmp.playlistapi.AdPatternPlayList.prototype._getNextRuleFilteredPlayableNode=function(){var Ya=null;while(this._internalPlayListArray.length>0){var Za=this._internalPlayListArray.shift();this._historicalPlayListArray.push(Za);if(this._safeRunRulesForNode(Za)){this._addToOutstandingArray(Za);Ya=Za;break;}
else{this._returnNodeToPool(Za);}}
if(Ya!==null){this._lastNode=Ya;}
return Ya;};xmp.playlistapi.AdPatternPlayList.prototype._safeRunRulesForNode=function($a){try{return this._runRulesForNode($a);}
catch(e){var ab='Error occured running rules for node: '+xmp.util.PlayableNode.safeGetBestId($a);ab+='\nNode will be treated AS IF A RULE FAILED, skipped.';this._logger.warn(ab,e);return false;}};xmp.playlistapi.AdPatternPlayList.prototype._runRulesForNode=function(bb){if(bb._isEmptySlot()){if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+' IS AN EMPTY SLOT, FAILURE.');}
return false;}
var cb=this._buildRuleContextsForNode(bb);if(cb.length===0){if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+' HAS NO RULES, SUCCESS.');}
return true;}
this._ruleSetRunContext._initialize(bb);for(var i=0;i<cb.length;i++){var db=cb[i];this._ruleSetRunContext._setCurrentRuleContext(db);var eb=this._findRule(db.getId());var fb=false;try{fb=eb.isPlayable(this._ruleSetRunContext);}
catch(e){throw this._createExtensionGuardException(e,'Rule.isPlayable for rule: '+this._ruleSetRunContext.getCurrentRuleContext().getId());}
if(!fb){if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+', Rule ID: '+db.getId()+' FAILED.');}
return false;}
else{if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+', Rule ID: '+db.getId()+' SUCCEEDED.');}}}
if(this._logger.isDebugEnabled()){this._logger.debug('Node: '+bb.getBestId()+' ALL RULES SUCCEEDED.');}
return true;};xmp.playlistapi.AdPatternPlayList.prototype._buildLookAheadArray=function(){var gb=[];for(var i=0;i<this._lookAheadAndBehindCount;i++){if(i>=(this._internalPlayListArray.length)){break;}
gb.push(this._internalPlayListArray[i]);}
return gb;};xmp.playlistapi.AdPatternPlayList.prototype._buildLookBehindArray=function(){var hb=[];hb=hb.concat(this._outStandingPlayableNodeArray).reverse();return hb;};xmp.playlistapi.AdPatternPlayList.prototype._buildRuleContextsForNode=function(ib){var jb=this._getApplicableInvariantRuleContexts(ib.getNodeTypeName());jb=jb.concat(ib._getRuleArrayReference());return jb;};xmp.playlistapi.AdPatternPlayList.prototype._getApplicableInvariantRuleContexts=function(kb){var lb=[];for(var i=0;i<this._invariantRuleContextArray.length;i++){var mb=this._invariantRuleContextArray[i];if(mb.isApplicable(kb)){lb.push(mb);}}
return lb;};xmp.playlistapi.AdPatternPlayList.prototype._addToOutstandingArray=function(nb){this._outStandingPlayableNodeArray.push(nb);while(this._outStandingPlayableNodeArray.length>this._lookAheadAndBehindCount){this._returnNodeToPool(this._outStandingPlayableNodeArray.shift());}};xmp.playlistapi.AdPatternPlayList.prototype._getNodeFromPool=function(){var ob=new xmp.util.PlayableNode();ob._init();return ob;};xmp.playlistapi.AdPatternPlayList.prototype._returnNodeToPool=function(pb){this._poolPlayableNodeArray.push(pb);while(this._poolPlayableNodeArray.length>this._MAX_NODE_POOL_SIZE){var qb=this._poolPlayableNodeArray.shift();if(qb){qb._clear();}}};xmp.playlistapi.AdPatternPlayList.prototype._createNode=function(){return this._getNodeFromPool();};xmp.playlistapi.AdPatternPlayList.prototype._initializeNode=function(rb){try{this._listener.handleInitializePlayableNode(rb);}
catch(e){throw this._createExtensionGuardException(e,'PlayListListener.handleInitializePlayableNode');}};xmp.playlistapi.AdPatternPlayList.prototype._lockForModification=function(){this._lockedForModification=true;};xmp.playlistapi.AdPatternPlayList.prototype._unlockForModification=function(){this._lockedForModification=false;};xmp.playlistapi.AdPatternPlayList.prototype._checkLockedForModification=function(){if(this._lockedForModification){throw new xmp.playlistapi.internals.PlayListError("Cannot modify playlist while it is locked.");}};xmp.playlistapi.AdPatternPlayList.prototype._getPatternRuleIdsHelper=function(sb,tb,ub){if(sb._isCompositeType()){var vb=sb._getChildCount();for(var i=0;i<vb;i++){var wb=sb._getChild(i);this._getPatternRuleIdsHelper(wb,tb,ub);}}
else{var xb=sb._getRuleContextArray();for(var j=0;j<xb.length;j++){var yb=xb[j].getId();if(!ub[yb]){ub[yb]=yb;tb.push(yb);}}}};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.AdResourceOverrideContext=function(zb,Ab){this._node=zb;this._parameterMap=Ab;};xmp.playlistapi.AdResourceOverrideContext.prototype.getNode=function(){return this._node;};xmp.playlistapi.AdResourceOverrideContext.prototype.addResource=function(Bb){this._node.setMetaResource(Bb);};xmp.playlistapi.AdResourceOverrideContext.prototype.getResource=function(Cb){return this._node.getMetaResource(Cb);};xmp.playlistapi.AdResourceOverrideContext.prototype.copyMetaResourceBundleRefFrom=function(Db){this._node.reSetMetaResourceBundle(Db.getMetaResourceBundle());};xmp.playlistapi.AdResourceOverrideContext.prototype.expandString=function(Eb){return this._parameterMap.expandString(Eb);};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.PlayListIterator=function(Fb){this._playList=Fb;this._currentNode=null;this._initialized=false;this._canAdvance=true;};xmp.playlistapi.PlayListIterator.prototype.first=function(){this._initialized=true;this._canAdvance=true;};xmp.playlistapi.PlayListIterator.prototype.next=function(){if(!this.hasNext()){throw new xmp.playlistapi.internals.PlayListError("Cannot call next if there are no more items to be returned, call 'hasNext' method to check.");}
this._canAdvance=true;return this._currentNode;};xmp.playlistapi.PlayListIterator.prototype.hasNext=function(){this._checkInitialized();if(this._canAdvance){this._currentNode=this._getNextCore();this._canAdvance=false;}
return(this._currentNode!==null);};xmp.playlistapi.PlayListIterator.prototype._getNextCore=function(){try{this._playList._checkLockedForModification();this._playList._lockForModification();return this._playList._getNextRuleFilteredPlayableNode();}
finally{this._playList._unlockForModification();}};xmp.playlistapi.PlayListIterator.prototype._checkInitialized=function(){if(!this._initialized){throw new xmp.playlistapi.internals.PlayListError("Iterator not initialized, call 'first' method.");}};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.PlayableNodeType=function(Gb,id,Hb){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE],"PlayableNodeType.ctor");if(!xmp.isNonEmptyString(id)||!xmp.isNonEmptyString(Hb)){throw new xmp.util.internals.InvalidArgsError("PlayableNodeType requires non-empty 'id' and 'typeName'.");}
this._typeName=Hb;this._parent=null;this._id=id;this._directive=null;this._dataObject=Gb;};xmp.playlistapi.PlayableNodeType.prototype.getTypeName=function(){return this._typeName;};xmp.playlistapi.PlayableNodeType.prototype.getId=function(){return this._id;};xmp.playlistapi.PlayableNodeType.prototype.getDataObject=function(){return this._dataObject;};xmp.playlistapi.PlayableNodeType.prototype.getMetadata=function(Ib,Jb){return null;};xmp.playlistapi.PlayableNodeType.prototype._getChildCount=function(){return 0;};xmp.playlistapi.PlayableNodeType.prototype._getParent=function(){return this._parent;};xmp.playlistapi.PlayableNodeType.prototype._isCompositeType=function(){return false;};xmp.playlistapi.PlayableNodeType.prototype._isContentCompositeType=function(){return false;};xmp.playlistapi.PlayableNodeType.prototype.isContentType=function(){return(this._typeName==='Content');};xmp.playlistapi.PlayableNodeType.prototype._setParent=function(Kb){this._parent=Kb;};xmp.playlistapi.PlayableNodeType.prototype._handlePostBuild=function(){};xmp.playlistapi.PlayableNodeType.prototype._setDirective=function(Lb){this._directive=Lb;};xmp.playlistapi.PlayableNodeType.prototype._getDirective=function(){return this._directive;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.ResouceBundle=function(){xmp.playlistapi.ResouceBundle.ctor.call(this);this._map={};};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.playlistapi.ResouceBundle);xmp.playlistapi.ResouceBundle.prototype.setMetaResource=function(Mb){if(this.getMetaResource(Mb.getType())!==null){throw new xmp.util.internals.InvalidArgsError('Node type already has a resource of type: '+Mb.getType());}
this._map[Mb.getType()]=Mb;};xmp.playlistapi.ResouceBundle.prototype.getMetaResource=function(Nb){var Ob=this._map[Nb];return(Ob)?Ob:null;};xmp.playlistapi.ResouceBundle.prototype.getResourceTypes=function(){var Pb=[];for(var t in this._map){Pb.push(t);}
return Pb;};xmp.playlistapi.ResouceBundle.prototype.getCount=function(){return(this.getResourceTypes().length);};xmp.playlistapi.ResouceBundle.prototype.clone=function(){var Qb=new xmp.playlistapi.ResouceBundle();var Rb='';for(Rb in this._map){var Sb=this.getMetaResource(Rb);Qb.setMetaResource(Sb._clone());}
return Qb;};xmp.playlistapi.ResouceBundle.prototype.getLoadableId=function(){return'ResouceBundle';};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.Resource=function(id,Tb,Ub){xmp.playlistapi.Resource.ctor.call(this);xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.OBJECT_TYPE],"Resource.ctor");if(!(xmp.isNonEmptyString(id)&&xmp.isNonEmptyString(Tb))){throw new xmp.util.internals.InvalidArgsError("Parameters 'id' and 'type' must both be non-empty strings.");}
this._id=id;this._type=Tb;this._metadataMap=new xmp.util.internals.MetadataMap(false);this._metadataMap._reInitialize(Ub);this._companionAdId=-1;};xmp.DERIVE_CLASS(xmp.util.Loadable,xmp.playlistapi.Resource);xmp.playlistapi.Resource.prototype.getId=function(){return this._id;};xmp.playlistapi.Resource.prototype.setId=function(id){this._id=id;};xmp.playlistapi.Resource.prototype.getType=function(){return this._type;};xmp.playlistapi.Resource.prototype.getMetadata=function(Vb,Wb){return this._metadataMap._get(Vb,Wb);};xmp.playlistapi.Resource.prototype.setMetadata=function(Xb,Yb){this._metadataMap._set(Xb,Yb);};xmp.playlistapi.Resource.prototype.removeMetadata=function(Zb){this._metadataMap._remove(Zb);};xmp.playlistapi.Resource.prototype._clone=function(){return new xmp.playlistapi.Resource(this._id,this._type,this._metadataMap._getClonedWrappedMetadata());};xmp.playlistapi.Resource.prototype.getLoadableId=function(){return this.getId();};xmp.playlistapi.Resource.prototype.getCompanionAdId=function(){return this._companionAdId;};xmp.playlistapi.Resource.prototype.setCompanionAdId=function($b){this._companionAdId=$b;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.RuleContext=function(id,ac,bc,cc){xmp.validateArguments(arguments,[xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE,xmp.BOOLEAN_TYPE],"RuleContext.ctor");if(id===null||id.length===0){throw new xmp.util.internals.InvalidArgsError("RuleContext requires non-empty ID.");}
if(bc.length<1){throw new xmp.util.internals.InvalidArgsError("RuleContext at least one applicable type.");}
this._id=id;this._metadataMap=new xmp.util.internals.MetadataMap(cc);this._metadataMap._reInitialize(ac);this._applicableTypeArray=bc;};xmp.playlistapi.RuleContext.createDynamic=function(id,dc){return new xmp.playlistapi.RuleContext(id,dc,['dynamic'],true);};xmp.playlistapi.RuleContext.prototype.getId=function(){return this._id;};xmp.playlistapi.RuleContext.prototype.getMetadata=function(ec,fc){return this._metadataMap._get(ec,fc);};xmp.playlistapi.RuleContext.prototype.isApplicable=function(gc){if(gc.toLowerCase()==='all'){return true;}
for(var i=0;i<this._applicableTypeArray.length;i++){if(this._applicableTypeArray[i]===gc){return true;}}
return false;};xmp.createNamespace("xmp.playlistapi");xmp.playlistapi.RuleSetRunContext=function(){this._playableNode=null;this._currentRuleContext=null;};xmp.playlistapi.RuleSetRunContext.prototype.getPlayableNode=function(){return this._playableNode;};xmp.playlistapi.RuleSetRunContext.prototype.getCurrentRuleContext=function(){return this._currentRuleContext;};xmp.playlistapi.RuleSetRunContext.prototype._initialize=function(hc){this._playableNode=hc;this._currentRuleContext=null;};xmp.playlistapi.RuleSetRunContext.prototype._setCurrentRuleContext=function(ic){this._currentRuleContext=ic;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.AdPatternBuilder=function(jc){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE],"AdPatternBuilder.ctor");this._logger=new xmp.util.internals.CategoryLogger('AdPatternBuilder');this._COMPOSITE_TYPE_ARRAY=['Composite','ContentComposite'];this._patternMap=null;this._parameterMap=jc;};xmp.playlistapi.internals.AdPatternBuilder.prototype._build=function(kc){try{this._patternMap=kc.patternMap;if(!this._isComposite(kc.root)){throw new xmp.playlistapi.internals.PlayListError("Root of ad pattern must have type of one of the following: "+this._COMPOSITE_TYPE_ARRAY.join(', '));}
var lc=this._buildHelper(kc.root,true);kc=null;return lc;}
catch(e){var mc="Error building Ad Pattern with memento data";this._logger.warn(mc,e);mc+=", error = ";mc+=xmp.extractErrorMessage(e);throw new xmp.playlistapi.internals.PlayListError(mc);}};xmp.playlistapi.internals.AdPatternBuilder.prototype._isComposite=function(nc){for(var i=0;i<this._COMPOSITE_TYPE_ARRAY.length;i++){if(nc.type===this._COMPOSITE_TYPE_ARRAY[i]){return true;}}
return false;};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildHelper=function(oc,pc){var qc=null;if(this._isComposite(oc)){var rc=(typeof oc.repeat==="number")?oc.repeat:1;qc=new xmp.playlistapi.internals[oc.type+'PlayableNodeType'](oc,(pc?'/':this._calcId(oc)),oc.type,oc.pattern,rc);if(qc._isDeferred()){qc._setReadyToValidate(false);}
else{var sc=this._patternMap[qc._getPatternName()];this._buildChildren(qc,sc);}}
else{qc=new xmp.playlistapi.internals.RuleSetPlayableNodeType(oc,this._calcId(oc),oc.type,this._buildRuleContextArray(oc.rules,oc.type),this._extractOptionalMetaData(oc));this._extractOptionalResources(oc,qc);this._extractOptionalDirective(oc,qc);}
qc._handlePostBuild();return qc;};xmp.playlistapi.internals.AdPatternBuilder.prototype._calcId=function(tc){return(typeof(tc.id)==='string')?tc.id:tc.type;};xmp.playlistapi.internals.AdPatternBuilder.prototype._extractOptionalDirective=function(uc,vc){var wc=xmp.playlistapi.internals.PatternDirectiveFactory.create(uc);vc._setDirective(wc);};xmp.playlistapi.internals.AdPatternBuilder.prototype._extractOptionalResources=function(xc,yc){if(typeof xc.resources==='object'){for(var i=0;i<xc.resources.length;i++){var zc=xc.resources[i];yc.setMetaResource(this._buildMetaResource(zc));}}};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildChildren=function(Ac,Bc){for(var i=0;i<Bc.length;i++){var Cc=this._buildHelper(Bc[i],false);Ac._addChild(Cc);}};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildDeferredContentComposite=function(Dc,Ec){this._buildChildren(Dc,Ec);Dc._setReadyToValidate(true);Dc._handlePostBuild();};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildRuleContextArray=function(Fc,Gc){var Hc=[];if(typeof Fc==="object"){for(var i=0;i<Fc.length;i++){Hc.push(this._buildRuleContext(Fc[i],Gc));}}
return Hc;};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildMetaResource=function(Ic){return new xmp.playlistapi.Resource(this._parameterMap.expandStringAndFixSlashes(Ic.id),Ic.type,this._extractOptionalMetaData(Ic));};xmp.playlistapi.internals.AdPatternBuilder.prototype._buildRuleContext=function(Jc,Kc){var Lc=[];if(Kc!==null){Lc.push(Kc);}
else{if(typeof Jc.nodeTypes==="object"){Lc=Lc.concat(Jc.nodeTypes);}}
return new xmp.playlistapi.RuleContext(this._parameterMap.expandString(Jc.id),this._extractOptionalMetaData(Jc),Lc,true);};xmp.playlistapi.internals.AdPatternBuilder.prototype._extractOptionalMetaData=function(Mc){var Nc={};if(typeof Mc.meta==="object"){var Oc='';for(Oc in Mc.meta){var Pc=this._parameterMap.expandString(Mc.meta[Oc]);Nc[Oc]=Pc;}}
return Nc;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.CompositePlayableNodeType=function(Qc,id,Rc,Sc,Tc){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.NUMBER_TYPE],"CompositePlayableNodeType.ctor");if(Sc===null||Sc.length===0){throw new xmp.util.internals.InvalidArgsError("CompositePlayableNodeType requires non-empty patternName.");}
if(Tc<1){throw new xmp.util.internals.InvalidArgsError("CompositePlayableNodeType must have a repeat count of 1 or greater.");}
this._patternName=Sc;this._repeatCount=Tc;this._children=[];xmp.playlistapi.internals.CompositePlayableNodeType.ctor.call(this,Qc,id,Rc);};xmp.DERIVE_CLASS(xmp.playlistapi.PlayableNodeType,xmp.playlistapi.internals.CompositePlayableNodeType);xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getRepeatCount=function(){return this._repeatCount;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._isDeferred=function(){return(this._patternName.toLowerCase()==='deferred');};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getPatternName=function(){return this._patternName;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getChildCount=function(){return this._children.length;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._getChild=function(Uc){xmp.validateArguments(arguments,[xmp.NUMBER_TYPE],"CompositePlayableNodeType._getChild");return this._children[Uc];};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._addChild=function(Vc){var Wc=this._children.push(Vc);Vc._setParent(this);return Wc;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._isCompositeType=function(){return true;};xmp.playlistapi.internals.CompositePlayableNodeType.prototype._removeAllChildren=function(){this._children=[];};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.ContentCompositePlayableNodeType=function(Xc,id,Yc,Zc,$c){xmp.playlistapi.internals.ContentCompositePlayableNodeType.ctor.call(this,Xc,id,Yc,Zc,$c);this._readyToValidate=true;};xmp.DERIVE_CLASS(xmp.playlistapi.internals.CompositePlayableNodeType,xmp.playlistapi.internals.ContentCompositePlayableNodeType);xmp.playlistapi.internals.ContentCompositePlayableNodeType.prototype._setReadyToValidate=function(ad){this._readyToValidate=ad;};xmp.playlistapi.internals.ContentCompositePlayableNodeType.prototype._handlePostBuild=function(){if(!this._readyToValidate){return;}
function throwContentChildException(){throw new xmp.playlistapi.internals.PlayListError("ContentCompositePlayableNodeType must have one and only one node of type 'Content' (can have other leaf node types as well); cannot contain composite node types.");}
var bd=-1;var cd=this._getChildCount();for(var i=0;i<cd;i++){var dd=this._getChild(i);if(dd._isCompositeType()){throwContentChildException();}
if(dd.isContentType()){if(bd===-1){bd=i;}
else{throwContentChildException();}}}
if(bd===-1){throwContentChildException();}};xmp.playlistapi.internals.ContentCompositePlayableNodeType.prototype._isContentCompositeType=function(){return true;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.DefaultAdDataPatternDirective=function(ed,fd,gd){xmp.playlistapi.internals.DefaultAdDataPatternDirective.ctor.call(this,ed,fd,gd);};xmp.DERIVE_CLASS(xmp.playlistapi.internals.PatternDirective,xmp.playlistapi.internals.DefaultAdDataPatternDirective);xmp.playlistapi.internals.DefaultAdDataPatternDirective.prototype.doDirective=function(hd,jd){var kd=this.getMetadata('refId','');var ld=this.getMetadata('defaultDataId','');if(kd.length===0||ld.length===0){throw new xmp.playlistapi.internals.PlayListError("Directive '"+this.getType()+"' requires metadata 'refId' and 'defaultDataId'.");}
var md=this._findNamedContentNode(hd,jd,kd);var nd=md.getPlayableData().getDataObject().adDataMap;if(typeof nd!=='object'){throw new xmp.playlistapi.internals.PlayListError("Did not find 'adDataMap' for content node: "+md.getBestId());}
var od=nd[ld];if(typeof od!=='object'){throw new xmp.playlistapi.internals.PlayListError("Did not find '"+ld+"' in 'adDataMap' for content node: "+md.getBestId());}
var pd=hd._getParameterMapInternal().clone();pd.setOverrides(this.getParameterArray());pd.addContextObject('video',md.getPlayableData().getDataObject());pd.addContextObject('node',jd.getNodeType().getDataObject());var qd=new xmp.playlistapi.internals.AdPatternBuilder(pd);if(typeof od.resources==='object'){for(var i=0;i<od.resources.length;i++){var rd=od.resources[i];jd.setMetaResource(qd._buildMetaResource(rd));}}
var sd=qd._extractOptionalMetaData(od);var td='';for(td in sd){var ud=sd[td];jd.setMetadata(td,ud);}
jd.setMetadata('__DIRECTIVE_PARAMETER_MAP__',pd);};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.NullPatternDirective=function(){};xmp.playlistapi.internals.NullPatternDirective._flyWeight=new xmp.playlistapi.internals.NullPatternDirective();xmp.playlistapi.internals.NullPatternDirective.getNull=function(){return xmp.playlistapi.internals.NullPatternDirective._flyWeight;};xmp.playlistapi.internals.NullPatternDirective.prototype.getType=function(){return'Null';};xmp.playlistapi.internals.NullPatternDirective.prototype.doDirective=function(vd,wd){};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.ParameterMap=function(){this._logger=new xmp.util.internals.CategoryLogger('ParameterMap');this._map={};this._contextObjectMap={};};xmp.playlistapi.internals.ParameterMap.calcInitial=function(xd,yd){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"ParameterMap.calcInitial");var zd=new xmp.playlistapi.internals.ParameterMap();zd.init(xd);zd.setOverrides(yd);return zd;};xmp.playlistapi.internals.ParameterMap.prototype.clone=function(){var Ad=new xmp.playlistapi.internals.ParameterMap();Ad._cloneInternal(this._map);return Ad;};xmp.playlistapi.internals.ParameterMap.prototype.init=function(Bd){this._map=this._mapParameters((typeof Bd.parameters==='object')?Bd.parameters:[]);};xmp.playlistapi.internals.ParameterMap.prototype.setOverrides=function(Cd){this._validateParameters(Cd);for(var i=0;i<Cd.length;i++){var p=Cd[i];if(typeof this._map[p.name]==='undefined'){this._logger.warn('Pattern input parameter dropped, no default value in pattern: '+p.name);continue;}
this._map[p.name]=p.value;}};xmp.playlistapi.internals.ParameterMap.prototype.expandStringAndFixSlashes=function(Dd){var Ed='://';var Fd=this.expandString(Dd);var Gd='';var Hd=Fd;if(Fd.indexOf(Ed)>-1){var Id=Fd.split(Ed);Gd=Id[0]+Ed;Hd=Id[1];}
while(Hd.indexOf('//')>-1){Hd=Hd.replace(/\/\//g,'/');}
return Gd+Hd;};xmp.playlistapi.internals.ParameterMap.prototype.expandString=function(Jd){if(typeof Jd!=='string'){return Jd;}
if(Jd.indexOf('${')!==-1){var Kd=false;if(Jd.indexOf('$${')!==-1){Jd=Jd.replace(/\$\$\{/g,'__PROTECT_DOLLAR_ESCAPE__');Kd=true;}
Jd=Jd.replace(/\$\{player./g,'${');var Ld='';for(Ld in this._map){var Md=this._map[Ld];var Nd='${'+Ld+'}';if(Jd.indexOf(Nd)!==-1){var Od=Jd.split(Nd);Jd=Od.join(Md);}}
Jd=this._makeContextObjectSubs(Jd);if(Kd){Jd=Jd.replace(/__PROTECT_DOLLAR_ESCAPE__/g,'${');}}
return Jd;};xmp.playlistapi.internals.ParameterMap.prototype._makeContextObjectSubs=function(Pd){var Qd=0;var Rd=true;while(Rd){var Sd=Pd.indexOf('${',Qd);if(Sd===-1){Rd=false;break;}
var Td=Pd.indexOf('}',Sd+1);if(Td===-1){Rd=false;break;}
Qd=Td+1;var Ud=Pd.substr(0,Sd);var Vd=Pd.substr(Td+1);var Wd=Pd.substr(Sd+2,Td-Sd-2);var Xd=Wd.indexOf('.');if(Xd===-1){continue;}
var Yd=Wd.substr(0,Xd);var Zd=Wd.substr(Xd+1);var $d=this._contextObjectMap[Yd];if(!$d){continue;}
var ae=null;try{ae=xmp.util.JsonPath.evaluate($d,Zd);}
catch(e){ae=null;this._logger.warn('Error evaluating JSON Path: '+Zd,e);}
if(ae!==null){var be=Pd.length;Pd=Ud+ae+Vd;Qd+=(Pd.length-be);}}
return Pd;};xmp.playlistapi.internals.ParameterMap.prototype.addContextObject=function(ce,de){this._contextObjectMap[ce]=de;};xmp.playlistapi.internals.ParameterMap.prototype._validateParameters=function(ee){for(var i=0;i<ee.length;i++){var p=ee[i];if(!((typeof p.name==='string')&&(p.name.length>0)&&(typeof p.value==='string'))){throw new xmp.playlistapi.internals.PlayListError("Parameters must have string 'name and 'value' properties.");}}};xmp.playlistapi.internals.ParameterMap.prototype._mapParameters=function(fe){this._validateParameters(fe);var ge={};for(var i=0;i<fe.length;i++){var p=fe[i];ge[p.name]=p.value;}
return ge;};xmp.playlistapi.internals.ParameterMap.prototype._cloneInternal=function(he){var ie='';for(ie in he){var je=he[ie];this._map[ie]=je;}};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PatternDirectiveFactory=function(){};xmp.playlistapi.internals.PatternDirectiveFactory._ctors=null;xmp.playlistapi.internals.PatternDirectiveFactory.create=function(ke){if(xmp.playlistapi.internals.PatternDirectiveFactory._ctors===null){xmp.playlistapi.internals.PatternDirectiveFactory._ctors={};var le=xmp.playlistapi.internals.PatternDirectiveFactory._ctors;le['defaultAdData']=xmp.playlistapi.internals.DefaultAdDataPatternDirective;}
if(typeof ke.patternDirective==='object'){var me=xmp.playlistapi.internals.PatternDirectiveFactory._ctors[ke.patternDirective.type];if(me){var ne=ke.patternDirective.parameters;ne=(!ne)?[]:ne;var oe=ke.patternDirective.meta;oe=(!oe)?{}:oe;return new me(ke.patternDirective.type,oe,ne);}
else{throw new xmp.util.internals.InvalidArgsError('Unknown directive type: '+ke.patternDirective.type);}}
else{return xmp.playlistapi.internals.NullPatternDirective.getNull();}};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListAddress=function(){this._array=[];};xmp.playlistapi.internals.PlayListAddress.prototype.getLength=function(){return this._array.length;};xmp.playlistapi.internals.PlayListAddress.prototype.clone=function(){var pe=new xmp.playlistapi.internals.PlayListAddress();pe._cloneInternal(this._array);return pe;};xmp.playlistapi.internals.PlayListAddress.prototype._cloneInternal=function(qe){this._array=this._array.concat(qe);};xmp.playlistapi.internals.PlayListAddress.prototype.getAtIndex=function(re){return this._array[re];};xmp.playlistapi.internals.PlayListAddress.prototype.shift=function(){return this._array.shift();};xmp.playlistapi.internals.PlayListAddress.prototype.push=function(se){return this._array.push(se);};xmp.playlistapi.internals.PlayListAddress.prototype.pop=function(){return this._array.pop();};xmp.playlistapi.internals.PlayListAddress.prototype.getParent=function(){var te=this.clone();te.pop();return te;};xmp.playlistapi.internals.PlayListAddress.prototype.isSibling=function(ue,ve){var we=this.getLength();if(we!==ue.getLength()){return false;}
for(var i=0;i<we;i++){var xe=this.getAtIndex(i);var ye=ue.getAtIndex(i);if(i<(we-1)){if(!xe.isEqual(ye)){return false;}}
else{if(ve){if(xe.getRepeatIndex()!==ye.getRepeatIndex()){return false;}}}}
return true;};xmp.playlistapi.internals.PlayListAddress.prototype.asString=function(){var s='';var ze=this.getLength();for(var i=0;i<ze;i++){var Ae=this.getAtIndex(i);s+=Ae.asString();if(i!==(ze-1)){s+=',';}}
return s;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListAddressPart=function(Be,Ce){this._repeatIndex=Be;this._childIndex=Ce;};xmp.playlistapi.internals.PlayListAddressPart.prototype.getRepeatIndex=function(){return this._repeatIndex;};xmp.playlistapi.internals.PlayListAddressPart.prototype.getChildIndex=function(){return this._childIndex;};xmp.playlistapi.internals.PlayListAddressPart.prototype.isEqual=function(De){return(De.getRepeatIndex()===this.getRepeatIndex()&&De.getChildIndex()==this.getChildIndex());};xmp.playlistapi.internals.PlayListAddressPart.prototype.asString=function(){return('['+this._repeatIndex+','+this._childIndex+']');};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListBuilder=function(Ee,Fe,Ge,He,Ie){try{this._STATE_TRAVERSE_TO_ADDRESS=0;this._STATE_TRAVERSE_TO_NEXT=1;this._STATE_BUILD=2;this._logger=new xmp.util.internals.CategoryLogger('PlayListBuilder');this._playList=Ee;this._playableDataProvider=Ie;this._contentMetaResourceIdArray=[];this._playListDataArray=[];this._traverseToPatternAddress=new xmp.playlistapi.internals.PlayListAddress();this._build_state=this._STATE_TRAVERSE_TO_ADDRESS;this._assignPatternAddress=new xmp.playlistapi.internals.PlayListAddress();this._contentCompositeIdToContentNodeMap={};this._parentIdCounter=0;this._contentMetaResourceIdArray=this._contentMetaResourceIdArray.concat(He);if(Fe!==null){this._traverseToPatternAddress=Fe._getPatternAddress().clone();}
if(this._traverseToPatternAddress.getLength()===0){this._build_state=this._STATE_BUILD;}
this._buildHelper(Ge,0);this._initializeNodes();}
catch(e){var Je="Error building playlist with meta resource IDs";this._logger.warn(Je,e);Je+=", error = ";Je+=xmp.extractErrorMessage(e);throw new xmp.playlistapi.internals.PlayListError(Je);}};xmp.playlistapi.internals.PlayListBuilder.prototype._getOutput=function(){var Ke=[];for(var i=0;i<this._playListDataArray.length;i++){var Le=this._playListDataArray[i];var Me=Le[0];Ke.push(Me);}
if(this._logger.isDebugEnabled()){var Ne='Node output: ';for(var j=0;j<Ke.length;j++){Ne+=('('+j.toString()+') ');Ne+=Ke[j].getBestId();Ne+=('('+Ke[j]._getPatternAddress().asString()+')');if(j!==(Ke.length-1)){Ne+=', ';}}
this._logger.debug(Ne);}
return Ke;};xmp.playlistapi.internals.PlayListBuilder.prototype._buildHelper=function(Oe,Pe){if(Oe._isCompositeType()){var Qe=0;var Re=0;if(this._build_state===this._STATE_TRAVERSE_TO_ADDRESS){var Se=this._traverseToPatternAddress.shift();Qe=Se.getRepeatIndex();Re=Se.getChildIndex();if(this._traverseToPatternAddress.getLength()===0){this._build_state=this._STATE_TRAVERSE_TO_NEXT;}}
if(this._build_state!==this._STATE_TRAVERSE_TO_ADDRESS&&Oe._isDeferred()){Oe=this._buildDeferredContentComposite(Oe);}
var Te=Oe._getRepeatCount();var Ue=Oe._getChildCount();for(var Ve=Qe;Ve<Te;Ve++){if(this._contentMetaResourceIdArray.length===0){break;}
this._parentIdCounter++;if(this._build_state===this._STATE_BUILD){Re=0;}
for(var We=Re;We<Ue;We++){var Xe=Oe._getChild(We);this._assignPatternAddress.push(new xmp.playlistapi.internals.PlayListAddressPart(Ve,We));this._buildHelper(Xe,this._parentIdCounter);this._assignPatternAddress.pop();}}}
else{if(this._build_state===this._STATE_BUILD){this._buildLeaf(Oe,Pe);}
else if(this._build_state===this._STATE_TRAVERSE_TO_NEXT){this._build_state=this._STATE_BUILD;}}};xmp.playlistapi.internals.PlayListBuilder.prototype._buildLeaf=function(Ye,Ze){var $e=this._playList._createNode();if(Ye.isContentType()){if(this._contentMetaResourceIdArray.length===0){$e._mutateEmptySlot(true);$e._setData(new xmp.util.PlayableData('EMPTY_SLOT'));}
else{var af=this._contentMetaResourceIdArray.shift();$e._linkData(this._playableDataProvider,af);}}
$e._setNodeType(Ye);$e._setPatternAddress(this._assignPatternAddress.clone());if($e.isContentType()&&$e.getNodeType()._getParent()._isContentCompositeType()){$e.getPlayableData()._setCompositeMetaResourceId($e.getPlayableData().getMetaResourceId());this._contentCompositeIdToContentNodeMap[Ze.toString()]=$e;}
this._playListDataArray.push([$e,Ze]);};xmp.playlistapi.internals.PlayListBuilder.prototype._initializeNodes=function(){for(var i=0;i<this._playListDataArray.length;i++){var bf=this._playListDataArray[i];var cf=bf[0];var df=bf[1];try{cf.getNodeType()._getDirective().doDirective(this,cf);}
catch(e){this._logger.warn('Error processing directive',e);}
if(cf.getPlayableData()===null){var ef=cf.getMetaResource('primary');cf._setData(new xmp.util.PlayableData((ef)?ef.getId():''));}
if(!cf.isContentType()&&cf.getNodeType()._getParent()._isContentCompositeType()){this._fixContentCompositeSibling(cf,df);}
if(!cf._isEmptySlot()&&!cf.getPlayableData().isError()){this._playList._initializeNode(cf);}}};xmp.playlistapi.internals.PlayListBuilder.prototype._fixContentCompositeSibling=function(ff,gf){var hf=this._contentCompositeIdToContentNodeMap[gf.toString()];if(hf._isEmptySlot()){ff._mutateEmptySlot(true);}
ff.getPlayableData()._setCompositeMetaResourceId(hf.getPlayableData().getCompositeMetaResourceId());};xmp.playlistapi.internals.PlayListBuilder.prototype._buildDeferredContentComposite=function(jf){jf._removeAllChildren();if(this._contentMetaResourceIdArray.length>0){var kf=this._contentMetaResourceIdArray[0];var lf=this._playableDataProvider._getPlayableData(kf);var mf=null;if(lf.isError()){mf=[{type:'Content'}];}
else{mf=lf.getDataObject().pattern;}
var nf=new xmp.playlistapi.internals.AdPatternBuilder(this._playList._getParameterMapInternal());nf._buildDeferredContentComposite(jf,mf);}
return jf;};xmp.playlistapi.internals.PlayListBuilder.prototype._getParameterMapInternal=function(){return this._playList._getParameterMapInternal();};xmp.playlistapi.internals.PlayListBuilder.prototype._getPlayListDataArrayLength=function(){return this._playListDataArray.length;};xmp.playlistapi.internals.PlayListBuilder.prototype._getPlayListDataArrayItemAtIndex=function(of){var pf=this._playListDataArray[of];return pf[0];};xmp.playlistapi.internals.PlayListBuilder.prototype._getDataIterator=function(){return(new xmp.playlistapi.internals.PlayListBuilder.Iterator(this));};xmp.playlistapi.internals.PlayListBuilder.prototype._getHistoricalDataIterator=function(){return this._playList._getHistoricalDataIterator();};xmp.playlistapi.internals.PlayListBuilder.Iterator=function(qf){this._playListBuilder=qf;};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.getLength=function(){return this._playListBuilder._getPlayListDataArrayLength();};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.first=function(){this._curIndex=0;};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.next=function(){var rf=this._playListBuilder._getPlayListDataArrayItemAtIndex(this._curIndex);this._curIndex++;return rf;};xmp.playlistapi.internals.PlayListBuilder.Iterator.prototype.hasNext=function(){return(this._curIndex<this.getLength());};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.PlayListError=function(sf){this.name="xmp.playlistapi.internals.PlayListError";this.message=sf;};xmp.DERIVE_CLASS(Error,xmp.playlistapi.internals.PlayListError);xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.RuleSetPlayableNodeType=function(tf,id,uf,vf,wf){xmp.validateArguments(arguments,[xmp.OBJECT_TYPE,xmp.STRING_TYPE,xmp.STRING_TYPE,xmp.OBJECT_TYPE,xmp.OBJECT_TYPE],"RuleSetPlayableNodeType.ctor");this._metadataMap=new xmp.util.internals.MetadataMap(true);this._metadataMap._reInitialize(wf);this._ruleContextArray=vf;this._metaResourceBundle=new xmp.playlistapi.ResouceBundle();xmp.playlistapi.internals.RuleSetPlayableNodeType.ctor.call(this,tf,id,uf);};xmp.DERIVE_CLASS(xmp.playlistapi.PlayableNodeType,xmp.playlistapi.internals.RuleSetPlayableNodeType);xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.setMetaResource=function(xf){this._metaResourceBundle.setMetaResource(xf);};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.getMetaResource=function(yf){return this._metaResourceBundle.getMetaResource(yf);};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.getMetaResourceBundle=function(){return this._metaResourceBundle;};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype.getMetadata=function(zf,Af){return this._metadataMap._get(zf,Af);};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype._getRuleContextArray=function(){return this._ruleContextArray;};xmp.playlistapi.internals.RuleSetPlayableNodeType.prototype._getMetadataMapRef=function(){return this._metadataMap;};xmp.createNamespace("xmp.playlistapi.internals");xmp.playlistapi.internals.SimplePlayListIterator=function(Bf){this._playListArray=Bf;this._curIndex=-1;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.getLength=function(){return this._playListArray.length;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.first=function(){this._curIndex=0;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.next=function(){var Cf=this._playListArray[this._curIndex];this._curIndex++;return Cf;};xmp.playlistapi.internals.SimplePlayListIterator.prototype.hasNext=function(){return(this._curIndex<this.getLength());};