
ISCPriceDisplay = Class.create( {
reset: function(){},
register_on_price_change_handler: function(){},
on_ticket_type_unlock: function(){}
} );
ISCSearchConstraints = Class.create( {
tlog: TMDebug.gen_tlog( 'isc-sc' ),
initialize: function( data ) {
this.isc = data.isc;
this.isc.search_constraints = this;
this.ga_avail_seats_threshold = data.ga_avail_seats_threshold;
this.enable_section_capacity = data.enable_section_capacity;
this.polygon_avail_levels = data.polygon_avail_levels;
this.search_delay = data.search_delay;
this.tu = data.tu;
this.regexps = {
htmlescape_dquote: [ new RegExp('"', "g"), '&quot;' ],
htmlescape_lt: [ new RegExp('<', "g"), '&lt;' ]
};
this.initialize_svl_data();
this.setup_ticket_type_info();
this.setup_seat_ticket_types();
Event.observe( $('isc-resetsearch'), 'click', this.reset_search.bind( this ) );
$('isc-needhelp-link').observe('click', function(e) {
click_track.log_datapoint( { need_help:'' } );
}.bindAsEventListener(this));
this.do_not_update_seatmap = 0;
},
object_is_empty: function(obj) {
var i;
for ( i in obj ) {
return false;
}
return true;
},
replace_regexp: function(regexp, string) {
var rule = this.regexps[regexp];
if ( rule ) {
return string.replace(rule[0], rule[1]);
}
else {
false;
return string;
}
},
reset_search: function( event ) {
false;
this.isc.seat_map.call_iscapp('resetMap');
this.price_display.reset();
this.ticket_types.check_all();
this.prepare_to_update_seatmap();
},
setup: function() {
this.ticket_types.register_on_checkbox_change_handler( this.on_ticket_type_choices_change.bind( this ) );
this.price_display.register_on_price_change_handler( this.on_price_range_change.bind( this ) );
if ( this.password_rollup )
this.password_rollup.register_on_unlock_success_handler( this.on_password_unlock.bind( this ) );
this.setup_price_display();
this.update_search_constraints();
this.generate_seatmap_shader_script();
this.clear_constraints_changed_flags();
},
get_num_distinct_price_points: function( tt ) {
var last_charges;
var num_price_points = 0;
for ( var price_level in tt.real_price_breakdown ) {
var charges = tt.real_price_breakdown[price_level].display_charges;
if ( typeof(last_charges) == 'undefined' ||
last_charges.price != charges.price ||
last_charges.sum_fees_and_taxes != charges.sum_fees_and_taxes )
num_price_points ++;
last_charges = charges;
}
return num_price_points;
},
setup_price_display: function() {
var enabled_tts = this.isc.edp.event.get_enabled_ticket_types();
var preferred = this.get_preferred_ticket_type( enabled_tts );
if ( $type(preferred) == 'array' ) {
if ( preferred.length )
preferred = preferred[0];
else
preferred = enabled_tts[0];
}
this.preferred = preferred;
if ( this.get_num_distinct_price_points( preferred ) == 1 ) {
this.price_display = this.single_price;
click_track.set_arrival_parameters( { price_widget: "single" } );
}
else if ( this.isc.data.enable_price_slider ) {
this.price_display = this.price_slider;
click_track.set_arrival_parameters( { price_widget: "slider" } );
}
else {
this.price_display = this.price_levels;
click_track.set_arrival_parameters( { price_widget: "dropdown" } );
}
this.price_display.setup();
this.setup_price_display = function(){};
},
setup_ticket_type_info: function() {
var ticket_types = edp.event.ticket_types;
this.ticket_types = {};
for ( var i = 0 ; i < ticket_types.length ; i ++ ) {
var tt = ticket_types[i];
if ( tt.password || tt.parent )
tt.is_locked = true;
else
tt.is_locked = false;
}
},
get_unlocked_ticket_types: function() {
var unlocked_tts = [];
var enabled_tts = this.isc.edp.event.get_enabled_ticket_types();
for ( var i = 0 ; i < enabled_tts.length ; i ++ ) {
var tt = enabled_tts[i];
if ( !tt.is_locked )
unlocked_tts.push( enabled_tts[i] );
}
return unlocked_tts;
},
on_cart_changed: function() {
this.generate_seatmap_shader_script();
this.clear_constraints_changed_flags();
this.refresh_seatmap_shaders();
},
on_password_unlock: function( event ) {
false;
this.password_unlocked_ticket_types = true;
this.prepare_to_update_seatmap();
},
on_ticket_type_choices_change: function( event ) {
false;
this.prepare_to_update_seatmap();
},
set_price_range: function( min, max ) {
this.price_range = [ min, max ];
this.on_price_range_change();
},
on_price_range_change: function( event ) {
false;
this.prepare_to_update_seatmap();
},
prevent_seatmap_update: function() {
this.do_not_update_seatmap ++;
},
allow_seatmap_update: function() {
if ( this.do_not_update_seatmap > 0 )
this.do_not_update_seatmap --;
},
prepare_to_update_seatmap: function () {
false;
if ( this.do_not_update_seatmap )
return;
if ( this.update_timeout )
window.clearTimeout( this.update_timeout );
this.isc.cart.cancel_current_dialog_chain();
this.isc.seat_map.show_loading_polling();
this.update_timeout = window.setTimeout( this.update_seatmap.bind( this ), this.search_delay );
},
refresh_seatmap_shaders: function() {
var svl_data = {};
if ( this.shader_script.length > 0 )
svl_data.svlScriptJSON = tJSON.stringify(this.shader_script);
if ( !this.object_is_empty(this.shader_data) )
svl_data.svlDataJSON = tJSON.stringify(this.shader_data);
if ( this.object_is_empty(svl_data) ) {
false;
return;
}
var result = this.isc.seat_map.call_iscapp(
'addSVLScriptsOrData', svl_data
);
false;
},
update_shaders: function() {
this.generate_seatmap_shader_script();
this.clear_constraints_changed_flags();
this.refresh_seatmap_shaders();
this.isc.on_refresh();
},
update_seatmap: function() {
false;
delete this.update_timeout;
this.isc.cart.cancel_current_dialog_chain();
if ( this.isc.seat_map.auto_refresh_sec.length )
this.prepare_to_update_seatmap();
else {
this.update_search_constraints();
if ( this.password_unlocked_ticket_types )
this.isc.cart.update_cart_ticket_types();
this.update_shaders();
}
},
clear_constraints_changed_flags: function() {
for ( var price_level in this.seat_ticket_types ) {
var by_uq = this.seat_ticket_types[price_level];
for ( var uq in by_uq )
by_uq[uq].changed = {};
}
this.svl_regen_seat_script = false;
this.svl_regen_poly_script = false;
this.password_unlocked_ticket_types = false;
},
setup_seat_ticket_types: function() {
this.seat_ticket_types = {};
var enabled_tts = this.isc.edp.event.get_enabled_ticket_types();
for ( var i = 0 ; i < enabled_tts.length ; i ++ ) {
var tt = enabled_tts[i];
if ( !tt.children && tt.variable_qualifier_value == 0 ) {
for ( var price_level in tt.price_breakdown ) {
var uq = tt.unsold_qualifier_value;
if ( !this.seat_ticket_types[price_level] )
this.seat_ticket_types[price_level] = {};
if ( !this.seat_ticket_types[price_level][uq] )
this.seat_ticket_types[price_level][uq] = {
ticket_types: [],
changed: {}
};
this.seat_ticket_types[price_level][uq].ticket_types.push( tt );
}
}
}
},
get_preferred_ticket_type_by_price: function( ticket_types, price_level ) {
if ( ticket_types.length ) {
if ( ticket_types.length > 1 ) {
var tt_by_price = {};
var best_price = -1;
for ( var t = 0 ; t < ticket_types.length ; t ++ ) {
var tt = ticket_types[t];
var price;
if ( tt.is_locked )
price = tt.price_breakdown[price_level].display_charges.total_price;
else
price = tt.real_price_breakdown[price_level].display_charges.total_price;
if ( best_price == -1 )
best_price = price;
else if ( price < best_price )
best_price = price;
if ( !tt_by_price[price] )
tt_by_price[price] = [];
tt_by_price[price].push( tt );
}
return tt_by_price[best_price][0];
}
else
return ticket_types[0];
}
else
return false;
},
get_preferred_ticket_type: function( ticket_types ) {
var fp_pool = [];
for ( var i = 0 ; i < ticket_types.length ; i ++ ) {
var tt = ticket_types[i];
if ( tt.ext_ticket_type == '000000000001' )
return tt;
if ( tt.is_full_price )
fp_pool.push( tt );
}
return fp_pool;
},
update_search_constraints: function() {
var i;
false;
var price_range = this.price_range;
var price_levels;
if ( !price_range && this.price_display.get_price_range )
price_range = this.price_display.get_price_range();
false;
if ( this.price_display.get_price_levels )
price_levels = this.price_display.get_price_levels();
false;
for ( var price_level in this.seat_ticket_types ) {
var by_uq = this.seat_ticket_types[price_level];
for ( var uq in by_uq ) {
var seat_class = by_uq[uq];
var flags = {
preferred: null,
limit_description: null,
matches: true,
is_locked: false,
multiple: false,
amex_msg: false
};
var states = {
locked: {
pw: [],
no_pw: []
},
unlocked: {
pw: [],
no_pw: [],
tts: []
},
checked: {
pw: [],
no_pw: []
}
};
for ( var t = 0 ; t < seat_class.ticket_types.length ; t ++ ) {
var tt = seat_class.ticket_types[t];
var state = tt.is_locked ? 'locked' : 'unlocked';
var password = tt.password || tt.parent ? 'pw' : 'no_pw';
states[state][password].push( tt );
if ( !tt.is_locked )
states.unlocked.tts.push( tt );
if ( this.ticket_types.is_checked( tt.ext_ticket_type ) )
states.checked[password].push( tt );
}
var min_tt = null;
var max_tt = null;
states.unlocked.tts.each( function ( tt ) {
if ( min_tt == null )
min_tt = tt;
else if ( tt.real_price_breakdown[price_level].display_charges.total_price <
min_tt.real_price_breakdown[price_level].display_charges.total_price )
min_tt = tt;
if ( max_tt == null )
max_tt = tt;
else if ( tt.real_price_breakdown[price_level].display_charges.total_price >
max_tt.real_price_breakdown[price_level].display_charges.total_price )
max_tt = tt;
} );
flags.min_tt = min_tt;
flags.max_tt = max_tt;
var tt_pool = [];
var no_pw = false;
if ( states.checked.pw.length )
tt_pool = states.checked.pw;
else if ( states.checked.no_pw.length ) {
tt_pool = states.checked.no_pw;
no_pw = true;
}
else {
flags.matches = false;
if ( states.unlocked.pw.length )
tt_pool = states.unlocked.pw;
else if ( states.unlocked.no_pw.length ) {
tt_pool = states.unlocked.no_pw;
no_pw = true;
}
else if ( states.locked.pw.length ) {
tt_pool = states.locked.pw;
flags.is_locked = true;
}
}
if ( states.unlocked.tts.length ) {
if( states.unlocked.tts.length > 1 )
flags.multiple = true;
}
else if ( tt_pool.length > 1 )
flags.multiple = true;
var preferred = this.get_preferred_ticket_type( tt_pool );
if ( $type(preferred) == 'object' )
flags.preferred = preferred;
else {
if ( no_pw ) {
if ( preferred.length ) {
flags.preferred = this.get_preferred_ticket_type_by_price( preferred, price_level );
}
else {
flags.preferred = tt_pool[0];
}
}
else {
flags.preferred = this.get_preferred_ticket_type_by_price( tt_pool, price_level );
}
}
if ( flags.is_locked && flags.preferred.parent &&
flags.preferred.parent.children &&
flags.preferred.parent.password.scheme_type ==
'password_server::ticket_type::cascade' ) {
for ( i = 0; i < flags.preferred.parent.children.length; i++ ) {
if ( !flags.preferred.parent.children[i].is_locked ) {
flags.amex_msg = true;
break;
}
}
}
flags.limit_description = flags.preferred.limit_description;
if ( flags.matches ) {
var preferred_price;
if ( flags.preferred.is_locked )
preferred_price = flags.preferred.price_breakdown[price_level].display_charges.total_price;
else
preferred_price = flags.preferred.real_price_breakdown[price_level].display_charges.total_price;
if ( price_range ) {
var price_is_in = false;
for ( i = 0 ; i < price_range.length ; i += 2 ) {
var min = price_range[i];
var max = price_range[i+1];
if ( min <= preferred_price && preferred_price <= max )
price_is_in = true;
}
if ( !price_is_in )
flags.matches = false;
}
else
if ( price_levels && !price_levels[price_level] )
flags.matches = false;
}
seat_class.changed = {
preferred: flags.preferred != seat_class.preferred,
limit_description: flags.limit_description
!= seat_class.limit_description,
matches: flags.matches     != seat_class.matches,
is_locked: flags.is_locked != seat_class.is_locked,
multiple: flags.multiple   != seat_class.multiple,
min_tt: flags.min_tt       != seat_class.min_tt,
max_tt: flags.max_tt       != seat_class.max_tt,
amex_msg: flags.amex_msg   != seat_class.amex_msg
};
for ( var flag in flags )
seat_class[flag] = flags[flag];
}
}
},
escape_dquote: function(string) {
return this.replace_regexp('htmlescape_dquote', string);
},
escape_lt: function(string) {
return this.replace_regexp('htmlescape_lt', string);
},
get_price_breakout_html: function(tt, price_level) {
var display_charges = ( tt.is_locked )
? tt.price_breakdown[price_level].display_charges
: tt.real_price_breakdown[price_level].display_charges;
var pre = [
"<p class='text12'>",
"<span class='bold'>",
display_charges.formatted_total_price,
"</span>"
];
var inner = [];
if ( display_charges.sum_fees_and_taxes + 0 > 0 ) {
inner = [
"<span class='gray'> (",
display_charges.formatted_price,
" + ",
display_charges.formatted_sum_fees_and_taxes,
" "
];
if ( display_charges.has_fees && display_charges.has_taxes )
inner[inner.length] = this.svl_breakout_text.fees_taxes;
else if ( display_charges.has_fees )
inner[inner.length] = this.svl_breakout_text.fees;
else if ( display_charges.has_taxes )
inner[inner.length] = this.svl_breakout_text.taxes;
inner[inner.length] = ")</span>";
}
return pre.join('') + inner.join('') + "</p>";
},
gen_polygon_matches_script_line: function(params) {
var template_name = 'MATCHES_SEARCH_' + params.template;
var pre_condition = 'polygon.counters[0] > 0 && ';
var low_condition = '';
var high_condition = '';
if ( params.low == params.high ) {
if ( params.low == 0 ) {
low_condition = 'polygon.counters[1] == 0';
}
else if ( params.low == 100 ) {
low_condition = 'polygon.counters[1] == polygon.counters[0]';
}
else {
low_condition = [
'(polygon.counters[1] * 100) / polygon.counters[0] == ',
params.low
].join('');
}
}
else {
low_condition = [
params.low,
' < (polygon.counters[1] * 100) / polygon.counters[0]'
].join('');
high_condition = [
'(polygon.counters[1] * 100) / polygon.counters[0] <= ',
params.high
].join('');
if ( params.low == 0 ) {
low_condition = 'polygon.counters[1] > 0';
}
else if ( params.high == 100 ) {
high_condition = '';
}
}
return [
pre_condition,
low_condition,
( high_condition ? ' && ' + high_condition : '' ),
':select_polygon_template("', template_name, '");'
].join('');
},
gen_polygon_script: function() {
var ga_secs = this.isc.cart.ga_sections;
var text = [];
for ( var sec in ga_secs ) {
if ( sec.charAt(0) == '.' ) {
sec = ga_secs[sec][0].sell_class.section;
}
text.push([
'page.are_seats_visible != 0 && ',
'in_list(polygon.section_list, "', sec, '")',
':select_polygon_template("SELECTED");'
].join(''));
}
return this.svl_base_polygon_script + text.join('');
},
gen_polygon_template: function(params) {
var template = {};
if ( params.interior_color )
template.interior = params.interior_color;
if ( params.tool_tip_template )
template.poly_tool_tip_template = params.tool_tip_template;
if ( params.border )
template.border = params.border;
return template;
},
gen_ada_encoders: function() {
return [
{
pl_bits : 0xFFFFFFFF,
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0,
base_type_high : 0,
seat_flags_and_mask : 32,
seat_flags_equal_mask : 32,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : 0,
qualifier_equal_mask : 0,
qualifier_and_mask_2 : 0x7FFFFFFF,
qualifier_range_low : 0,
qualifier_range_high : 0x7FFFFFFF,
set_run_time_and_mask : 0,
set_run_time_or_mask : this.svl_seat_rtv_ACCESSIBLE
| this.svl_seat_rtv_ALSO_AVAILABLE
},
{
pl_bits : 0xFFFFFFFF,
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0x1A,
base_type_high : 0x1A,
seat_flags_and_mask : 32,
seat_flags_equal_mask : 0,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : 0,
qualifier_equal_mask : 0,
qualifier_and_mask_2 : 0x7FFFFFFF,
qualifier_range_low : 0,
qualifier_range_high : 0x7FFFFFFF,
set_run_time_and_mask : 0,
set_run_time_or_mask : this.svl_seat_rtv_NOT_AVAILABLE
},
{
pl_bits : 0xFFFFFFFF,
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0x01,
base_type_high : 0xFF,
seat_flags_and_mask : 0,
seat_flags_equal_mask : 0,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : 0,
qualifier_equal_mask : 0,
qualifier_and_mask_2 : 0x7FFFFFFF,
qualifier_range_low : 0,
qualifier_range_high : 0x7FFFFFFF,
set_run_time_and_mask : 0,
set_run_time_or_mask : this.svl_seat_rtv_ACCESSIBLE
}
];
},
gen_classified_encoders: function() {
var run_time_value = this.svl_seat_rtv_NOT_AVAILABLE;
return [
{
pl_bits : 0xFFFFFFFF,
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0,
base_type_high : 0,
seat_flags_and_mask : 0,
seat_flags_equal_mask : 0,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : 0,
qualifier_equal_mask : 0,
qualifier_and_mask_2 : 0x7FFFFFFF,
qualifier_range_low : 0,
qualifier_range_high : 0x7FFFFFFF,
set_run_time_and_mask : 0,
set_run_time_or_mask : run_time_value
}
];
},
gen_slp_encoders: function() {
var run_time_value = this.svl_seat_rtv_NOT_AVAILABLE;
var and_mask;
var low;
var high;
if ( this.isc.qualifiers.variable.and_mask ) {
and_mask = this.isc.qualifiers.variable.and_mask;
low = 1 << this.isc.qualifiers.variable.start_bit;
high = and_mask;
}
else {
and_mask = 0;
low = 0x7FFFFFFF;
high = 0x7FFFFFFF;
}
return [
{
pl_bits : 0xFFFFFFFF,
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0,
base_type_high : 0,
seat_flags_and_mask : 0,
seat_flags_equal_mask : 0,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : 0,
qualifier_equal_mask : 0,
qualifier_and_mask_2 : and_mask,
qualifier_range_low : low,
qualifier_range_high : high,
set_run_time_and_mask : 0,
set_run_time_or_mask : run_time_value
}
];
},
gen_seat_matches_encoders: function() {
var run_time_value = this.svl_seat_rtv_MATCHES_SEARCH;
var and_mask = 0x7FFFFFFF ^ this.svl_legend_color_and_mask;
return [
{
pl_bits : 0xFFFFFFFF,
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0,
base_type_high : 0,
seat_flags_and_mask : 0,
seat_flags_equal_mask : 0,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : 0,
qualifier_equal_mask : 0,
qualifier_and_mask_2 : 0x7FFFFFFF,
qualifier_range_low : 0,
qualifier_range_high : 0x7FFFFFFF,
set_run_time_and_mask : and_mask,
set_run_time_or_mask : run_time_value
}
];
},
gen_seat_legend_templates: function() {
var ada_tool_tip_template = [
'<p class=\'text12\'><span class=\'bold\'>',
'<span class=\'',
'[% @(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_ALSO_AVAILABLE,
':"highlight-inactive"; %]',
'[% @(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') != ', this.svl_seat_rtv_ALSO_AVAILABLE,
':"gray-notavailable"; %]',
'\'>', this.tu.ISC_SVL_SEAT_SEC, ' [% section %]',
', ', this.tu.ISC_SVL_SEAT_ROW, ' [% row %]',
', ', this.tu.ISC_SVL_SEAT_SEAT, ' [% seat %]',
'</span></span></p>',
'[% @(seat.seat_flags & 16) != 0',
':"<p class=\'highlight-inactive\'>',
this.escape_dquote(this.tu.ISC_SVL_SEAT_OBSTRUCTED_VIEW),
'</p>"; %]',
this.svl_addna_text,
'<p class=\'bold\'>',
'[% @seat.sell_class == 1',
':"', this.escape_dquote(this.tu.ISC_SVL_SEAT_WHEELCHAIR_ACCESS),
'"; %]',
'[% @seat.sell_class == 4',
':"', this.escape_dquote(this.tu.ISC_SVL_SEAT_SIGHT_HEARING),
'"; %]',
'[% @seat.sell_class == 5',
':"', this.escape_dquote(this.tu.ISC_SVL_SEAT_MOBILITY_IMPAIRED),
'"; %]',
'</p>',
'<p>', this.escape_dquote(this.tu.ISC_SVL_SEAT_TO_REQUEST_ACCESS),
'</p>'
].join('');
var tabs = this.isc.market_tabs;
var seat_upsell;
if ( tabs.auction_bid && this.isc.data.use_hover.auction ) {
seat_upsell = this.tu.ISC_SVL_SEAT_AUCTION_UPSELL;
}
else if ( tabs.platinum && this.isc.data.use_hover.platinum ) {
seat_upsell = this.tu.ISC_SVL_SEAT_PLATINUM_UPSELL;
}
else if ( tabs.exchange && this.isc.data.use_hover.exchange ) {
seat_upsell = this.tu.ISC_SVL_SEAT_EXCHANGE_UPSELL;
}
var not_available_tool_tip_template = [
'<p class=\'text12\'><span class=\'bold\'>',
'<span class=\'gray-notavailable\'>',
this.tu.ISC_SVL_SEAT_SEC, ' [% section %]',
', ', this.tu.ISC_SVL_SEAT_ROW, ' [% row %]',
', ', this.tu.ISC_SVL_SEAT_SEAT, ' [% seat %]',
'</span></span></p>',
( seat_upsell
? [ '<p class=\'text12\'><span class=\'highlight\'>',
this.escape_dquote(seat_upsell),
'</span></p>' ].join('')
: '')
].join('');
return {
SELECTED :
{
legend_text : this.tu.ISC_SVL_LEGEND_SELECTED,
legend_priority : 1,
show_in_legend_always : true,
background_color : 0xEF6307
},
MATCHES_SEARCH :
{
legend_text : this.tu.ISC_SVL_LEGEND_MATCHES,
legend_priority : 2,
show_in_legend_always : true,
background_color : 0x001D47,
selectable : true
},
ALSO_AVAILABLE :
{
legend_text : this.tu.ISC_SVL_LEGEND_ALSO,
legend_priority : 3,
show_in_legend_always : true,
background_color : 0x7DA1BA,
selectable : true
},
NOT_AVAILABLE_SEAT :
{
background_color : 0xDDDDDD,
selectable : false,
selected_color : 0xAFAFAF,
highlighted_color : 0xAFAFAF,
tool_tip_template : not_available_tool_tip_template
},
NOT_AVAILABLE_LEGEND :
{
legend_text : this.tu.ISC_SVL_LEGEND_NOT_AVAIL,
legend_priority : 4,
show_in_legend_always : true,
background_color : 0xBBBBBB
},
OFFER_CODE :
{
legend_text : this.tu.ISC_SVL_LEGEND_OFFER_CODE,
legend_priority : 5,
symbol_fonts : ["iscding"],
symbol_chars : ["1"],
symbol_colors : ["0xFECB34"],
highlighted_symbol_font : "iscding",
highlighted_symbol : "1",
highlighted_symbol_color : "0xFECB34",
selected_symbol_font : "iscding",
selected_symbol : "1",
selected_symbol_color : "0xFECB34"
},
AUCTION :
{
legend_text : this.tu.ISC_SVL_LEGEND_AUCTION,
legend_priority : 6,
symbol_fonts : ["iscding"],
symbol_chars : ["2"],
symbol_colors : ["0xFECB34"],
highlighted_symbol_font : "iscding",
highlighted_symbol : "2",
highlighted_symbol_color : "0xFECB34",
selected_symbol_font : "iscding",
selected_symbol : "2",
selected_symbol_color : "0xFECB34"
},
ACCESSIBLE_LEGEND :
{
legend_text : this.tu.ISC_SVL_LEGEND_ACCESSIBLE,
legend_priority : 7,
symbol_fonts : ["iscding"],
symbol_chars : ["3"],
symbol_colors : ["0x001D47"]
},
ACCESSIBLE_SEAT :
{
symbol_fonts : ["iscding"],
symbol_chars : ["3"],
symbol_colors : ["0xFFFFFF"],
highlighted_symbol_font : "iscding",
highlighted_symbol : "3",
highlighted_symbol_color : "0xFFFFFF",
selected_symbol_font : "iscding",
selected_symbol : "3",
selected_symbol_color : "0xFFFFFF",
tool_tip_template : ada_tool_tip_template
},
AVAILABLE :
{
show_in_legend_always : false
},
UNAVAILABLE :
{
show_in_legend_always : false
}
};
},
gen_seat_selector: function(params) {
var and_mask;
if ( params.type == 'legend_color' )
and_mask = this.svl_legend_color_and_mask;
else if ( params.type == 'legend_icon' )
and_mask = this.svl_legend_icon_and_mask;
else if ( params.type == 'none' )
and_mask = 0;
else if ( params.type == 'seat_class' )
and_mask = this.svl_seat_class_and_mask;
else if ( params.type == 'seat_class_and_color' )
and_mask = this.svl_seat_class_and_mask
| this.svl_legend_color_and_mask;
else
and_mask = 0;
return {
run_time_and_mask : and_mask,
run_time_equal_mask : params.run_time_value,
template_to_set : (params.overlay ? null : params.template),
template_to_overlay : (params.overlay ? params.template : null)
};
},
gen_seat_class_encoder: function(params) {
var and_mask = this.isc.qualifiers.unsold.and_mask;
var uq_value = params.seat_class.preferred.unsold_qualifier_value;
return {
pl_bits : 1 << (params.price_level - 1),
range_and_mask : 0x7FFFFFFF,
price_range_low : 0,
price_range_high : 0,
base_type_low : 0,
base_type_high : 0,
seat_flags_and_mask : 0,
seat_flags_equal_mask : 0,
run_time_and_mask : 0,
run_time_equal_mask : 0,
qualifier_and_mask : and_mask,
qualifier_equal_mask : uq_value,
qualifier_and_mask_2 : 0x7FFFFFFF,
qualifier_range_low : 0,
qualifier_range_high : 0x7FFFFFFF,
set_run_time_and_mask : 0,
set_run_time_or_mask : params.run_time_value
};
},
gen_ticket_type_header: function(tt) {
var result = '';
if ( tt.limit_description ) {
result = [
'<p class=\'bold\'>',
this.escape_dquote(this.escape_lt(tt.limit_description)),
'</p>'
].join('');
}
return result;
},
is_ga_seat: function(seat) {
return seat.seat_data.last_touched_seat_position.selection.is_ga;
},
seat_class_tool_tip_details: function(params) {
var i;
var seat_class = params.seat_class;
var pref_tt = params.preferred;
var pl = params.price_level;
var offer_code_required = '';
if ( seat_class.is_locked && !seat_class.multiple ) {
offer_code_required = [
'<p class=\'text12\'><span class=\'bolditalic\'>',
this.tu.ISC_SVL_SEAT_OFFER_CODE_REQUIRED,
'</span></p>'
].join('');
}
var seat_location_pre = [
'<p class=\'text12\'><span class=\'bold\'>',
'<span class=\''
].join('');
var seat_location_post = [
'\'>',
this.tu.ISC_SVL_SEAT_SEC, ' [% section %], ',
this.tu.ISC_SVL_SEAT_ROW, ' [% row %], ',
this.tu.ISC_SVL_SEAT_SEAT, ' [% seat %]',
'</span></span></p>'
].join('');
var seat_location = [
seat_location_pre,
'[% @(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_MATCHES_SEARCH,
' || seat.is_selected != 0',
':"highlight"; %]',
'[% @(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_ALSO_AVAILABLE,
' && seat.is_selected == 0',
':"highlight-inactive"; %]',
seat_location_post
].join('');
var obstructed_view_pre = [
'[% @(seat.seat_flags & 16) != 0',
':"<p class=\'"; %]'
].join('');
var obstructed_view_post = [
'[% @(seat.seat_flags & 16) != 0',
':"\'>',
this.escape_dquote(this.tu.ISC_SVL_SEAT_OBSTRUCTED_VIEW),
'</p>"; %]'
].join('');
var obstructed_view = [
obstructed_view_pre,
'[% @(seat.seat_flags & 16) != 0',
' && (seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_MATCHES_SEARCH,
' || seat.is_selected != 0',
':"highlight"; %]',
'[% @(seat.seat_flags & 16) != 0',
' && (seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_ALSO_AVAILABLE,
' && seat.is_selected == 0',
':"highlight-inactive"; %]',
obstructed_view_post
].join('');
var price_details = '';
if ( !(seat_class.multiple && seat_class.is_locked) ) {
price_details = this.get_price_breakout_html(pref_tt, pl);
}
var ticket_type_header = '';
if ( seat_class.is_locked && seat_class.multiple ) {
ticket_type_header = [
'<p class=\'bold\'>',
this.tu.ISC_SVL_SEAT_OFFER_CODE_REQUIRED,
'</p>'
].join('');
}
else {
ticket_type_header = this.gen_ticket_type_header(pref_tt);
}
var amex_apology = '';
if ( seat_class.amex_msg ) {
amex_apology = [
'<p class=\'bolditalic\'>',
this.tu.ISC_SVL_SEAT_AMEX_APOLOGY,
'</p>'
].join('');
}
var seat_type_info = '';
if ( seat_class.is_locked && seat_class.multiple ) {
seat_type_info = [
'<p>', this.tu.ISC_SVL_SEAT_TO_UNLOCK, '</p>'
].join('');
}
else {
if ( pref_tt.ticket_type_info && pref_tt.ticket_type_info.isc )
seat_type_info = [
'<p>', this.tu.ISC_SVL_SEAT_FOR_MORE_DETAILS, '</p>'
].join('');
}
var multiple_ticket_types = '';
if ( seat_class.multiple && !seat_class.is_locked ) {
multiple_ticket_types = [
'[% @seat.is_selected == 0',
':"<p></p><p class=\'italic\'>',
this.escape_dquote(this.tu.ISC_SVL_SEAT_CLICK_SEAT),
'</p>"; %]'
].join('');
}
var details = {
offer_code_required: offer_code_required,
seat_location: seat_location,
obstructed_view: obstructed_view,
price_details: price_details,
ticket_type_header: ticket_type_header,
amex_apology: amex_apology,
seat_type_info: seat_type_info,
multiple_ticket_types: multiple_ticket_types
};
return details;
},
gen_seat_class_price_range_template: function(params) {
var i;
var seat_class = params.seat_class;
var pl = params.price_level;
if ( seat_class.is_locked ) {
return undefined;
}
var min_charges;
var max_charges;
if ( seat_class.min_tt ) {
var min_pb = seat_class.min_tt.real_price_breakdown[pl];
min_charges = min_pb.display_charges;
}
if ( seat_class.max_tt ) {
var max_pb = seat_class.max_tt.real_price_breakdown[pl];
max_charges = max_pb.display_charges;
}
if ( !min_charges || !max_charges ) {
return undefined;
}
return {
min_price: min_charges.total_price,
min_price_text: min_charges.formatted_total_price,
max_price: max_charges.total_price,
max_price_text: max_charges.formatted_total_price
};
},
gen_seat_class_template: function(details) {
var i;
var tool_tip_template = [
details.offer_code_required,
details.seat_location,
details.obstructed_view,
this.svl_addna_text,
details.price_details,
details.ticket_type_header,
details.amex_apology,
details.seat_type_info,
details.multiple_ticket_types
].join('');
var template = {
tool_tip_template: tool_tip_template
};
for ( i in details.price_fields )
template[i] = details.price_fields[i];
return template;
},
gen_seat_class_script_line: function(state) {
return [
'(seat.run_time_flags & ',
this.svl_seat_class_and_mask,
') == ',
state.index,
':run_defined_seat_encoders("tmol_matches");'
].join('');
},
gen_seat_script: function() {
var text = [
'(seat.seat_flags & 32) == 0',
':run_defined_seat_encoders("tmol_seat_class_encoders");'
];
for ( var pl in this.svl_seat_class_state ) {
for ( var uq in this.svl_seat_class_state[pl] ) {
if ( this.seat_ticket_types[pl][uq].matches ) {
var state = this.svl_seat_class_state[pl][uq];
text.push(this.gen_seat_class_script_line(state));
}
}
}
text.push(this.svl_base_seat_script.encoders);
text.push(this.svl_base_seat_script.selectors);
for ( var i = 2; i <= this.range_member_allocate_to; i++ ) {
text.push([
'seat.range_member == ', i,
':run_defined_seat_template_selectors("tmol_cart_', i, '");'
].join(''));
}
text.push(this.svl_base_seat_script.counters);
return text.join('');
},
gen_seat_classes: function() {
var i;
var seat_data = this.seat_ticket_types;
var selectors = [];
var price_range_selectors = [];
var templates = {};
var encoders = [];
var encoder_changed = false;
var selector_changed = false;
for ( var pl in seat_data ) {
if ( pl > 32 )
continue;
for ( var uq in seat_data[pl] ) {
var template_changed = false;
var price_range_template_changed = false;
var seat_class = seat_data[pl][uq];
var changed = seat_class.changed;
if ( !this.svl_seat_class_state[pl] ) {
this.svl_seat_class_state[pl] = {};
this.svl_seat_class_state[pl][uq] = {};
}
else if ( !this.svl_seat_class_state[pl][uq] ) {
this.svl_seat_class_state[pl][uq] = {};
}
var state = this.svl_seat_class_state[pl][uq];
if ( !state.index ) {
state.index = this.svl_seat_class_state_index
<< this.svl_price_lvl_offset;
this.svl_seat_class_state_index++;
}
var selector_rtv = state.index;
var encoder_rtv = selector_rtv
| this.svl_seat_rtv_ALSO_AVAILABLE;
var template_name = 'SEAT_CLASS_' + selector_rtv;
var range_template_name = template_name + '_PRICES';
if ( seat_class.is_locked )
encoder_rtv |= this.svl_seat_rtv_OFFER_CODE;
if ( !state.encoder || changed.is_locked ) {
state.encoder = this.gen_seat_class_encoder({
seat_class: seat_class,
price_level: pl,
run_time_value: encoder_rtv
});
encoder_changed = true;
}
if ( !state.selectors ) {
state.selectors = [
this.gen_seat_selector({
type: 'seat_class',
run_time_value: selector_rtv,
template: template_name
})
];
selector_changed = true;
}
if ( !state.templates || changed.preferred ||
changed.is_locked || changed.multiple ||
changed.amex_msg || changed.limit_description ) {
var tool_tip_details = this.seat_class_tool_tip_details({
seat_class: seat_class,
preferred: seat_class.preferred,
price_level: pl
});
state.templates = {};
state.templates[template_name] =
this.gen_seat_class_template(tool_tip_details);
template_changed = true;
}
if ( !state.price_range_templates ||
changed.min_tt || changed.max_tt ) {
state.price_range_templates = {};
var tpl = this.gen_seat_class_price_range_template({
seat_class: seat_class,
price_level: pl
});
if ( tpl ) {
state.price_range_templates[range_template_name] = tpl;
price_range_template_changed = true;
state.price_range_selectors = [
this.gen_seat_selector({
type: 'seat_class',
run_time_value: selector_rtv,
template: range_template_name,
overlay: 1
})
];
selector_changed = true;
}
}
encoders.push(state.encoder);
for ( i = 0; i < state.selectors.length; i++ )
selectors.push(state.selectors[i]);
if ( state.price_range_selectors ) {
for ( i = 0; i < state.price_range_selectors.length; i++ )
price_range_selectors.push(
state.price_range_selectors[i]);
}
if ( template_changed ) {
for ( i in state.templates )
templates[i] = state.templates[i];
}
if ( price_range_template_changed ) {
for ( i in state.price_range_templates )
templates[i] = state.price_range_templates[i];
}
if ( changed.matches || changed.preferred ||
changed.is_locked || changed.multiple ||
changed.min_tt || changed.max_tt ||
changed.is_locked || changed.amex_msg ||
changed.limit_description )
this.svl_regen_seat_script = true;
}
}
if ( selector_changed ) {
for ( i = 0; i < price_range_selectors.length; i++ )
selectors.push(price_range_selectors[i]);
}
return {
selectors: (selector_changed ? selectors : []),
templates: templates,
encoders: (encoder_changed ? encoders : [])
};
},
gen_cart_svl_data: function() {
var i;
var selectors = {};
var templates = {};
for ( i = 0; i < this.isc.cart.seats_removed.length; i++ ) {
this.isc.cart.seats_removed[i].range_member = 1;
}
var new_items = this.isc.cart.seat_ticket_types_changed.concat(
this.isc.cart.seats_added);
for ( i = 0; i < new_items.length; i++ ) {
var seat = new_items[i];
if ( this.is_ga_seat(seat) )
continue;
var pl = seat.sell_class.price_level;
var uq = seat.sell_class.tt.unsold_qualifier_value;
var ext_tt = seat.sell_class.tt.ext_ticket_type;
var state;
if ( !this.svl_seat_class_state[pl]
|| !(state = this.svl_seat_class_state[pl][uq]) ) {
seat.range_member = 1;
continue;
}
if ( !state.cart_tts )
state.cart_tts = {};
if ( state.cart_tts[ext_tt] ) {
seat.range_member = state.cart_tts[ext_tt].range_member;
continue;
}
var tt_state = { range_member: ++this.range_member };
var name = 'tmol_cart_' + tt_state.range_member;
tt_state.selector = {};
tt_state.selector[name] = selectors[name] = [
this.gen_seat_selector({
type: 'none',
run_time_value: 0,
template: name,
overlay: 1
})
];
var tool_tip_details = this.seat_class_tool_tip_details({
seat_class: this.seat_ticket_types[pl][uq],
preferred: seat.sell_class.tt,
price_level: pl
});
tt_state.template = {};
tt_state.template[name] = templates[name] =
this.gen_seat_class_template(tool_tip_details);
state.cart_tts[ext_tt] = tt_state;
seat.range_member = tt_state.range_member;
if ( tt_state.range_member > this.range_member_allocate_to ) {
this.range_member_allocate_to *= 2;
this.svl_regen_seat_script = true;
}
}
return {
selectors: selectors,
templates: templates
};
},
gen_mask: function(start, count) {
var mask = 0;
for ( var i = 0; i < count; i++ ) {
mask = (mask << 1) | 1;
}
return mask << start;
},
initialize_svl_data: function() {
false;
var i;
this.range_member = 1;
this.range_member_allocate_to = 50;
this.svl_legend_color_and_mask = this.gen_mask(0, 3);
this.svl_legend_icon_and_mask = this.gen_mask(3, 3);
this.svl_price_lvl_offset = 6;
this.svl_seat_class_and_mask =
0x7FFFFFFF ^ (
this.svl_legend_color_and_mask
| this.svl_legend_icon_and_mask
);
this.svl_seat_rtv_NOT_AVAILABLE  = 0;
this.svl_seat_rtv_ALSO_AVAILABLE = 1;
this.svl_seat_rtv_MATCHES_SEARCH = 2;
this.svl_seat_rtv_SELECTED       = 3;
this.svl_seat_rtv_AVAILABLE      = 4;
this.svl_seat_rtv_UNAVAILABLE    = 5;
this.svl_seat_rtv_NO_ICON        = 0 << 3;
this.svl_seat_rtv_ACCESSIBLE     = 1 << 3;
this.svl_seat_rtv_AUCTION        = 2 << 3;
this.svl_seat_rtv_OFFER_CODE     = 3 << 3;
this.svl_seat_class_state = {};
this.svl_seat_class_state_index = 1;
this.svl_regen_seat_script = true;
this.svl_regen_poly_script = true;
var addna_lines = [];
for ( i = 0; i < this.isc.edp.event.addna.length; i++ ) {
var sec = this.isc.edp.event.addna[i];
addna_lines[i] = [
'[% @in_list(seat.secnam_list,"', sec.name, '")',
':"<p class=\'gray\'>',
this.escape_dquote(this.escape_lt(sec.description)),
'</p>"; %]'
].join('');
}
this.svl_addna_text = addna_lines.join('');
var polygon_script_lines = [
'1:select_polygon_template("BASE");'
];
var polygon_order = ['NONE', 'LOW', 'MEDIUM', 'HIGH'];
for ( i = 0; i < polygon_order.length; i++ ) {
var lvl_name = polygon_order[i];
var level = this.polygon_avail_levels[lvl_name];
polygon_script_lines.push(
this.gen_polygon_matches_script_line(
{
low: level.low_percentage,
high: level.high_percentage,
template: lvl_name
}
)
);
}
polygon_script_lines.push(
[
'page.are_seats_visible != 0',
' && polygon.is_ga != 0 && polygon.counters[1] != 0',
':select_polygon_template("GA_MATCHES");',
'page.are_seats_visible != 0',
' && polygon.is_ga != 0 && polygon.counters[1] == 0',
' && polygon.counters[2] != 0',
':select_polygon_template("GA_ALSO_AVAILABLE");',
'polygon.counters[0] == 0 || ',
'(polygon.counters[1] == 0 && polygon.counters[2] == 0)',
':select_polygon_template("NONE");'
].join('')
);
this.svl_base_polygon_script = polygon_script_lines.join('');
var polygon_templates = {};
var matches_search_cond = (
this.ga_avail_seats_threshold === null
? '1'
: [ 'polygon.is_ga == 0 || ',
'polygon.counters[1] + polygon.counters[2] < ',
this.ga_avail_seats_threshold
].join(''));
var also_avail_cond = (
this.ga_avail_seats_threshold === null
? 'polygon.counters[2] > 0'
: [ '(polygon.is_ga == 0 && polygon.counters[2] > 0) || ',
'(polygon.is_ga != 0 && polygon.counters[2] > 0 && ',
'polygon.counters[1] + polygon.counters[2] < ',
this.ga_avail_seats_threshold, ')'
].join(''));
var section_capacity_cond = (
this.ga_avail_seats_threshold === null
? '1'
: [ 'polygon.is_ga == 0 || ',
'polygon.counters[1] + polygon.counters[2] < ',
this.ga_avail_seats_threshold
].join(''));
var section_upsell;
var tabs = this.isc.market_tabs;
if ( tabs.auction_bid && this.isc.data.use_hover.auction ) {
section_upsell = this.tu.ISC_SVL_SECTION_AUCTION_UPSELL;
}
else if ( tabs.platinum && this.isc.data.use_hover.platinum ) {
section_upsell = this.tu.ISC_SVL_SECTION_PLATINUM_UPSELL;
}
else if ( tabs.exchange && this.isc.data.use_hover.exchange ) {
section_upsell = this.tu.ISC_SVL_SECTION_EXCHANGE_UPSELL;
}
var base_polygon_tooltip = [
'[% @polygon.is_ga != 0',
':"<p class=\'text12\'><span class=\'bolditalic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_GA_ONLY),
'</span></p>"; %]',
'[% @polygon.is_single_seats_only != 0 && polygon.is_ga == 0',
':"<p class=\'text12\'><span class=\'bolditalic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_ONLY_SINGLE_SEATS),
'</span></p>"; %]',
'[% @polygon.is_ga != 0 && polygon.counters[1] == 0',
' && polygon.counters[4] > 0',
' && polygon.counters[2] == polygon.counters[4]',
':"<p class=\'text12\'><span class=\'bolditalic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_OFFER_CODE),
'</span></p>"; %]',
'<p class=\'text12\'><span class=\'bold\'>',
'<span class=\'highlight\'>',
this.tu.ISC_SVL_SECTION_SECTION, ' [% section_name %]',
'</span></span></p>',
'[% @"[% min_price_text %]" != "null"',
':"<p>"; %]',
'[% @"[% min_price_text %]" != "null"',
':"[% min_price_text %]"; %]',
'[% @"[% min_price_text %]" != "null"',
' && "[% min_price_text %]" != "[% max_price_text %]"',
':" - [% max_price_text %]"; %]',
'[% @"[% min_price_text %]" != "null"',
':"</p>"; %]',
'[% @', matches_search_cond, ':"<p class=\'bold\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_MATCHES_SEARCH),
' "; %]',
'[% @', matches_search_cond, ':polygon.counters[1]; %]',
'[% @', matches_search_cond, ':"</p>"; %]',
'[% @', also_avail_cond, ':"<p>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_ALSO_AVAIL),
' "; %]',
'[% @', also_avail_cond, ':polygon.counters[2]; %]',
'[% @', also_avail_cond, ':"</p>"; %]',
( this.enable_section_capacity
? [
'[% @', section_capacity_cond, ':"<p>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_SECTION_CAPACITY),
' "; %]',
'[% @', section_capacity_cond, ':polygon.counters[0]; %]',
'[% @', section_capacity_cond, ':"</p>"; %]'
].join('')
: ''),
'[% @polygon.is_ga == 0',
':"<p></p><p class=\'italic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_CLICK_TO_BROWSE),
'</p>"; %]',
'[% @polygon.is_ga != 0',
':"<p></p><p class=\'italic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_CLICK_TO_BUY),
'</p>"; %]'
].join('');
polygon_templates.BASE = this.gen_polygon_template(
{
tool_tip_template: base_polygon_tooltip,
border: 0xFFFFFF
}
);
polygon_templates.MATCHES_SEARCH_HIGH = this.gen_polygon_template(
{
interior_color: 0x001D47
}
);
polygon_templates.MATCHES_SEARCH_MEDIUM = this.gen_polygon_template(
{
interior_color: 0x1D5D91
}
);
polygon_templates.MATCHES_SEARCH_LOW = this.gen_polygon_template(
{
interior_color: 0x6C95B7
}
);
polygon_templates.MATCHES_SEARCH_NONE = this.gen_polygon_template(
{
interior_color: 0x999999
}
);
polygon_templates.GA_MATCHES = this.gen_polygon_template(
{
interior_color: 0x001D47
}
);
polygon_templates.GA_ALSO_AVAILABLE = this.gen_polygon_template(
{
interior_color: 0x7DA1BA
}
);
var none_tooltip = [
'[% @polygon.is_ga != 0',
':"<p class=\'text12\'><span class=\'bolditalic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_GA_ONLY),
'</span></p>"; %]',
'[% @polygon.is_ga == 0',
':"<p class=\'text12\'><span class=\'bolditalic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_NO_SEATS_AVAIL),
'</span></p>"; %]',
'[% @polygon.is_ga != 0',
':"<p class=\'text12\'><span class=\'bolditalic\'>',
this.escape_dquote(this.tu.ISC_SVL_SECTION_NO_TICKETS_AVAIL),
'</span></p>"; %]',
'<p class=\'text12\'><span class=\'bold\'>',
'<span class=\'highlight\'>',
this.tu.ISC_SVL_SECTION_SECTION, ' [% section_name %]',
'</span></span></p>',
( section_upsell
? [ '<p class=\'text12\'><span class=\'highlight\'>',
section_upsell, '</span></p>' ].join('')
: '')
].join('');
polygon_templates.NONE = this.gen_polygon_template(
{
tool_tip_template: none_tooltip,
interior_color: 0x999999
}
);
polygon_templates.SELECTED = this.gen_polygon_template(
{
interior_color: 0xEF6307
}
);
this.svl_polygon_templates = polygon_templates;
this.svl_base_seat_script = {
encoders: [
'(seat.sell_class == 1',
' || seat.sell_class == 4',
' || seat.sell_class == 5)',
':run_defined_seat_encoders("tmol_ada_encoders");',
'(seat.seat_flags & 32) != 0',
' && (seat.sell_class != 1',
' && seat.sell_class != 4',
' && seat.sell_class != 5)',
':run_defined_seat_encoders(',
'"tmol_seat_legend_classified_encoders");',
'1:run_defined_seat_encoders("tmol_slp_encoders");'
].join(''),
selectors: [
'1:run_defined_seat_template_selectors("',
'tmol_seat_class_selectors");',
'1:run_defined_seat_template_selectors("',
'tmol_other_seat_selectors");'
].join(''),
counters: [
'1:set graphic.counter_deltas[0]=1;',
'(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_MATCHES_SEARCH,
':set graphic.counter_deltas[1]=1;',
'(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_ALSO_AVAILABLE,
':set graphic.counter_deltas[2]=1;',
'(seat.run_time_flags & ', this.svl_legend_color_and_mask,
') == ', this.svl_seat_rtv_ALSO_AVAILABLE,
' && (seat.run_time_flags & ', this.svl_legend_icon_and_mask,
') == ', this.svl_seat_rtv_NO_ICON,
':set graphic.counter_deltas[3]=1;',
'(seat.run_time_flags & ', this.svl_legend_icon_and_mask,
') == ', this.svl_seat_rtv_OFFER_CODE,
':set graphic.counter_deltas[4]=1;'
].join('')
};
var seat_selectors = [];
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_color',
run_time_value: this.svl_seat_rtv_MATCHES_SEARCH,
template: 'MATCHES_SEARCH',
overlay: 1
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_color',
run_time_value: this.svl_seat_rtv_ALSO_AVAILABLE,
template: 'ALSO_AVAILABLE',
overlay: 1
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_color',
run_time_value: this.svl_seat_rtv_SELECTED,
template: 'SELECTED',
overlay: 1
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_icon',
run_time_value: this.svl_seat_rtv_AUCTION,
template: 'AUCTION',
overlay: 1
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_icon',
run_time_value: this.svl_seat_rtv_OFFER_CODE,
template: 'OFFER_CODE',
overlay: 1
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_color',
run_time_value: this.svl_seat_rtv_NOT_AVAILABLE,
template: 'NOT_AVAILABLE_LEGEND'
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_color',
run_time_value: this.svl_seat_rtv_NOT_AVAILABLE,
template: 'NOT_AVAILABLE_SEAT'
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_icon',
run_time_value: this.svl_seat_rtv_ACCESSIBLE,
template: 'ACCESSIBLE_LEGEND',
overlay: 1
}
)
);
seat_selectors.push(
this.gen_seat_selector(
{
type: 'legend_icon',
run_time_value: this.svl_seat_rtv_ACCESSIBLE,
template: 'ACCESSIBLE_SEAT',
overlay: 1
}
)
);
this.svl_base_seat_selectors = {
tmol_other_seat_selectors: seat_selectors
};
this.svl_base_seat_encoders = {
tmol_ada_encoders: this.gen_ada_encoders(),
tmol_classified_encoders: this.gen_classified_encoders(),
tmol_slp_encoders: this.gen_slp_encoders(),
tmol_matches: this.gen_seat_matches_encoders()
};
this.svl_seat_legend_templates = this.gen_seat_legend_templates();
this.svl_breakout_text = {
fees: this.escape_dquote(this.tu.SEAT_SELECTION_FEES),
taxes: this.escape_dquote(this.tu.CONFIRMATION_ADDITIONAL_TAXES),
fees_taxes: [
this.escape_dquote(this.tu.SEAT_SELECTION_FEES),
"/",
this.escape_dquote(this.tu.CONFIRMATION_ADDITIONAL_TAXES)
].join('')
};
},
generate_seatmap_shader_script: function() {
false;
var i;
var data = {};
var scripts = [];
var seat_selectors = {};
var seat_templates = {};
var seat_encoders = {};
var seat_class_selectors = [];
var seat_class_encoders = [];
var seat_class_data = this.gen_seat_classes();
seat_class_selectors = seat_class_data.selectors;
seat_templates = seat_class_data.templates;
seat_class_encoders = seat_class_data.encoders;
var cart_data = this.gen_cart_svl_data();
if ( seat_class_selectors.length > 0 ) {
seat_selectors.tmol_seat_class_selectors = seat_class_selectors;
}
for ( i in cart_data.selectors ) {
seat_selectors[i] = cart_data.selectors[i];
}
if ( !this.shader_data ) {
for ( i in this.svl_base_seat_selectors ) {
seat_selectors[i] = this.svl_base_seat_selectors[i];
}
}
for ( i in cart_data.templates ) {
seat_templates[i] = cart_data.templates[i];
}
if ( !this.shader_data ) {
for ( i in this.svl_seat_legend_templates ) {
seat_templates[i] = this.svl_seat_legend_templates[i];
}
}
if ( seat_class_encoders.length > 0 ) {
seat_encoders.tmol_seat_class_encoders = seat_class_encoders;
}
if ( !this.shader_data ) {
for ( i in this.svl_base_seat_encoders ) {
seat_encoders[i] = this.svl_base_seat_encoders[i];
}
}
if ( !this.shader_data ) {
data.polygon_shading_template_hash = this.svl_polygon_templates;
}
if ( !this.object_is_empty(seat_encoders) ) {
data.seat_condition_encoder_hash = seat_encoders;
}
if ( !this.object_is_empty(seat_selectors) ) {
data.seat_template_selector_hash = seat_selectors;
}
if ( !this.object_is_empty(seat_templates) ) {
data.seat_shading_template_hash = seat_templates;
}
if ( this.svl_regen_seat_script )
scripts.push(
{
procedure_point: "shade_seat",
script: this.gen_seat_script()
}
);
if ( this.svl_regen_poly_script )
scripts.push(
{
procedure_point: "shade_polygon",
script: this.gen_polygon_script()
}
);
this.shader_data = data;
this.shader_script = scripts;
false;
false;
},
update_ticket_type_choices: function( ticket_types ) {
},
update_price_range: function( range ) {
}
} );

